def setUp(self):
        if hasattr(self, 'ipb_client'):
            yield SMPPClientTestCases.setUp(self, interceptorpb_client=self.ipb_client)
        else:
            yield SMPPClientTestCases.setUp(self)

        # Initiating config objects without any filename
        # will lead to setting defaults and that's what we
        # need to run the tests
        deliverSmThrowerConfigInstance = deliverSmThrowerConfig()

        # Launch the deliverSmThrower
        self.deliverSmThrower = deliverSmThrower(deliverSmThrowerConfigInstance)

        # Add the broker to the deliverSmThrower
        yield self.deliverSmThrower.addAmqpBroker(self.amqpBroker)

        # Add SMPPs factory to DLRThrower
        self.deliverSmThrower.addSmpps(self.smpps_factory)

        # Connect to RouterPB
        yield self.connect('127.0.0.1', self.pbPort)
        # Provision mt interceptor
        self.mo_interceptor = MOInterceptorScript(self.script)
        yield self.mointerceptor_add(DefaultInterceptor(self.mo_interceptor), 0)
        # Disconnect from RouterPB
        self.disconnect()
Пример #2
0
    def setUp(self):
        yield SMPPClientTestCases.setUp(self)

        # Initiating config objects without any filename
        # will lead to setting defaults and that's what we
        # need to run the tests
        deliverSmThrowerConfigInstance = deliverSmThrowerConfig()
        # Lower the timeout config to pass the timeout tests quickly
        deliverSmThrowerConfigInstance.timeout = 2
        deliverSmThrowerConfigInstance.retry_delay = 1
        deliverSmThrowerConfigInstance.max_retries = 2

        # Launch the deliverSmThrower
        self.deliverSmThrower = deliverSmThrower(deliverSmThrowerConfigInstance)

        # Add the broker to the deliverSmThrower
        yield self.deliverSmThrower.addAmqpBroker(self.amqpBroker)

        # Add SMPPs factory to DLRThrower
        self.deliverSmThrower.addSmpps(self.smpps_factory)

        # Test vars:
        self.testDeliverSMPdu = DeliverSM(
            source_addr='1234',
            destination_addr='4567',
            short_message='hello !',
        )
    def setUp(self):
        yield SMPPClientTestCases.setUp(self)

        # Initiating config objects without any filename
        # will lead to setting defaults and that's what we
        # need to run the tests
        deliverSmThrowerConfigInstance = deliverSmThrowerConfig()
        # Lower the timeout config to pass the timeout tests quickly
        deliverSmThrowerConfigInstance.timeout = 2
        deliverSmThrowerConfigInstance.retry_delay = 1
        deliverSmThrowerConfigInstance.max_retries = 2

        # Launch the deliverSmThrower
        self.deliverSmThrower = deliverSmThrower()
        self.deliverSmThrower.setConfig(deliverSmThrowerConfigInstance)

        # Add the broker to the deliverSmThrower
        yield self.deliverSmThrower.addAmqpBroker(self.amqpBroker)

        # Add SMPPs factory to DLRThrower
        self.deliverSmThrower.addSmpps(self.smpps_factory)

        # Test vars:
        self.testDeliverSMPdu = DeliverSM(
            source_addr='1234',
            destination_addr='4567',
            short_message='hello !',
        )
    def setUp(self):
        yield SMPPClientTestCases.setUp(self)

        # Init SMPPServerPB
        SMPPServerPBConfigInstance = SMPPServerPBConfig()
        SMPPServerPBInstance = SMPPServerPB(SMPPServerPBConfigInstance)
        SMPPServerPBInstance.addSmpps(self.smpps_factory)

        p = portal.Portal(JasminPBRealm(SMPPServerPBInstance))
        c = InMemoryUsernamePasswordDatabaseDontUse()
        c.addUser('smppsadmin', md5('smppspwd').digest())
        p.registerChecker(c)
        jPBPortalRoot = JasminPBPortalRoot(p)
        self.SMPPServerPBInstanceServer = reactor.listenTCP(SMPPServerPBConfigInstance.port,
                                                            pb.PBServerFactory(jPBPortalRoot))

        # Init SMPPServerPBClient and connect it to SMPPServerPB
        SMPPServerPBClientConfigInstance = SMPPServerPBClientConfig()
        self.SMPPServerPBProxyInstance = SMPPServerPBProxy()
        yield self.SMPPServerPBProxyInstance.connect(
            SMPPServerPBClientConfigInstance.host,
            SMPPServerPBClientConfigInstance.port,
            SMPPServerPBClientConfigInstance.username,
            SMPPServerPBClientConfigInstance.password,
            retry=False)

        # Lower the timeout config to pass the timeout tests quickly
        self.DLRThrower.config.timeout = 2
        self.DLRThrower.config.retry_delay = 1
        self.DLRThrower.config.max_retries = 2

        # Most important thing:
        # Swap default direct smpps access to perspectivebroker smpps access:
        self.DLRThrower.addSmpps(self.SMPPServerPBProxyInstance)
Пример #5
0
    def setUp(self):
        yield SMPPClientTestCases.setUp(self)

        # Lower the timeout config to pass the timeout tests quickly
        self.DLRThrower.config.timeout = 2
        self.DLRThrower.config.retry_delay = 1
        self.DLRThrower.config.max_retries = 2
    def setUp(self):
        if hasattr(self, 'ipb_client'):
            yield SMPPClientTestCases.setUp(self, interceptorpb_client=self.ipb_client)
        else:
            yield SMPPClientTestCases.setUp(self)

        # Connect to RouterPB
        yield self.connect('127.0.0.1', self.pbPort)
        # Provision mt interceptor
        self.mt_interceptor = MTInterceptorScript(self.script)
        yield self.mtinterceptor_add(DefaultInterceptor(self.mt_interceptor), 0)
        # Disconnect from RouterPB
        self.disconnect()

        # Get stats singletons
        self.stats_smpps = SMPPServerStatsCollector().get(cid=self.smpps_config.id)
