[asterisk-scf-commits] asterisk-scf/integration/testsuite.git branch "review" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Jun 21 15:03:44 CDT 2011


branch "review" has been updated
       via  634c6bfa283faf5a7349ff77a3ba9b43e4db8669 (commit)
       via  cca754960036b35a64e4a41a9202d4f171e3c433 (commit)
       via  ccaa5ceefcd580a3102f7305a0279da4c7655e65 (commit)
       via  40d8c408a1060f55582378eb2b8613445642489a (commit)
       via  1c0e0c04a45b033093957708588a98e6fb726501 (commit)
      from  8dcfd0c413855a6bd5bd13b875bf76c6ad1ab2b3 (commit)

Summary of changes:
 events/shutdown.yaml                               |    2 +
 events/startup.yaml                                |    2 +
 plugins/sipp.py                                    |  118 +++++++++++++-------
 .../testcase.yaml                                  |    6 +
 .../testcase.yaml                                  |   24 ++++
 .../testcase.yaml                                  |   81 +++++++++++++
 tests/sip/Functional_Call_Busy/scenarios/call.xml  |   59 ++++++++++
 .../scenarios/wait_for_call_busy.xml               |   22 ++++
 .../testcase.yaml                                  |   69 ++++++------
 testsuite.py                                       |   50 ++++-----
 10 files changed, 331 insertions(+), 102 deletions(-)
 create mode 100644 tests/build/Build_and_Distribute_SIPp_to_TestSuite_Remotes/testcase.yaml
 create mode 100644 tests/build/Build_and_Distribute_the_Digium_TestSuite_to_Remotes/testcase.yaml
 create mode 100644 tests/sip/Functional_Call_Busy/scenarios/call.xml
 create mode 100644 tests/sip/Functional_Call_Busy/scenarios/wait_for_call_busy.xml
 copy tests/sip/{Functional_Basic_CallSetup => Functional_Call_Busy}/testcase.yaml (94%)


- Log -----------------------------------------------------------------
commit 634c6bfa283faf5a7349ff77a3ba9b43e4db8669
Author: Darren Sessions <dsessions at digium.com>
Date:   Tue Jun 21 14:27:59 2011 -0500

    Removed the signal handler code as it catches all signals. Will use a simple handler in code where required to simplify things, as the catch all handler fails when a signal is received during a system call. fixed the test timer delta calculations so they are now correct. added a simple program banner and modified the test processing output format to properly align some of the output lines.

