[asterisk-commits] pabelanger: branch pabelanger/SIP_SRTP r2158 - in /asterisk/team/pabelanger/S...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 9 13:55:54 CDT 2011


Author: pabelanger
Date: Fri Sep  9 13:55:50 2011
New Revision: 2158

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=2158
Log:
First round of updates

Modified:
    asterisk/team/pabelanger/SIP_SRTP/tests/channels/SIP/sip_srtp/run-test
    asterisk/team/pabelanger/SIP_SRTP/tests/channels/SIP/sip_srtp/test-config.yaml
    asterisk/team/pabelanger/SIP_SRTP/tests/channels/SIP/tests.yaml

Modified: asterisk/team/pabelanger/SIP_SRTP/tests/channels/SIP/sip_srtp/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/SIP_SRTP/tests/channels/SIP/sip_srtp/run-test?view=diff&rev=2158&r1=2157&r2=2158
==============================================================================
--- asterisk/team/pabelanger/SIP_SRTP/tests/channels/SIP/sip_srtp/run-test (original)
+++ asterisk/team/pabelanger/SIP_SRTP/tests/channels/SIP/sip_srtp/run-test Fri Sep  9 13:55:50 2011
@@ -9,11 +9,13 @@
 
 import sys
 import os
-import time
-from twisted.internet import reactor, defer
+import logging
+from twisted.internet import reactor
 
 sys.path.append("lib/python")
 from asterisk.TestCase import TestCase
+
+logger = logging.getLogger(__name__)
 
 class SIPCallTest(TestCase):
     def __init__(self):
@@ -31,18 +33,24 @@
         # Create two Asterisk instances ...
         self.create_asterisk(2)
 
+    def ami_connect(self, ami):
+        TestCase.ami_connect(self, ami)
+        self.ami[0].originate(
+            channel = "SIP/2000/2000",
+            context = "siptest1",
+            exten = "1000",
+            priority = "1",
+        )
+
     # This is called when the reactor has started running.
     def run(self):
         TestCase.run(self)
-
-        print "Initiating test call"
-        self.ast[0].cli_exec(
-            "originate SIP/2000/2000 extension 1000 at siptest1")
+        self.create_ami_factory()
 
     # This is called by each Asterisk instance if the call gets connected.
     def fastagi_connect(self, agi):
         def get_test_result(val):
-            print "Connection result '%s'" % val
+            logger.debug("Connection result '%s'" % val)
             if val.split("-")[0] == "SIP/2000":
                 # Outgoing call on Ast1
                 self.connected_chan1 = True
@@ -54,12 +62,7 @@
                 if val.split("=")[1] == "1":
                     self.connected_srtp2 = True
             else:
-                print "Don't know which side is connected."
-
-            # 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
-            #agi.finish()
+               logger.warning("Don't know which side is connected.")
 
         agi.getVariable("TEST_RESULT").addCallback(get_test_result)
 
@@ -67,12 +70,12 @@
         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)
+        logger.debug("self.connected_chan1:%s" % (self.connected_chan1))
+        logger.debug("self.connected_srtp1:%s" % (self.connected_srtp1))
+        logger.debug("self.connected_chan2:%s" % (self.connected_chan2))
+        logger.debug("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"
+            logger.info("Test passed")
             self.passed = True
 
 def main():

Modified: asterisk/team/pabelanger/SIP_SRTP/tests/channels/SIP/sip_srtp/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/SIP_SRTP/tests/channels/SIP/sip_srtp/test-config.yaml?view=diff&rev=2158&r1=2157&r2=2158
==============================================================================
--- asterisk/team/pabelanger/SIP_SRTP/tests/channels/SIP/sip_srtp/test-config.yaml (original)
+++ asterisk/team/pabelanger/SIP_SRTP/tests/channels/SIP/sip_srtp/test-config.yaml Fri Sep  9 13:55:50 2011
@@ -9,4 +9,4 @@
     dependencies:
         - python : 'twisted'
         - python : 'starpy'
-
+        - asterisk : 'res_strp'

Modified: asterisk/team/pabelanger/SIP_SRTP/tests/channels/SIP/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/SIP_SRTP/tests/channels/SIP/tests.yaml?view=diff&rev=2158&r1=2157&r2=2158
==============================================================================
--- asterisk/team/pabelanger/SIP_SRTP/tests/channels/SIP/tests.yaml (original)
+++ asterisk/team/pabelanger/SIP_SRTP/tests/channels/SIP/tests.yaml Fri Sep  9 13:55:50 2011
@@ -15,7 +15,7 @@
     - test: 'sip_register'
     - test: 'sip_channel_params'
     - test: 'sip_tls_call'
-#    - test: 'sip_srtp'
+    - test: 'sip_srtp'
     - test: 'noload_res_srtp'
 #    - test: 'noload_res_srtp_attempt_srtp'
 #    - test: 'secure_bridge_media'




More information about the asterisk-commits mailing list