Пример #7
0
    def setUp(self):
        yield SMPPClientTestCases.setUp(self)

        # Init SMPPServerPB
        SMPPServerPBConfigInstance = SMPPServerPBConfig()
        SMPPServerPBInstance = SMPPServerPB(SMPPServerPBConfigInstance)
        SMPPServerPBInstance.addSmpps(self.smpps_factory)

        p = portal.Portal(JasminPBRealm(SMPPServerPBInstance))
        c = InMemoryUsernamePasswordDatabaseDontUse()
        c.addUser('smppsadmin', md5('smppspwd').digest())
        p.registerChecker(c)
        jPBPortalRoot = JasminPBPortalRoot(p)
        self.SMPPServerPBInstanceServer = reactor.listenTCP(
            SMPPServerPBConfigInstance.port, pb.PBServerFactory(jPBPortalRoot))

        # Init SMPPServerPBClient and connect it to SMPPServerPB
        SMPPServerPBClientConfigInstance = SMPPServerPBClientConfig()
        self.SMPPServerPBProxyInstance = SMPPServerPBProxy()
        yield self.SMPPServerPBProxyInstance.connect(
            SMPPServerPBClientConfigInstance.host,
            SMPPServerPBClientConfigInstance.port,
            SMPPServerPBClientConfigInstance.username,
            SMPPServerPBClientConfigInstance.password,
            retry=False)

        # Lower the timeout config to pass the timeout tests quickly
        self.DLRThrower.config.timeout = 2
        self.DLRThrower.config.retry_delay = 1
        self.DLRThrower.config.max_retries = 2

        # Most important thing:
        # Swap default direct smpps access to perspectivebroker smpps access:
        self.DLRThrower.addSmpps(self.SMPPServerPBProxyInstance)
Пример #8
0
    def setUp(self):
        yield SMPPClientTestCases.setUp(self)

        # Lower the timeout config to pass the timeout tests quickly
        self.DLRThrower.config.timeout = 2
        self.DLRThrower.config.retry_delay = 1
        self.DLRThrower.config.max_retries = 2
    def setUp(self):
        if hasattr(self, 'ipb_client'):
            yield SMPPClientTestCases.setUp(self, interceptorpb_client = self.ipb_client)
        else:
            yield SMPPClientTestCases.setUp(self)

        # Connect to RouterPB
        yield self.connect('127.0.0.1', self.pbPort)
        # Provision mt interceptor
        self.mt_interceptor = MTInterceptorScript(self.script)
        yield self.mtinterceptor_add(DefaultInterceptor(self.mt_interceptor), 0)
        # Disconnect from RouterPB
        self.disconnect()

        # Get stats singletons
        self.stats_smpps = SMPPServerStatsCollector().get(cid = self.smpps_config.id)
Пример #10
0
    def setUp(self):
        yield SMPPClientTestCases.setUp(self)

        # Initiating config objects without any filename
        # will lead to setting defaults and that's what we
        # need to run the tests
        deliverSmThrowerConfigInstance = deliverSmThrowerConfig()

        # Launch the deliverSmThrower
        self.deliverSmThrower = deliverSmThrower()
        self.deliverSmThrower.setConfig(deliverSmThrowerConfigInstance)

        # Add the broker to the deliverSmThrower
        yield self.deliverSmThrower.addAmqpBroker(self.amqpBroker)

        # Add SMPPs factory to DLRThrower
        self.deliverSmThrower.addSmpps(self.smpps_factory)
Пример #11
0
    def setUp(self):
        yield SMPPClientTestCases.setUp(self)

        # Initiating config objects without any filename
        # will lead to setting defaults and that's what we
        # need to run the tests
        deliverSmThrowerConfigInstance = deliverSmThrowerConfig()

        # Launch the deliverSmThrower
        self.deliverSmThrower = deliverSmThrower()
        self.deliverSmThrower.setConfig(deliverSmThrowerConfigInstance)

        # Add the broker to the deliverSmThrower
        yield self.deliverSmThrower.addAmqpBroker(self.amqpBroker)

        # Add SMPPs factory to DLRThrower
        self.deliverSmThrower.addSmpps(self.smpps_factory)
Пример #12
0
 def tearDown(self):
     yield SMPPClientTestCases.tearDown(self)
     yield self.deliverSmThrower.stopService()
Пример #13
0
 def tearDown(self):
     yield SMPPClientTestCases.tearDown(self)
     yield self.SMPPServerPBProxyInstance.disconnect()
     yield self.SMPPServerPBInstanceServer.stopListening()
 def tearDown(self):
     yield SMPPClientTestCases.tearDown(self)
 def tearDown(self):
     yield SMPPClientTestCases.tearDown(self)
Пример #16
0
 def tearDown(self):
     yield self.deliverSmThrower.stopService()
     yield SMPPClientTestCases.tearDown(self)
 def tearDown(self):
     yield SMPPClientTestCases.tearDown(self)
     yield self.SMPPServerPBProxyInstance.disconnect()
     yield self.SMPPServerPBInstanceServer.stopListening()