コード例 #1
0
    def test_SASLClient(self):
        """Test SASL Anonymous with Initiator"""

        factory = SASLAnonClientFactory()
        factory.addProfile(echoprofile)
        factory.addProfile(saslanonymousprofile)

        reactor.connectTCP('localhost', 1976, factory)
        reactor.run()

        if factory.reason:
            raise Exception(factory.reason.getErrorMessage())
コード例 #2
0
ファイル: test_tlsprofile.py プロジェクト: Wurldtech/beepy
    def test_TLSClient(self):
        factory = TLSEchoClientFactory()
        factory.addProfile(echoprofile)
        factory.addProfile(tlsprofile)

        reactor.connectTCP("localhost", 1976, factory)
        reactor.run()

        log.debug("Finished reactor run")

        if factory.reason:
            log.debug("oh no! normal reason!")
            raise Exception(factory.reason.getErrorMessage())
コード例 #3
0
    def test_createSASLOTPSession(self):
        """Test SASL OTP with no CDATA init"""

        factory = SASLOTPClientFactory()
        factory.addProfile(echoprofile)
        factory.addProfile(saslotpprofile)

        #        log.debug("Reactor state: %s" % reactor.removeAll())

        reactor.connectTCP("localhost", 1976, factory)
        reactor.run()

        if factory.reason:
            log.error("Error occurred in factory: %s" % factory.reason)
            raise Exception(factory.reason.getErrorMessage())
コード例 #4
0
ファイル: saslotpclient.py プロジェクト: Wurldtech/beepy
            log.debug('Echo channel started successfully.')
            channel = self.getChannel(channelnum)
            msgno = channel.sendMessage('Echo 1!')
            msgno = channel.sendMessage('Echo 2!')
            msgno = channel.sendMessage('Echo 3!')
            msgno = channel.sendMessage('Echo 4!')
            msgno = channel.sendMessage('Echo 5!')
            msgno = channel.sendMessage('Echo 6!')

        else:
            log.debug('Unknown channel created: %d' % channelnum)

    def authenticationSucceeded(self):
        log.debug('Authentication Succeeded!')
        self.echochannel = self.newChannel(echoprofile)

class SASLAnonClientFactory(SASLClientFactory):
    """ This is a short factory for echo clients
    """
    protocol = SASLAnonClientProtocol


if __name__ == '__main__':
    factory = SASLAnonClientFactory()
    factory.addProfile(echoprofile)
    factory.addProfile(saslotpprofile)

    reactor.connectTCP('localhost', 1976, factory)
    reactor.run()

コード例 #5
0
ファイル: test_echoprofile.py プロジェクト: Wurldtech/beepy
 def tearDown(self):
     self.client.terminate()
     reactor.iterate()
     reactor.stop()
     reactor.run()
コード例 #6
0
ファイル: test_initiator.py プロジェクト: Wurldtech/beepy
 def test_connect(self):
     """ Test a simple connection to a listening BEEP server
     """
     factory = InitiatorTestFactory()
     reactor.connectTCP('localhost', 1976, factory)
     reactor.run()