diff --git a/testsuite.py b/testsuite.py
index ab52418..56ca86e 100755
--- a/testsuite.py
+++ b/testsuite.py
@@ -1,9 +1,9 @@
 #!/usr/bin/env python
 '''
 
- Automated Test Engine
+ Test-Suite
 
- Copyright (C) 2011, Digium, Inc.
+ Copyright (C) 2011, Digium, Inc. - www.digium.com
 
  This program is free software, distributed under the terms of
  the GNU General Public License Version 2.
@@ -33,6 +33,7 @@ import yaml_parser
 
 class __main__:
     def __init__(self, argv=None):
+        self._banner()
         if not os.path.exists('%s/tmp' % cwd):
             os.makedirs('%s/tmp' % cwd)
         if not os.path.exists('%s/tmp/artifacts' % cwd):
@@ -49,7 +50,7 @@ class __main__:
             self.globalVars['bambooBuildNum'] = argv[2]
             self.globalVars['bambooBuildURL'] = 'http://bamboo.asterisk.org/artifact/%s/build-%s/Artifacts/' % (re.sub(r'SUITE-', 'SUITE/', self.globalVars['bambooBuildKey']), self.globalVars['bambooBuildNum'])
         else:
-            print >> sys.stderr, '\nNOTE: The Bamboo build key and build number are both required to generate artifact link URLs.\n'
+            print >> sys.stderr, ' NOTE: The Bamboo build key and build number are both\n       required to generate artifact link URLs.\n'
 
         self.yamlData = yaml_parser.testcases().returnData
         self.testsuite()
@@ -69,13 +70,14 @@ class __main__:
                 if stopTests == True:
                     break
                 x, categoryElement = xml().addTestSuite(x, testCategory)
-                print >> sys.stderr, "\n Starting '%s' tests . . \n ---------------------------------" % testCategory
+                print >> sys.stderr, "\n Starting '%s' Tests . . \n --------------------------------------------------------" % testCategory
                 for testData in list[testCategory]:
                     categoryElement, testElement = xml().addTestSuite(categoryElement, testData['name'])
-                    print >> sys.stderr, ' |- Testcase "%s" ' % testData['name']
+                    print >> sys.stderr, ' |- Testcase: %s ' % testData['name']
                     if not 'options' in testData:
                         testData['options'] = {}
                     for subTestCase in testData['tests']:
+                        timerStart = datetime.datetime.now()
                         if stopTests == True:
                             break
                         for testName in subTestCase:
@@ -102,16 +104,14 @@ class __main__:
                                         success = False
 
                                 if success == False:
-                                    print >> sys.stderr, '   |- Test "' + testName + '" - FAILED!\n    \- ' + '\n'.join(errorMsgs)
+                                    print >> sys.stderr, '   |- ' + testName + ' - FAILED!\n    \- ' + '\n'.join(errorMsgs)
                                     subTestElement, errorMsgs = xml().addFailure(subTestElement, errorMsgs)
                                     break
 
                                 ''' execute testcase timeline '''
                                 for timeLine in subTestCase[testName]['timeline']:
                                     for plugin in timeLine:
-                                        timerStart = datetime.datetime.now()
                                         runResults = plugins().execute(plugin, pluginData[plugin]['module'], timeLine[plugin], testData['path'], self.globalVars)
-                                        timerDelta = datetime.datetime.now() - timerStart
                                         if not 'shutdownList' in runResults:
                                             if not 'shutdownExempt' in runResults:
                                                 if 'testsuite_remote_host' in timeLine[plugin]:
@@ -124,6 +124,9 @@ class __main__:
                                             self.globalVars['testMsg'] = runResults['msg'] = "'%s' plugin: %s" % (plugin, runResults['msg'])
                                             break
 
+                                ''' get timer delta '''
+                                timerDelta = datetime.datetime.now() - timerStart
+
                                 ''' shutdown if 'restart_persistant_plugins_between_tests' is true or not specified '''
                                 for d in shutdownList:
                                     for host in d:
@@ -146,13 +149,13 @@ class __main__:
                                             stopTests = True
                                     break
                 
-                                print >> sys.stderr, '   |- Test "' + testName + '" - PASSED! - %s.%s seconds' % (timerDelta.seconds, timerDelta.microseconds)
+                                print >> sys.stderr, '   |- ' + testName + ' - PASSED! - %s.%s seconds' % (timerDelta.seconds, timerDelta.microseconds)
                                 subTestElement = xml().setProperty(subTestElement, 'time', '%s.%s' % (timerDelta.seconds, timerDelta.microseconds))
                             else:
-                                print >> sys.stderr, '   |- Test "' + testName + '" - FAILED!\n    \- No test data defined!'
+                                print >> sys.stderr, '   |- ' + testName + ' - FAILED!\n    \- No test data defined!'
                                 subTestElement, errorMsgs = xml().addFailure(subTestElement, ['No test data defined!'])
                                 break
-
+                    
                     if stopTests == True:
                         break
 
@@ -164,6 +167,15 @@ class __main__:
         cleanup()
         return
 
+    def _banner(self):
+        print >> sys.stderr, "\n--------------------------------------------------------"
+        print >> sys.stderr, "+  Test-Suite                                          +"
+        print >> sys.stderr, "+                                                      +"
+        print >> sys.stderr, "+  http://wiki.asterisk.org/wiki/display/TOP/Testing   +"
+        print >> sys.stderr, "+                                                      +"
+        print >> sys.stderr, "+  Copyright (C) 2011, Digium, Inc. -  www.digium.com  +"
+        print >> sys.stderr, "--------------------------------------------------------\n"
+
 class plugins:
     def execute(self, name, module, testData, testPath, globalVars):
         try:
@@ -266,20 +278,4 @@ class cleanup:
         #shutil.rmtree('%s/tmp' % cwd)
         return {'success':True}
 
-def sigHandler(signum, frame):
-    if signum in [1,2,3,15]:
-        print >> sys.stderr, 'Caught signal %s, exiting.' %(str(signum))
-        cleanup()
-        sys.exit()
-    else:
-        print >> sys.stdout, 'Caught a signal %s while running and ignored it.' %(str(signum))
-
-def sigSetup():
-    uncatchable = ['SIG_DFL','SIGSTOP','SIGKILL']
-    for i in [x for x in dir(signal) if x.startswith("SIG")]:
-        if not i in uncatchable:
-            signum = getattr(signal,i)
-            signal.signal(signum, sigHandler)
-
-sigSetup()
 __main__(sys.argv)

commit cca754960036b35a64e4a41a9202d4f171e3c433
Author: Darren Sessions <dsessions at digium.com>
Date:   Tue Jun 21 14:23:51 2011 -0500

    fixed the result code parsing. added the ability to use a scenario file without having to specify injection files, set key value data, etc. This is required to use basic scenarios that do not require dynamic data.

diff --git a/plugins/sipp.py b/plugins/sipp.py
index accca5b..a376edc 100644
--- a/plugins/sipp.py
+++ b/plugins/sipp.py
@@ -46,25 +46,23 @@ class plugin(TestSuite.BaseClass):
                     if results['success'] == False:
                         return results
 
-                    print ' '.join(results['execCmd'])
-               
                     results = remote['rpc']('run', remote['hostname'], globalVars, 'sipp', mode, results['execCmd'], waitForPidToFinish)
                     if results['success'] == False:
                         return results
 
                     if mode == 'uac':
                         results['success'] = False
-                        if results['returncode'] == '0':
+                        if results['returncode'] == 0:
                             results['success'] = True 
-                        elif results['returncode'] == '1':
+                        elif results['returncode'] == 1:
                             results['msg'] = 'At least one call failed.'
-                        elif results['returncode'] == '97':
+                        elif results['returncode'] == 97:
                             results['msg'] = 'exit on internal command. calls may have been processed.'            
-                        elif results['returncode'] == '99':
+                        elif results['returncode'] == 99:
                             results['msg'] = 'Normal exit without any calls processed.'
-                        elif results['returncode'] == '-1':
+                        elif results['returncode'] == -1:
                             results['msg'] = 'Fatal error.'
-                        elif results['returncode'] == '-2':
+                        elif results['returncode'] == -2:
                             results['msg'] = 'Fatal error binding a socket.'
                         else:
                             results['msg'] = 'Unknown return code. %s' % results['returncode']
@@ -97,9 +95,6 @@ class plugin(TestSuite.BaseClass):
     def _componentConfig(self, globalVars, mode, config, testPath, remote, testsuite_remote_host):
         execCmd = ['!!TMP!!/sipp/sipp/trunk/sipp']
 
-        if ('scenario_file' in config and not 'index' in config) or (not 'scenario_file' in config and 'index' in config):
-            return {'success':False, 'msg':'Both the scenario_file and index options must be specified when using a scenario file.'}            
-
         if 'scenario_file' in config and 'index' in config:
             execCmd = self._execBuilder(execCmd, '-sf !!CWD!!/tests/%s/%s/scenarios/%s' % (globalVars['testInfo']['testCategory'], globalVars['testInfo']['testCase'], config['scenario_file']))
             execCmd = self._execBuilder(execCmd, '-inf !!TMP!!/%s.csv' % globalVars['testInfo']['testName'])
@@ -107,7 +102,9 @@ class plugin(TestSuite.BaseClass):
             execCmd = self._execBuilder(execCmd, '-set user %s' % config['scenario_file'].replace('_', '').split('.')[0])
             execCmd = self._execBuilder(execCmd, '-set file %s.csv' % globalVars['testInfo']['testName'])
             execCmd = self._execBuilder(execCmd, '-timeout_error')
-            execCmd = self._execBuilder(execCmd, '-trace_calldebug -trace_logs')
+        elif 'scenario_file' in config and not 'index' in config:
+            execCmd = self._execBuilder(execCmd, '-sf !!CWD!!/tests/%s/%s/scenarios/%s' % (globalVars['testInfo']['testCategory'], globalVars['testInfo']['testCase'], config['scenario_file']))
+            execCmd = self._execBuilder(execCmd, '-timeout_error')
         else:
             execCmd = self._execBuilder(execCmd, '-sn %s' % mode) 
 

commit ccaa5ceefcd580a3102f7305a0279da4c7655e65
Author: Darren Sessions <dsessions at digium.com>
Date:   Tue Jun 21 13:47:47 2011 -0500

    added a test case for 486 busy messages

diff --git a/tests/sip/Functional_Call_Busy/scenarios/call.xml b/tests/sip/Functional_Call_Busy/scenarios/call.xml
new file mode 100644
index 0000000..20c2824
--- /dev/null
+++ b/tests/sip/Functional_Call_Busy/scenarios/call.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Basic Sipstone UAC">
+  <send retrans="500">
+    <![CDATA[
+
+      INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
+      To: sut <sip:[service]@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: 1 INVITE
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      Content-Type: application/sdp
+      Content-Length: [len]
+
+      v=0
+      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
+      s=-
+      c=IN IP[media_ip_type] [media_ip]
+      t=0 0
+      m=audio [media_port] RTP/AVP 0
+      a=rtpmap:0 PCMU/8000
+
+    ]]>
+  </send>
+
+  <recv response="100"
+        optional="true">
+  </recv>
+
+  <recv response="486" optional="false">
+  </recv>
+
+  <send>
+    <![CDATA[
+
+      ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
+      To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
+      Call-ID: [call_id]
+      CSeq: 1 ACK
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
diff --git a/tests/sip/Functional_Call_Busy/scenarios/wait_for_call_busy.xml b/tests/sip/Functional_Call_Busy/scenarios/wait_for_call_busy.xml
new file mode 100644
index 0000000..5298395
--- /dev/null
+++ b/tests/sip/Functional_Call_Busy/scenarios/wait_for_call_busy.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<scenario name="wait for a call followed by a hangup">
+    <recv request="INVITE" crlf="true" />
+
+    <send>
+        <![CDATA[
+
+        SIP/2.0 486 Busy Here
+        [last_Via:]
+        [last_From:]
+        [last_To:];tag=[call_number]
+        [last_Call-ID:]
+        [last_CSeq:]
+        Contact: sip:service@[local_ip]:[local_port]
+        Content-Length: 0
+
+        ]]>
+    </send>
+
+    <recv request="ACK" optional="false" />
+</scenario>
diff --git a/tests/sip/Functional_Call_Busy/testcase.yaml b/tests/sip/Functional_Call_Busy/testcase.yaml
new file mode 100644
index 0000000..a0c9ed3
--- /dev/null
+++ b/tests/sip/Functional_Call_Busy/testcase.yaml
@@ -0,0 +1,356 @@
+name : Functional_Call_Busy
+tests :
+    - ipv4toipv4 :
+        expected_failure : False 
+        timeline:
+            - wireshark :
+                testsuite_remote_host : testsuite-remote-1.digium.internal
+                cmd :
+                    start:
+                        host_filter :
+                            - testsuite-remote-1.digium.internal
+                            - testsuite-remote-2.digium.internal
+                            - testsuite-remote-3.digium.internal
+                        protocol_filter :
+                            - sip
+                            - rtp
+                            - icmp
+                            - t38
+                            - dns
+            - asteriskscf_icebox :
+                testsuite_remote_host : testsuite-remote-1.digium.internal
+                cmd :
+                    start :
+                        - service_locator
+                        - bridge
+                        - routing
+                        - sip_session_gateway
+                        - media_rtp_pjmedia
+            - asteriskscf_configurator :
+                service_locator_host : testsuite-remote-1.digium.internal
+                configuration_wipe : False
+                cmd :
+                    sip :
+                        - listen_udp4 :
+                            type : transport_udp
+                            host : testsuite-remote-1.digium.internal
+                            port : 5060
+                            ipv4oripv6 : ipv4
+                        - service :
+                            type : endpoint
+                            targethost : testsuite-remote-2.digium.internal
+                            targetport : 5060
+                            sourcehost : testsuite-remote-1.digium.internal
+                            sourceport : 5060
+                            ipv4oripv6 : ipv4
+                            direction : both
+                            securetransport : none
+                            rtpoveripv6 : False
+                        - sipp :
+                            type : endpoint
+                            targethost : testsuite-remote-3.digium.internal
+                            targetport : 5060
+                            sourcehost : testsuite-remote-1.digium.internal
+                            sourceport : 5060
+                            ipv4oripv6 : ipv4
+                            direction : both
+                            securetransport : none
+                            rtpoveripv6 : False
+                    rtp :
+                         - general :
+                            startport : 10001
+                            endport : 20000
+                            workerthreadcount : 4
+            - sipp:
+                testsuite_remote_host : testsuite-remote-2.digium.internal
+                cmd :
+                    - uas :
+                        scenario_file : wait_for_call_busy.xml
+                        transport : udp
+                        ipv4oripv6 : ipv4
+                        timeout : 120
+            - sipp:
+                testsuite_remote_host : testsuite-remote-3.digium.internal
+                cmd :
+                    - uac :
+                        scenario_file : call.xml
+                        calls : 1
+                        cps : 1
+                        duration : 10
+                        targethost : testsuite-remote-1.digium.internal
+                        ipv4oripv6 : ipv4
+                        transport : udp
+                        timeout : 120
+            - wireshark :
+                run_on_test_failure : True
+                testsuite_remote_host : testsuite-remote-1.digium.internal
+                cmd :
+                    stop :
+    - ipv4toipv6 :
+        expected_failure : False 
+        timeline:
+            - wireshark :
+                testsuite_remote_host : testsuite-remote-1.digium.internal
+                cmd :
+                    start:
+                        host_filter :
+                            - testsuite-remote-1.digium.internal
+                            - testsuite-remote-2.digium.internal
+                            - testsuite-remote-3.digium.internal
+                        protocol_filter :
+                            - sip
+                            - rtp
+                            - icmp
+                            - t38
+                            - dns
+            - asteriskscf_icebox :
+                testsuite_remote_host : testsuite-remote-1.digium.internal
+                cmd :
+                    start :
+                        - service_locator
+                        - bridge
+                        - routing
+                        - sip_session_gateway
+                        - media_rtp_pjmedia
+            - asteriskscf_configurator :
+                service_locator_host : testsuite-remote-1.digium.internal
+                configuration_wipe : False
+                cmd :
+                    sip :
+                        - listen_udp4 :
+                            type : transport_udp
+                            host : testsuite-remote-1.digium.internal
+                            port : 5060
+                            ipv4oripv6 : ipv4
+                        - listen_udp6 :
+                            type : transport_udp
+                            host : testsuite-remote-1.digium.internal
+                            port : 5060
+                            ipv4oripv6 : ipv6
+                        - service :
+                            type : endpoint
+                            targethost : testsuite-remote-2.digium.internal
+                            targetport : 5060
+                            sourcehost : testsuite-remote-1.digium.internal
+                            sourceport : 5060
+                            ipv4oripv6 : ipv4
+                            direction : both
+                            securetransport : none
+                            rtpoveripv6 : False
+                        - sipp :
+                            type : endpoint
+                            targethost : testsuite-remote-3.digium.internal
+                            targetport : 5060
+                            sourcehost : testsuite-remote-1.digium.internal
+                            sourceport : 5060
+                            ipv4oripv6 : ipv6
+                            direction : both
+                            securetransport : none
+                            rtpoveripv6 : True
+                    rtp :
+                         - general :
+                            startport : 10001
+                            endport : 20000
+                            workerthreadcount : 4
+            - sipp:
+                testsuite_remote_host : testsuite-remote-2.digium.internal
+                cmd :
+                    - uas :
+                        scenario_file : wait_for_call_busy.xml
+                        transport : udp
+                        ipv4oripv6 : ipv4
+                        timeout : 120
+            - sipp:
+                testsuite_remote_host : testsuite-remote-3.digium.internal
+                cmd :
+                    - uac :
+                        scenario_file : call.xml
+                        calls : 1
+                        cps : 1
+                        duration : 10
+                        targethost : testsuite-remote-1.digium.internal
+                        ipv4oripv6 : ipv6
+                        transport : udp
+                        timeout : 120
+            - wireshark :
+                run_on_test_failure : True
+                testsuite_remote_host : testsuite-remote-1.digium.internal
+                cmd :
+                    stop :
+    - ipv6toipv4 :
+        expected_failure : False 
+        timeline:
+            - wireshark :
+                testsuite_remote_host : testsuite-remote-1.digium.internal
+                cmd :
+                    start:
+                        host_filter :
+                            - testsuite-remote-1.digium.internal
+                            - testsuite-remote-2.digium.internal
+                            - testsuite-remote-3.digium.internal
+                        protocol_filter :
+                            - sip
+                            - rtp
+                            - icmp
+                            - t38
+                            - dns
+            - asteriskscf_icebox :
+                testsuite_remote_host : testsuite-remote-1.digium.internal
+                cmd :
+                    start :
+                        - service_locator
+                        - bridge
+                        - routing
+                        - sip_session_gateway
+                        - media_rtp_pjmedia
+            - asteriskscf_configurator :
+                service_locator_host : testsuite-remote-1.digium.internal
+                configuration_wipe : False
+                cmd :
+                    sip :
+                        - listen_udp4 :
+                            type : transport_udp
+                            host : testsuite-remote-1.digium.internal
+                            port : 5060
+                            ipv4oripv6 : ipv4
+                        - listen_udp6 :
+                            type : transport_udp
+                            host : testsuite-remote-1.digium.internal
+                            port : 5060
+                            ipv4oripv6 : ipv6
+                        - service :
+                            type : endpoint
+                            targethost : testsuite-remote-2.digium.internal
+                            targetport : 5060
+                            sourcehost : testsuite-remote-1.digium.internal
+                            sourceport : 5060
+                            ipv4oripv6 : ipv6
+                            direction : both
+                            securetransport : none
+                            rtpoveripv6 : True
+                        - sipp :
+                            type : endpoint
+                            targethost : testsuite-remote-3.digium.internal
+                            targetport : 5060
+                            sourcehost : testsuite-remote-1.digium.internal
+                            sourceport : 5060
+                            ipv4oripv6 : ipv4
+                            direction : both
+                            securetransport : none
+                            rtpoveripv6 : False
+                    rtp :
+                         - general :
+                            startport : 10001
+                            endport : 20000
+                            workerthreadcount : 4
+            - sipp:
+                testsuite_remote_host : testsuite-remote-2.digium.internal
+                cmd :
+                    - uas :
+                        scenario_file : wait_for_call_busy.xml
+                        transport : udp
+                        ipv4oripv6 : ipv6
+                        timeout : 120
+            - sipp:
+                testsuite_remote_host : testsuite-remote-3.digium.internal
+                cmd :
+                    - uac :
+                        scenario_file : call.xml
+                        calls : 1
+                        cps : 1
+                        duration : 10
+                        targethost : testsuite-remote-1.digium.internal
+                        ipv4oripv6 : ipv4
+                        transport : udp
+                        timeout : 120
+            - wireshark :
+                run_on_test_failure : True
+                testsuite_remote_host : testsuite-remote-1.digium.internal
+                cmd :
+                    stop :
+    - ipv6toipv6 :
+        expected_failure : False 
+        timeline:
+            - wireshark :
+                testsuite_remote_host : testsuite-remote-1.digium.internal
+                cmd :
+                    start:
+                        host_filter :
+                            - testsuite-remote-1.digium.internal
+                            - testsuite-remote-2.digium.internal
+                            - testsuite-remote-3.digium.internal
+                        protocol_filter :
+                            - sip
+                            - rtp
+                            - icmp
+                            - t38
+                            - dns
+            - asteriskscf_icebox :
+                testsuite_remote_host : testsuite-remote-1.digium.internal
+                cmd :
+                    start :
+                        - service_locator
+                        - bridge
+                        - routing
+                        - sip_session_gateway
+                        - media_rtp_pjmedia
+            - asteriskscf_configurator :
+                service_locator_host : testsuite-remote-1.digium.internal
+                configuration_wipe : False
+                cmd :
+                    sip :
+                        - listen_udp6 :
+                            type : transport_udp
+                            host : testsuite-remote-1.digium.internal
+                            port : 5060
+                            ipv4oripv6 : ipv6
+                        - service :
+                            type : endpoint
+                            targethost : testsuite-remote-2.digium.internal
+                            targetport : 5060
+                            sourcehost : testsuite-remote-1.digium.internal
+                            sourceport : 5060
+                            ipv4oripv6 : ipv6
+                            direction : both
+                            securetransport : none
+                            rtpoveripv6 : True
+                        - sipp :
+                            type : endpoint
+                            targethost : testsuite-remote-3.digium.internal
+                            targetport : 5060
+                            sourcehost : testsuite-remote-1.digium.internal
+                            sourceport : 5060
+                            ipv4oripv6 : ipv6
+                            direction : both
+                            securetransport : none
+                            rtpoveripv6 : True
+                    rtp :
+                         - general :
+                            startport : 10001
+                            endport : 20000
+                            workerthreadcount : 4
+            - sipp:
+                testsuite_remote_host : testsuite-remote-2.digium.internal
+                cmd :
+                    - uas :
+                        scenario_file : wait_for_call_busy.xml
+                        transport : udp
+                        ipv4oripv6 : ipv6
+                        timeout : 120
+            - sipp:
+                testsuite_remote_host : testsuite-remote-3.digium.internal
+                cmd :
+                    - uac :
+                        scenario_file : call.xml
+                        calls : 1
+                        cps : 1
+                        duration : 10
+                        targethost : testsuite-remote-1.digium.internal
+                        ipv4oripv6 : ipv6
+                        transport : udp
+                        timeout : 120
+            - wireshark :
+                run_on_test_failure : True
+                testsuite_remote_host : testsuite-remote-1.digium.internal
+                cmd :
+                    stop :

commit 40d8c408a1060f55582378eb2b8613445642489a
Author: Darren Sessions <dsessions at digium.com>
Date:   Tue Jun 21 12:00:07 2011 -0500

    added injection file support into the sipp plugin in order to be able to properly support advanced call scenarios with multiple nodes.

diff --git a/plugins/sipp.py b/plugins/sipp.py
index 637645c..accca5b 100644
--- a/plugins/sipp.py
+++ b/plugins/sipp.py
@@ -11,8 +11,8 @@
 
 import TestSuite
 
-class plugin(TestSuite.RemoteBaseClass):
-    def main(self, testData, testPath, globalVars, remote):
+class plugin(TestSuite.BaseClass):
+    def main(self, testData, testPath, globalVars):
         self.hosts = {}
 
         config = {}
@@ -23,61 +23,98 @@ class plugin(TestSuite.RemoteBaseClass):
 
         for cmd in testData['cmd']:
             for mode in cmd:
-                if not 'uac' in mode and not 'uas' in mode:
+                if not 'uac' in mode and not 'uas' in mode and not 'generate_injection_file' in mode:
                     return {'success':False,'msg':'Unsupported configuration (modes).'}
                 config[mode] = cmd[mode]
-   
-        for mode in modes:
-            if mode in config:
-                if mode == 'uas':
-                    waitForPidToFinish = False
-                if mode == 'uac':
-                    waitForPidToFinish = True
-                #print ' '.join(self._componentConfig(mode, config[mode], testPath, rpc, testData['testsuite_remote_host']))
-                results = remote['rpc']('run', remote['hostname'], globalVars, 'sipp', mode, self._componentConfig(mode, config[mode], testPath, remote, testData['testsuite_remote_host']), waitForPidToFinish)
-                if results['success'] == False:
-                    return results
-                if mode == 'uac':
-                    if results['returncode'] == 1:
-                        results['msg'] = 'At least one call failed.'
-                    elif results['returncode'] == 97:
-                        results['msg'] = 'exit on internal command. calls may have been processed.'            
-                    elif results['returncode'] == 99:
-                        results['msg'] = 'Normal exit without any calls processed.'
-                    elif results['returncode'] == -1:
-                        results['msg'] = 'Fatal error.'
-                    elif results['returncode'] == -2:
-                        results['msg'] = 'Fatal error binding a socket.'
-
-                    if not results['returncode'] == 0:
+
+        if 'uac' in config or 'uas' in config:
+            if not 'testsuite_remote_host' in testData:
+                return {'success':False,'msg':'No testsuite remote host specified.'}
+
+            remote = self.RPC().connect(testData['testsuite_remote_host'])
+            if remote['success'] == False:
+                return remote
+
+            for mode in modes:
+                if mode in config:
+                    if mode == 'uas':
+                        waitForPidToFinish = False
+                    if mode == 'uac':
+                        waitForPidToFinish = True
+
+                    results = self._componentConfig(globalVars, mode, config[mode], testPath, remote, testData['testsuite_remote_host'])
+                    if results['success'] == False:
+                        return results
+
+                    print ' '.join(results['execCmd'])
+               
+                    results = remote['rpc']('run', remote['hostname'], globalVars, 'sipp', mode, results['execCmd'], waitForPidToFinish)
+                    if results['success'] == False:
+                        return results
+
+                    if mode == 'uac':
                         results['success'] = False
+                        if results['returncode'] == '0':
+                            results['success'] = True 
+                        elif results['returncode'] == '1':
+                            results['msg'] = 'At least one call failed.'
+                        elif results['returncode'] == '97':
+                            results['msg'] = 'exit on internal command. calls may have been processed.'            
+                        elif results['returncode'] == '99':
+                            results['msg'] = 'Normal exit without any calls processed.'
+                        elif results['returncode'] == '-1':
+                            results['msg'] = 'Fatal error.'
+                        elif results['returncode'] == '-2':
+                            results['msg'] = 'Fatal error binding a socket.'
+                        else:
+                            results['msg'] = 'Unknown return code. %s' % results['returncode']
+
                         return results
 
+        elif 'generate_injection_file' in config:
+            if not 'redistribute_to_hosts' in config['generate_injection_file'] or not 'matrix' in config['generate_injection_file']:
+                return {'success':False, 'msg':'Missing configuration options for injection file.'}
+
+            rpc = {}
+
+            for remoteHost in config['generate_injection_file']['redistribute_to_hosts']:
+                rpc[remoteHost] = self.RPC().connect(remoteHost)
+                if rpc[remoteHost]['success'] == False:
+                    return rpc[remoteHost]
+
+            for remoteHost in config['generate_injection_file']['redistribute_to_hosts']:
+                results = rpc[remoteHost]['rpc']('writeFile', '%s.csv' % globalVars['testInfo']['testName'], '\n'.join(config['generate_injection_file']['matrix']))
+        else:
+            return {'success':False, 'msg':'Unknown command: %s' % testData['cmd']} 
+
         return {'success':True}
 
-    def _loadScenarioFile(self, fp, fn, remote):
-        fd = self.file().read(fp + '/scenarios/' + fn)
-        return remote['rpc']('writeFile', fn, fd)
-    
     def _execBuilder(self, list, string):
         for execBlock in string.rsplit(' '):
             list.append(execBlock)
         return list
 
-    def _componentConfig(self, mode, config, testPath, remote, testsuite_remote_host):
-        execCmd = ['sipp']
+    def _componentConfig(self, globalVars, mode, config, testPath, remote, testsuite_remote_host):
+        execCmd = ['!!TMP!!/sipp/sipp/trunk/sipp']
 
-        if 'scenario_file' in config:
-            results = self._loadScenarioFile(testPath, config['scenario_file'], remote)
-            if results['success'] == False:
-               return results
-            execCmd = self._execBuilder(execCmd, '-sf !!TMP!!/%s' % config['scenario_file'])
+        if ('scenario_file' in config and not 'index' in config) or (not 'scenario_file' in config and 'index' in config):
+            return {'success':False, 'msg':'Both the scenario_file and index options must be specified when using a scenario file.'}            
+
+        if 'scenario_file' in config and 'index' in config:
+            execCmd = self._execBuilder(execCmd, '-sf !!CWD!!/tests/%s/%s/scenarios/%s' % (globalVars['testInfo']['testCategory'], globalVars['testInfo']['testCase'], config['scenario_file']))
+            execCmd = self._execBuilder(execCmd, '-inf !!TMP!!/%s.csv' % globalVars['testInfo']['testName'])
+            execCmd = self._execBuilder(execCmd, '-infindex %s.csv %s' % (globalVars['testInfo']['testName'], config['index']))
+            execCmd = self._execBuilder(execCmd, '-set user %s' % config['scenario_file'].replace('_', '').split('.')[0])
+            execCmd = self._execBuilder(execCmd, '-set file %s.csv' % globalVars['testInfo']['testName'])
+            execCmd = self._execBuilder(execCmd, '-timeout_error')
+            execCmd = self._execBuilder(execCmd, '-trace_calldebug -trace_logs')
         else:
             execCmd = self._execBuilder(execCmd, '-sn %s' % mode) 
 
         results = self.getRemoteHost(config, testsuite_remote_host)
         if results['success'] == False:
             return results
+
         execCmd = self._execBuilder(execCmd, '-i %s' % results['ip'])
 
         if 'timeout' in config:
@@ -110,15 +147,15 @@ class plugin(TestSuite.RemoteBaseClass):
                     return results
                 execCmd = self._execBuilder(execCmd, '%s' % results['ip'])
     
-        return execCmd
+        return {'success':True, 'execCmd':execCmd}
 
     def getRemoteHost(self, config, host):
         try:
             config['ipv4oripv6']
         except:
-            return {'success':False,'msg':"The required option, 'ipv4oripv6', must be specified."}
+            return {'success':False, 'msg':"The required option, 'ipv4oripv6', must be specified."}
         if not config['ipv4oripv6'] == 'ipv4' and not config['ipv4oripv6'] == 'ipv6':
-            return {'success':False,'msg':"The required option 'ipv4oripv6', must be either 'ipv4' or 'ipv6'."}
+            return {'success':False, 'msg':"The required option 'ipv4oripv6', must be either 'ipv4' or 'ipv6'."}
         try:
             self.hosts[host][config['ipv4oripv6']]
         except:

commit 1c0e0c04a45b033093957708588a98e6fb726501
Author: Darren Sessions <dsessions at digium.com>
Date:   Mon Jun 20 10:25:16 2011 -0500

    updated the startup/shutdown events to include the testsuite-remote-6 host. updated the build tests cases to include the new host as well and commited two other build cases for SIPp and the test-suite itself.

diff --git a/events/shutdown.yaml b/events/shutdown.yaml
index 403477c..40d109a 100644
--- a/events/shutdown.yaml
+++ b/events/shutdown.yaml
@@ -11,4 +11,6 @@ tests :
                         - testsuite-remote-2.digium.internal
                         - testsuite-remote-3.digium.internal
                         - testsuite-remote-4.digium.internal
+                        - testsuite-remote-5.digium.internal
+                        - testsuite-remote-6.digium.internal
                         - testsuite-builder-1.digium.internal
diff --git a/events/startup.yaml b/events/startup.yaml
index 11a7002..3266a46 100644
--- a/events/startup.yaml
+++ b/events/startup.yaml
@@ -11,4 +11,6 @@ tests :
                         - testsuite-remote-2.digium.internal
                         - testsuite-remote-3.digium.internal
                         - testsuite-remote-4.digium.internal
+                        - testsuite-remote-5.digium.internal
+                        - testsuite-remote-6.digium.internal
                         - testsuite-builder-1.digium.internal
diff --git a/tests/build/Build_and_Distribute_Asterisk_SCF_to_TestSuite_Remotes/testcase.yaml b/tests/build/Build_and_Distribute_Asterisk_SCF_to_TestSuite_Remotes/testcase.yaml
index b8b8347..e24adb0 100644
--- a/tests/build/Build_and_Distribute_Asterisk_SCF_to_TestSuite_Remotes/testcase.yaml
+++ b/tests/build/Build_and_Distribute_Asterisk_SCF_to_TestSuite_Remotes/testcase.yaml
@@ -42,6 +42,9 @@ tests :
                             - testsuite-remote-1.digium.internal
                             - testsuite-remote-2.digium.internal
                             - testsuite-remote-3.digium.internal
+                            - testsuite-remote-4.digium.internal
+                            - testsuite-remote-5.digium.internal
+                            - testsuite-remote-6.digium.internal
                         send_dir : '/opt/Ice-3.4.1'
                         install_dir : /
     - asterisk_scf :
@@ -62,5 +65,8 @@ tests :
                             - testsuite-remote-1.digium.internal
                             - testsuite-remote-2.digium.internal
                             - testsuite-remote-3.digium.internal
+                            - testsuite-remote-4.digium.internal
+                            - testsuite-remote-5.digium.internal
+                            - testsuite-remote-6.digium.internal
                         send_dir : 'gitall'
                         install_dir : '!!TMP!!'
diff --git a/tests/build/Build_and_Distribute_SIPp_to_TestSuite_Remotes/testcase.yaml b/tests/build/Build_and_Distribute_SIPp_to_TestSuite_Remotes/testcase.yaml
new file mode 100644
index 0000000..8026ecc
--- /dev/null
+++ b/tests/build/Build_and_Distribute_SIPp_to_TestSuite_Remotes/testcase.yaml
@@ -0,0 +1,24 @@
+name : Build_and_Distribute_SIPp_to_Remotes
+options :
+    stop_tests_on_failure : True
+tests :
+    - SIPp :
+        timeline :
+            - build :
+                testsuite_remote_host : testsuite-builder-1.digium.internal
+                cmd :
+                    pull_update : True
+                    repo : 'https://sipp.svn.sourceforge.net/svnroot/sipp'
+                    cd : sipp/sipp/trunk
+                    make_cmd : 
+                        - make
+                    redistribute :
+                        remotes :
+                            - testsuite-remote-1.digium.internal
+                            - testsuite-remote-2.digium.internal
+                            - testsuite-remote-3.digium.internal
+                            - testsuite-remote-4.digium.internal
+                            - testsuite-remote-5.digium.internal
+                            - testsuite-remote-6.digium.internal
+                        send_dir : sipp/sipp
+                        install_dir : '!!TMP!!'
diff --git a/tests/build/Build_and_Distribute_the_Digium_TestSuite_to_Remotes/testcase.yaml b/tests/build/Build_and_Distribute_the_Digium_TestSuite_to_Remotes/testcase.yaml
new file mode 100644
index 0000000..3ef4f43
--- /dev/null
+++ b/tests/build/Build_and_Distribute_the_Digium_TestSuite_to_Remotes/testcase.yaml
@@ -0,0 +1,81 @@
+name : Build_and_Distribute_the_Digium_TestSuite_to_Remotes
+options :
+    stop_tests_on_failure : True
+tests :
+    - update_testsuite-remote-1 :
+        timeline :
+            - build :
+                testsuite_remote_host : testsuite-remote-1.digium.internal
+                cmd :
+                    pull_update : True
+                    repo : 'git://git.asterisk.org/asterisk-scf/integration/testsuite'
+                    cd : testsuite
+                    make_cmd : 
+                        - git checkout review
+                        - make install
+    - update_testsuite-remote-2 :
+        timeline :
+            - build :
+                testsuite_remote_host : testsuite-remote-2.digium.internal
+                cmd :
+                    pull_update : True
+                    repo : 'git://git.asterisk.org/asterisk-scf/integration/testsuite'
+                    cd : testsuite
+                    make_cmd : 
+                        - git checkout review
+                        - make install
+    - update_testsuite-remote-3 :
+        timeline :
+            - build :
+                testsuite_remote_host : testsuite-remote-3.digium.internal
+                cmd :
+                    pull_update : True
+                    repo : 'git://git.asterisk.org/asterisk-scf/integration/testsuite'
+                    cd : testsuite
+                    make_cmd : 
+                        - git checkout review
+                        - make install
+    - update_testsuite-remote-4 :
+        timeline :
+            - build :
+                testsuite_remote_host : testsuite-remote-4.digium.internal
+                cmd :
+                    pull_update : True
+                    repo : 'git://git.asterisk.org/asterisk-scf/integration/testsuite'
+                    cd : testsuite
+                    make_cmd : 
+                        - git checkout review
+                        - make install
+    - update_testsuite-remote-5 :
+        timeline :
+            - build :
+                testsuite_remote_host : testsuite-remote-4.digium.internal
+                cmd :
+                    pull_update : True
+                    repo : 'git://git.asterisk.org/asterisk-scf/integration/testsuite'
+                    cd : testsuite
+                    make_cmd :
+                        - git checkout review
+                        - make install
+    - update_testsuite-remote-6 :
+        timeline :
+            - build :
+                testsuite_remote_host : testsuite-remote-4.digium.internal
+                cmd :
+                    pull_update : True
+                    repo : 'git://git.asterisk.org/asterisk-scf/integration/testsuite'
+                    cd : testsuite
+                    make_cmd :
+                        - git checkout review
+                        - make install
+    - update_testsuite-builder-1 :
+        timeline :
+            - build :
+                testsuite_remote_host : testsuite-builder-1.digium.internal
+                cmd :
+                    pull_update : True
+                    repo : 'git://git.asterisk.org/asterisk-scf/integration/testsuite'
+                    cd : testsuite
+                    make_cmd :
+                        - git checkout review
+                        - make install

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/testsuite.git



More information about the asterisk-scf-commits mailing list