[svn-commits] twilson: testsuite/asterisk/trunk r2877 - in /asterisk/trunk/tests/channels/S...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Dec 12 10:51:43 CST 2011


Author: twilson
Date: Mon Dec 12 10:51:40 2011
New Revision: 2877

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=2877
Log:
Fix and re-enable SRTP tests

Modified:
    asterisk/trunk/tests/channels/SIP/noload_res_srtp/run-test
    asterisk/trunk/tests/channels/SIP/noload_res_srtp_attempt_srtp/configs/ast1/sip.conf
    asterisk/trunk/tests/channels/SIP/noload_res_srtp_attempt_srtp/run-test
    asterisk/trunk/tests/channels/SIP/sip_srtp/run-test
    asterisk/trunk/tests/channels/SIP/tests.yaml

Modified: asterisk/trunk/tests/channels/SIP/noload_res_srtp/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/noload_res_srtp/run-test?view=diff&rev=2877&r1=2876&r2=2877
==============================================================================
--- asterisk/trunk/tests/channels/SIP/noload_res_srtp/run-test (original)
+++ asterisk/trunk/tests/channels/SIP/noload_res_srtp/run-test Mon Dec 12 10:51:40 2011
@@ -56,6 +56,10 @@
             else:
                 print "Don't know which side is connected."
 
+            if self.connected_chan1 and self.connected_no_srtp1 and self.connected_chan2 and self.connected_no_srtp2:
+                print "Test passed"
+                self.passed = True
+                reactor.stop()
             # Hold the AGI connection until the reactor times out
             # so the other side has a chance to get its test result.
             ## Drop the AGI connection
@@ -71,9 +75,6 @@
         print "self.connected_no_srtp1:%s" % (self.connected_no_srtp1)
         print "self.connected_chan2:   %s" % (self.connected_chan2)
         print "self.connected_no_srtp2:%s" % (self.connected_no_srtp2)
-        if self.connected_chan1 and self.connected_no_srtp1 and self.connected_chan2 and self.connected_no_srtp2:
-            print "Test passed"
-            self.passed = True
 
 def main():
     test = SIPCallTest()

Modified: asterisk/trunk/tests/channels/SIP/noload_res_srtp_attempt_srtp/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/noload_res_srtp_attempt_srtp/configs/ast1/sip.conf?view=diff&rev=2877&r1=2876&r2=2877
==============================================================================
--- asterisk/trunk/tests/channels/SIP/noload_res_srtp_attempt_srtp/configs/ast1/sip.conf (original)
+++ asterisk/trunk/tests/channels/SIP/noload_res_srtp_attempt_srtp/configs/ast1/sip.conf Mon Dec 12 10:51:40 2011
@@ -6,6 +6,7 @@
                                 ; Optionally add a port number, 192.168.1.1:5062 (default is port 5060)
 
 sipdebug=yes
+storesipcause=yes
 
 [authentication]
 

Modified: asterisk/trunk/tests/channels/SIP/noload_res_srtp_attempt_srtp/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/noload_res_srtp_attempt_srtp/run-test?view=diff&rev=2877&r1=2876&r2=2877
==============================================================================
--- asterisk/trunk/tests/channels/SIP/noload_res_srtp_attempt_srtp/run-test (original)
+++ asterisk/trunk/tests/channels/SIP/noload_res_srtp_attempt_srtp/run-test Mon Dec 12 10:51:40 2011
@@ -48,8 +48,7 @@
         self.ami[ami.id].registerEvent("VarSet", self.ami_test_varset)
 
         print "Initiating test call"
-        self.ast[0].cli_exec(
-            "originate SIP/2000/2000 extension 1000 at siptest1")
+        self.ast[0].cli_originate("SIP/2000/2000 extension 1000 at siptest1", blocking=False)
 
     # This is called whenever an AMI VarSet event occurs on Ast1.
     def ami_test_varset(self, ami, event):
@@ -61,7 +60,7 @@
             return
         print "  Value of event[variable] = %s" % (event["variable"])
         print "  Value of event[value] = %s" % (event["value"])
-        if 0 <= event["variable"].startswith("~HASH~SIP_CAUSE~"):
+        if event["variable"].startswith("~HASH~SIP_CAUSE~"):
             cause_code = event["value"].split(" ")[1]
             if cause_code == "488":
                 # The call failed for the expected reason "488 Not acceptable".

Modified: asterisk/trunk/tests/channels/SIP/sip_srtp/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_srtp/run-test?view=diff&rev=2877&r1=2876&r2=2877
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_srtp/run-test (original)
+++ asterisk/trunk/tests/channels/SIP/sip_srtp/run-test Mon Dec 12 10:51:40 2011
@@ -36,8 +36,7 @@
         TestCase.run(self)
 
         print "Initiating test call"
-        self.ast[0].cli_exec(
-            "originate SIP/2000/2000 extension 1000 at siptest1")
+        self.ast[0].cli_originate("SIP/2000/2000 extension 1000 at siptest1")
 
     # This is called by each Asterisk instance if the call gets connected.
     def fastagi_connect(self, agi):
@@ -56,6 +55,10 @@
             else:
                 print "Don't know which side is connected."
 
+            if self.connected_chan1 and self.connected_srtp1 and self.connected_chan2 and self.connected_srtp2:
+                print "Test passed"
+                self.passed = True
+                reactor.stop()
             # Hold the AGI connection until the reactor times out
             # so the other side has a chance to get its test result.
             ## Drop the AGI connection
@@ -65,15 +68,6 @@
 
     def stop_asterisk(self):
         TestCase.stop_asterisk(self)
-
-        # Determine if the test passed
-        print "self.connected_chan1:%s" % (self.connected_chan1)
-        print "self.connected_srtp1:%s" % (self.connected_srtp1)
-        print "self.connected_chan2:%s" % (self.connected_chan2)
-        print "self.connected_srtp2:%s" % (self.connected_srtp2)
-        if self.connected_chan1 and self.connected_srtp1 and self.connected_chan2 and self.connected_srtp2:
-            print "Test passed"
-            self.passed = True
 
 def main():
     test = SIPCallTest()

Modified: asterisk/trunk/tests/channels/SIP/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/tests.yaml?view=diff&rev=2877&r1=2876&r2=2877
==============================================================================
--- asterisk/trunk/tests/channels/SIP/tests.yaml (original)
+++ asterisk/trunk/tests/channels/SIP/tests.yaml Mon Dec 12 10:51:40 2011
@@ -17,10 +17,10 @@
     - test: 'sip_channel_params'
     - test: 'sip_tls_call'
     - test: 'sip_tls_register'
-#    - test: 'sip_srtp'
+    - test: 'sip_srtp'
     - test: 'noload_res_srtp'
-#    - test: 'noload_res_srtp_attempt_srtp'
-#    - test: 'secure_bridge_media'
+    - test: 'noload_res_srtp_attempt_srtp'
+    - test: 'secure_bridge_media'
     - test: 'message_disabled'
     - test: 'message_unauth'
     - test: 'message_auth'




More information about the svn-commits mailing list