[asterisk-commits] kmoore: testsuite/asterisk/trunk r3478 - /asterisk/trunk/lib/python/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 21 15:35:52 CDT 2012


Author: kmoore
Date: Fri Sep 21 15:35:48 2012
New Revision: 3478

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3478
Log:
Add capability for IPv6 targets and enable usage of SIPp 3PCC

SIPp's 3rd Party Call Control (3PCC) Extended Mode requires usage of an
additional configuration file for master/slave communication. This
allows that file to be specified under the sipp test directory similar
to scenario files.

This change also adds the ability to target addressed other than
127.0.0.1 such as [::1] or 127.0.0.2 for more complex test
scenarios.

Modified:
    asterisk/trunk/lib/python/asterisk/sipp.py

Modified: asterisk/trunk/lib/python/asterisk/sipp.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/sipp.py?view=diff&rev=3478&r1=3477&r2=3478
==============================================================================
--- asterisk/trunk/lib/python/asterisk/sipp.py (original)
+++ asterisk/trunk/lib/python/asterisk/sipp.py Fri Sep 21 15:35:48 2012
@@ -173,7 +173,8 @@
             # each set of scenarios in the YAML config
             self.scenarios.append([SIPpScenario(self.test_name,
                                            scenario['key-args'],
-                                           [] if 'ordered-args' not in scenario else scenario['ordered-args'])
+                                           [] if 'ordered-args' not in scenario else scenario['ordered-args'],
+                                           target = ('127.0.0.1' if 'target' not in scenario else scenario['target']))
                                            for scenario in scenario_set])
 
         final_deferred = defer.Deferred()
@@ -396,7 +397,7 @@
     when a SIPp scenario must be integrated with a more complex test (using the TestCase
     class, for example)
     """
-    def __init__(self, test_dir, scenario, positional_args=()):
+    def __init__(self, test_dir, scenario, positional_args=(), target = '127.0.0.1'):
         """
         Arguments:
 
@@ -422,6 +423,8 @@
         The canonical example being -key:
             ('-key', 'extra_via_param', ';rport',
              '-key', 'user_addr', 'sip:myname at myhost')
+        target - overrides the default target address (127.0.0.1) of the SIPp scenario
+                 Be sure to specify IPv6 addresses in brackets ([::1])
         """
         self.scenario = scenario
         self.name = scenario['scenario']
@@ -432,6 +435,7 @@
         self.passed = False
         self.exited = False
         self._process = None
+        self.target = target
 
     def kill(self):
         """ Kill the executing SIPp scenario """
@@ -474,11 +478,12 @@
             return result
 
         sipp_args = [
-                self.sipp, '127.0.0.1',
+                self.sipp, self.target,
                 '-sf', '%s/sipp/%s' % (self.test_dir, self.scenario['scenario']),
                 '-nostdin',
                 '-skip_rlimit',
         ]
+
         default_args = {
             '-p' : str(self.default_port),
             '-m' : '1',
@@ -489,6 +494,10 @@
         # Override and extend defaults
         default_args.update(self.scenario)
         del default_args['scenario']
+
+        # correct the path specified by -slave_cfg
+        if '-slave_cfg' in default_args:
+            default_args['-slave_cfg'] = '%s/sipp/%s' % (self.test_dir, default_args['-slave_cfg'])
 
         for (key, val) in default_args.items():
             sipp_args.extend([ key, val ])




More information about the asterisk-commits mailing list