[asterisk-commits] mjordan: testsuite/asterisk/trunk r6451 - in /asterisk/trunk/tests/channels/S...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 16 09:58:33 CST 2015


Author: mjordan
Date: Mon Feb 16 09:58:23 2015
New Revision: 6451

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=6451
Log:
tests/channels/SIP/sip_blind_transfer: Start PJSUA instances earlier

In some test failures for the sip_blind_transfer tests, Asterisk will receive
a 503 back from a PJSUA instance that it sent an INVITE request to. This is
most likely due to the PJSUA instance not yet being fully initialized and ready
for an inbound INVITE request. The PJSUA instances used for these tests were
originally instantiated during the AMI connect callback; this meant that the
processes were spawned almost immediately before the calls were made from
the callee instance to Asterisk to the receiver instance.

This patch moves the startup of the PJSUA instances to the TestCase derived
class's constructor. This gives them a bit more time to spin up, as Asterisk
itself is not yet created at that point. This should make the tests slightly
more reliable.

Note that these tests could stand some serious refactoring to make use of the
new phone controller module that was just merged, but that's a patch for
another day.

Modified:
    asterisk/trunk/tests/channels/SIP/sip_blind_transfer/callee_refer_only/run-test
    asterisk/trunk/tests/channels/SIP/sip_blind_transfer/callee_with_reinvite/run-test
    asterisk/trunk/tests/channels/SIP/sip_blind_transfer/caller_refer_only/run-test
    asterisk/trunk/tests/channels/SIP/sip_blind_transfer/caller_with_reinvite/run-test

Modified: asterisk/trunk/tests/channels/SIP/sip_blind_transfer/callee_refer_only/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_blind_transfer/callee_refer_only/run-test?view=diff&rev=6451&r1=6450&r2=6451
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_blind_transfer/callee_refer_only/run-test (original)
+++ asterisk/trunk/tests/channels/SIP/sip_blind_transfer/callee_refer_only/run-test Mon Feb 16 09:58:23 2015
@@ -39,6 +39,10 @@
         self.passed = False
         self.channel1 = None
         self.transfer_event_received = False
+
+        # start up the processes
+        self.start_processes()
+
         self.create_asterisk()
 
     def read_result(self):
@@ -56,8 +60,6 @@
     def ami_connect(self, ami):
         TestCase.ami_connect(self, ami)
 
-        # start up the processes
-        self.start_processes()
         if AsteriskVersion() >= AsteriskVersion("12"):
             ami.registerEvent('BridgeEnter', self.bridge_enter_event_handler)
             ami.registerEvent('BlindTransfer', self.blind_transfer_event_handler)

Modified: asterisk/trunk/tests/channels/SIP/sip_blind_transfer/callee_with_reinvite/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_blind_transfer/callee_with_reinvite/run-test?view=diff&rev=6451&r1=6450&r2=6451
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_blind_transfer/callee_with_reinvite/run-test (original)
+++ asterisk/trunk/tests/channels/SIP/sip_blind_transfer/callee_with_reinvite/run-test Mon Feb 16 09:58:23 2015
@@ -39,6 +39,10 @@
         self.passed = False
         self.channel1 = None
         self.transfer_event_received = False
+
+        # start up the processes
+        self.start_processes()
+
         self.create_asterisk()
 
     def read_result(self):
@@ -56,8 +60,6 @@
     def ami_connect(self, ami):
         TestCase.ami_connect(self, ami)
 
-        # start up the processes
-        self.start_processes()
         if AsteriskVersion() >= AsteriskVersion("12"):
             ami.registerEvent('BridgeEnter', self.bridge_enter_event_handler)
             ami.registerEvent('BlindTransfer', self.blind_transfer_event_handler)

Modified: asterisk/trunk/tests/channels/SIP/sip_blind_transfer/caller_refer_only/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_blind_transfer/caller_refer_only/run-test?view=diff&rev=6451&r1=6450&r2=6451
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_blind_transfer/caller_refer_only/run-test (original)
+++ asterisk/trunk/tests/channels/SIP/sip_blind_transfer/caller_refer_only/run-test Mon Feb 16 09:58:23 2015
@@ -39,6 +39,10 @@
         self.passed = False
         self.channel1 = None
         self.transfer_event_received = False
+
+        # start up the processes
+        self.start_processes()
+
         self.create_asterisk()
 
     def read_result(self):
@@ -56,8 +60,6 @@
     def ami_connect(self, ami):
         TestCase.ami_connect(self, ami)
 
-        # start up the processes
-        self.start_processes()
         if AsteriskVersion() >= AsteriskVersion("12"):
             ami.registerEvent('BridgeEnter', self.bridge_enter_event_handler)
             ami.registerEvent('BlindTransfer', self.blind_transfer_event_handler)

Modified: asterisk/trunk/tests/channels/SIP/sip_blind_transfer/caller_with_reinvite/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_blind_transfer/caller_with_reinvite/run-test?view=diff&rev=6451&r1=6450&r2=6451
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_blind_transfer/caller_with_reinvite/run-test (original)
+++ asterisk/trunk/tests/channels/SIP/sip_blind_transfer/caller_with_reinvite/run-test Mon Feb 16 09:58:23 2015
@@ -39,6 +39,10 @@
         self.passed = False
         self.channel1 = None
         self.transfer_event_received = False
+
+        # start up the processes
+        self.start_processes()
+
         self.create_asterisk()
 
     def read_result(self):
@@ -56,15 +60,6 @@
     def ami_connect(self, ami):
         TestCase.ami_connect(self, ami)
 
-        # start up the processes
-        self.start_processes()
-        reactor.callLater
-
-    def ami_connect(self, ami):
-        TestCase.ami_connect(self, ami)
-
-        # start up the processes
-        self.start_processes()
         if AsteriskVersion() >= AsteriskVersion("12"):
             ami.registerEvent('BridgeEnter', self.bridge_enter_event_handler)
             ami.registerEvent('BlindTransfer', self.blind_transfer_event_handler)




More information about the asterisk-commits mailing list