[asterisk-commits] jrose: testsuite/asterisk/trunk r2646 - in /asterisk/trunk/tests/channels/SIP...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 25 11:06:39 CDT 2011


Author: jrose
Date: Tue Oct 25 11:06:36 2011
New Revision: 2646

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=2646
Log:
Fixes sip_tls_call test and removes its skip parameter.

The 'random' failures exhibited by sip_tls_call were caused by sip_helper.inc having
incorrect values at the start of a fresh checkout and the order things were done in
the start of the test.  Before, the test would copy the config files and then alter
the existing config files, which means that every iteration of the test would use the
previously existing config files rather than the freshly built ones. Now configuration
files are modified first and then the asterisk instances are created.


Removed:
    asterisk/trunk/tests/channels/SIP/sip_tls_call/configs/ast1/sip_helper.inc
    asterisk/trunk/tests/channels/SIP/sip_tls_call/configs/ast2/sip_helper.inc
Modified:
    asterisk/trunk/tests/channels/SIP/sip_tls_call/run-test
    asterisk/trunk/tests/channels/SIP/sip_tls_call/test-config.yaml

Modified: asterisk/trunk/tests/channels/SIP/sip_tls_call/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_tls_call/run-test?view=diff&rev=2646&r1=2645&r2=2646
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_tls_call/run-test (original)
+++ asterisk/trunk/tests/channels/SIP/sip_tls_call/run-test Tue Oct 25 11:06:36 2011
@@ -32,23 +32,35 @@
     def __init__(self):
         TestCase.__init__(self)
 
+        workingdir = "channels/SIP/sip_tls_call"
+        testdir = "tests/%s" % workingdir
+
+        # Additional setup for config files and keys
+        print "Building test resources ..."
+        if os.path.exists('%s/configs/ast1/sip_helper.inc' % (testdir)):
+            os.remove('%s/configs/ast1/sip_helper.inc' % (testdir))
+        shutil.copy('%s/configs/helper1' % (testdir), '%s/configs/ast1/sip_helper.inc' % (testdir))
+
+        if os.path.exists('%s/configs/ast2/sip_helper.inc' % (testdir)):
+            os.remove('%s/configs/ast2/sip_helper.inc' % (testdir))
+        shutil.copy('%s/configs/helper2' % (testdir), '%s/configs/ast2/sip_helper.inc' % (testdir))
+        file_replace_string('%s/configs/ast1/sip_helper.inc' % (testdir), '<<path>>', '%s' % (workingdir))
+        file_replace_string('%s/configs/ast2/sip_helper.inc' % (testdir), '<<path>>', '%s' % (workingdir))
+
         print "Creating Asterisk instances ..."
         self.create_asterisk(2)
 
-        workingdir = "channels/SIP/sip_tls_call"
-        testdir = "tests/%s" % workingdir
+        #Now that we've created the Asterisk instances, let's go ahead and remove the sip_helper.inc files
+        if os.path.exists('%s/configs/ast1/sip_helper.inc' % (testdir)):
+            os.remove('%s/configs/ast1/sip_helper.inc' % (testdir))
+
+        if os.path.exists('%s/configs/ast2/sip_helper.inc' % (testdir)):
+            os.remove('%s/configs/ast2/sip_helper.inc' % (testdir))
 
         # initialize test variables
         self.passed = False
         self.tone1 = False
         self.tone2 = False
-
-        # Additional setup for config files and keys
-        print "Building test resources ..."
-        shutil.copy('%s/configs/helper1' % (testdir), '%s/configs/ast1/sip_helper.inc' % (testdir))
-        shutil.copy('%s/configs/helper2' % (testdir), '%s/configs/ast2/sip_helper.inc' % (testdir))
-        file_replace_string('%s/configs/ast1/sip_helper.inc' % (testdir), '<<path>>', '%s' % (workingdir))
-        file_replace_string('%s/configs/ast2/sip_helper.inc' % (testdir), '<<path>>', '%s' % (workingdir))
 
         if not os.path.exists('%s/' % workingdir):
             os.makedirs('%s' % workingdir);

Modified: asterisk/trunk/tests/channels/SIP/sip_tls_call/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_tls_call/test-config.yaml?view=diff&rev=2646&r1=2645&r2=2646
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_tls_call/test-config.yaml (original)
+++ asterisk/trunk/tests/channels/SIP/sip_tls_call/test-config.yaml Tue Oct 25 11:06:36 2011
@@ -1,5 +1,4 @@
 testinfo:
-    skip: 'Skip while failures are debugged'
     summary:     'Test a SIP TLS call'
     description: |
         'This test initiates an SIP TLS call between 2 instances of Asterisk.




More information about the asterisk-commits mailing list