[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
Fri Jun 10 17:15:48 CDT 2011


branch "review" has been updated
       via  8ae434a21f9c27008c05eef4dc8f44b3ef5792e6 (commit)
       via  6717ffc6805f596f348db8d277e82a6c541ed119 (commit)
       via  7675a3911783c92f901b6726ae837dd4352ccc76 (commit)
      from  4e27683acc7c0bb38b0dcf5e4d3d7f2ae9ae69bd (commit)

Summary of changes:
 plugins/protos.py                                  |  189 ++++++++++++++++++++
 plugins/wireshark.py                               |    2 -
 remote.py                                          |   28 +++
 .../testcase.yaml                                  |  127 +++++++++++++
 4 files changed, 344 insertions(+), 2 deletions(-)
 create mode 100644 plugins/protos.py
 create mode 100644 tests/sip/Stress_PROTOS_TestSuite_c07_sip_r2/testcase.yaml


- Log -----------------------------------------------------------------
commit 8ae434a21f9c27008c05eef4dc8f44b3ef5792e6
Author: Darren Sessions <dsessions at digium.com>
Date:   Fri Jun 10 17:15:32 2011 -0500

    adding support for the PROTOS sip test-suite. this test-suite has 4527 tests related to hostile / malformed invites.

diff --git a/plugins/protos.py b/plugins/protos.py
new file mode 100644
index 0000000..ae06fd6
--- /dev/null
+++ b/plugins/protos.py
@@ -0,0 +1,189 @@
+'''
+
+ PROTOS Test-Suite Plugin
+
+ Copyright (C) 2011, Digium, Inc.
+
+ This program is free software, distributed under the terms of
+ the GNU General Public License Version 2.
+
+'''
+
+import time
+import TestSuite
+
+class plugin(TestSuite.RemoteBaseClass):
+    def main(self, testData, testPath, globalVars, remote):
+        if not 'cmd' in testData:
+            return {'success':False,'msg':'No command specified.'}
+
+        if not 'targethost' in testData and not 'ipv4oripv6' in testData:
+            return {'success':False,'msg':'The target host and ipv4oripv6 options must be specified.'}
+
+        if globalVars['testInfo']['testName'] == 'SIP_Method':
+            start = 1
+            stop = 193
+        elif globalVars['testInfo']['testName'] == 'SIP_Request_URI':
+            start = 194
+            stop = 254
+        elif globalVars['testInfo']['testName'] == 'SIP_Version':
+            start = 255
+            stop = 329
+        elif globalVars['testInfo']['testName'] == 'SIP_Via_Host':
+            start = 330
+            stop = 435
+        elif globalVars['testInfo']['testName'] == 'SIP_Via_Host_Colon':
+            start = 436
+            stop = 451
+        elif globalVars['testInfo']['testName'] == 'SIP_Via_Host_Port':
+            start = 452
+            stop = 497
+        elif globalVars['testInfo']['testName'] == 'SIP_Via_Version':
+            start = 498
+            stop = 572
+        elif globalVars['testInfo']['testName'] == 'SIP_Via_Tag':
+            start = 573
+            stop = 629
+        elif globalVars['testInfo']['testName'] == 'SIP_From_Display_Name':
+            start = 630
+            stop = 822
+        elif globalVars['testInfo']['testName'] == 'SIP_From_Tag':
+            start = 823
+            stop = 879
+        elif globalVars['testInfo']['testName'] == 'SIP_From_Colon':
+            start = 880
+            stop = 895
+        elif globalVars['testInfo']['testName'] == 'SIP_From_URI':
+            start = 896
+            stop = 956
+        elif globalVars['testInfo']['testName'] == 'SIP_Contact_Display_Name':
+            start = 957
+            stop = 1149
+        elif globalVars['testInfo']['testName'] == 'SIP_Contact_URI':
+            start = 1150
+            stop = 1210
+        elif globalVars['testInfo']['testName'] == 'SIP_Contact_Left_Paranthesis':
+            start = 1211
+            stop = 1226
+        elif globalVars['testInfo']['testName'] == 'SIP_Contact_Right_paranthesis':
+            start = 1227
+            stop = 1242
+        elif globalVars['testInfo']['testName'] == 'SIP_To':
+            start = 1243
+            stop = 1435
+        elif globalVars['testInfo']['testName'] == 'SIP_To_Left_Paranthesis':
+            start = 1436
+            stop = 1451
+        elif globalVars['testInfo']['testName'] == 'SIP_To_Right_Paranthesis':
+            start = 1452
+            stop = 1467
+        elif globalVars['testInfo']['testName'] == 'SIP_Call_Id_Value':
+            start = 1468
+            stop = 1660
+        elif globalVars['testInfo']['testName'] == 'SIP_Call_Id_At':
+            start = 1661
+            stop = 1676
+        elif globalVars['testInfo']['testName'] == 'SIP_Call_Id_Ip':
+            start = 1677
+            stop = 1782
+        elif globalVars['testInfo']['testName'] == 'SIP_Expires':
+            start = 1783
+            stop = 1828
+        elif globalVars['testInfo']['testName'] == 'SIP_Max_Forwards':
+            start = 1829
+            stop = 1874
+        elif globalVars['testInfo']['testName'] == 'SIP_Cseq_Integer':
+            start = 1875
+            stop = 1920
+        elif globalVars['testInfo']['testName'] == 'SIP_Cseq_String':
+            start = 1921
+            stop = 2113
+        elif globalVars['testInfo']['testName'] == 'SIP_Content_Type':
+            start = 2114
+            stop = 2360
+        elif globalVars['testInfo']['testName'] == 'SIP_Content_Length':
+            start = 2361
+            stop = 2406
+        elif globalVars['testInfo']['testName'] == 'SIP_Request_CRLF':
+            start = 2407
+            stop = 2416
+        elif globalVars['testInfo']['testName'] == 'CRLF_Request':
+            start = 2417
+            stop = 2426
+        elif globalVars['testInfo']['testName'] == 'SDP_Attribute_CRLF':
+            start = 2427
+            stop = 2436
+        elif globalVars['testInfo']['testName'] == 'SDP_Proto_v_Identifier':
+            start = 2437
+            stop = 2629
+        elif globalVars['testInfo']['testName'] == 'SDP_Proto_v_Equal':
+            start = 2630
+            stop = 2645
+        elif globalVars['testInfo']['testName'] == 'SDP_Proto_v_Integer':
+            start = 2646
+            stop = 2691
+        elif globalVars['testInfo']['testName'] == 'SDP_Origin_Username':
+            start = 2692
+            stop = 2884
+        elif globalVars['testInfo']['testName'] == 'SDP_Origin_Session_Id':
+            start = 2885
+            stop = 2930
+        elif globalVars['testInfo']['testName'] == 'SDP_Origin_Network_Type':
+            start = 2931
+            stop = 3123
+        elif globalVars['testInfo']['testName'] == 'SDP_Origin_Ip':
+            start = 3124
+            stop = 3229
+        elif globalVars['testInfo']['testName'] == 'SDP_Session':
+            start = 3230
+            stop = 3422
+        elif globalVars['testInfo']['testName'] == 'SDP_Connection_Network_Type':
+            start = 3423
+            stop = 3610
+        elif globalVars['testInfo']['testName'] == 'SDP_Connection_Ip':
+            start = 3611
+            stop = 3716
+        elif globalVars['testInfo']['testName'] == 'SDP_Time_Start':
+            start = 3717
+            stop = 3762
+        elif globalVars['testInfo']['testName'] == 'SDP_Time_Stop':
+            start = 3763
+            stop = 3763
+        elif globalVars['testInfo']['testName'] == 'SDP_Media_Media':
+            start = 3764
+            stop = 3956
+        elif globalVars['testInfo']['testName'] == 'SDP_Media_Port':
+            start = 3957
+            stop = 4002
+        elif globalVars['testInfo']['testName'] == 'SDP_Media_Transport':
+            start = 4003
+            stop = 4120
+        elif globalVars['testInfo']['testName'] == 'SDP_Media_Type':
+            start = 4121
+            stop = 4166
+        elif globalVars['testInfo']['testName'] == 'SDP_Attribute_Rtpmap':
+            start = 4167
+            stop = 4284
+        elif globalVars['testInfo']['testName'] == 'SDP_Attribute_Colon':
+            start = 4285
+            stop = 4300
+        elif globalVars['testInfo']['testName'] == 'SDP_Attribute_Payload_Type':
+            start = 4301
+            stop = 4346
+        elif globalVars['testInfo']['testName'] == 'SDP_Attribute_Encoding_Name':
+            start = 4347
+            stop = 4464
+        elif globalVars['testInfo']['testName'] == 'SDP_Attribute_Slash':
+            start = 4465
+            stop = 4480
+        elif globalVars['testInfo']['testName'] == 'SDP_Attribute_Clock_Rate':
+            start = 4481
+            stop = 4527
+        else:
+            return {'success':False, 'msg':'Subtest name does not correspond to a PROTOS test group.'}
+
+        #/usr/bin/java -jar downloads/c07-sip-r2.jar -fromuri sipp at 10.24.25178 -touri service at 10.19.139.77 -validcase -single 1
+
+        time.sleep(200)
+   
+        return {'success':True}
diff --git a/tests/sip/Stress_PROTOS_TestSuite_c07_sip_r2/testcase.yaml b/tests/sip/Stress_PROTOS_TestSuite_c07_sip_r2/testcase.yaml
new file mode 100644
index 0000000..f744d45
--- /dev/null
+++ b/tests/sip/Stress_PROTOS_TestSuite_c07_sip_r2/testcase.yaml
@@ -0,0 +1,127 @@
+name : Stress_PROTOS_TestSuite_c07_sip_r2
+options : 
+    restart_persistant_plugins_between_tests: False
+tests :
+    - SIP_Method :
+        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
+            - protos :
+                testsuite_remote_host : testsuite-remote-2.digium.internal
+                cmd :
+                    targethost : testsuite-remote-1.digium.internal
+                    ipv4oripv6 : ipv4
+            - wireshark :
+                run_on_test_failure : True
+                testsuite_remote_host : testsuite-remote-1.digium.internal
+                cmd :
+                    stop :
+    - SIP_Request_URI :
+    - SIP_Version :
+    - SIP_Via_Host :
+    - SIP_Via_Host_Colon :
+    - SIP_Via_Host_Port :
+    - SIP_Via_Version :
+    - SIP_Via_Tag :
+    - SIP_From_Display_Name :
+    - SIP_From_Tag :
+    - SIP_From_Colon :
+    - SIP_From_URI :
+    - SIP_Contact_Display_Name :
+    - SIP_Contact_URI :
+    - SIP_Contact_Left_Paranthesis :
+    - SIP_Contact_Right_paranthesis :
+    - SIP_To :
+    - SIP_To_Left_Paranthesis :
+    - SIP_To_Right_Paranthesis :
+    - SIP_Call_Id_Value :
+    - SIP_Call_Id_At :
+    - SIP_Call_Id_Ip :
+    - SIP_Expires :
+    - SIP_Max_Forwards :
+    - SIP_Cseq_Integer :
+    - SIP_Cseq_String :
+    - SIP_Content_Type :
+    - SIP_Content_Length :
+    - SIP_Request_CRLF :
+    - CRLF_Request :
+    - SDP_Attribute_CRLF :
+    - SDP_Proto_v_Identifier :
+    - SDP_Proto_v_Equal :
+    - SDP_Proto_v_Integer :
+    - SDP_Origin_Username :
+    - SDP_Origin_Session_Id :
+    - SDP_Origin_Network_Type :
+    - SDP_Origin_Ip :
+    - SDP_Session :
+    - SDP_Connection_Network_Type :
+    - SDP_Connection_Ip :
+    - SDP_Time_Start :
+    - SDP_Time_Stop :
+    - SDP_Media_Media :
+    - SDP_Media_Port :
+    - SDP_Media_Transport :
+    - SDP_Media_Type :
+    - SDP_Attribute_Rtpmap :
+    - SDP_Attribute_Colon :
+    - SDP_Attribute_Payload_Type :
+    - SDP_Attribute_Encoding_Name :
+    - SDP_Attribute_Slash :
+    - SDP_Attribute_Clock_Rate :

commit 6717ffc6805f596f348db8d277e82a6c541ed119
Author: Darren Sessions <dsessions at digium.com>
Date:   Fri Jun 10 17:13:06 2011 -0500

    removed a debug message that accidentally got committed.

diff --git a/plugins/wireshark.py b/plugins/wireshark.py
index 89c0c5c..23eca56 100644
--- a/plugins/wireshark.py
+++ b/plugins/wireshark.py
@@ -61,8 +61,6 @@ class plugin(TestSuite.RemoteBaseClass):
                     '-w',
                     '/tmp/capture.pcap']
 
-                print ' '.join(runCmd)
-
                 results = remote['rpc']('run', remote['hostname'], globalVars, 'wireshark', 'start', runCmd)
                 if results['success'] == False:
                     return results

commit 7675a3911783c92f901b6726ae837dd4352ccc76
Author: Darren Sessions <dsessions at digium.com>
Date:   Fri Jun 10 17:12:32 2011 -0500

    added support interactive system calls via the pexpect module in order to utilize applications such as the PROTOS sip test-suite.

diff --git a/remote.py b/remote.py
index 0851ec7..e1b5672 100755
--- a/remote.py
+++ b/remote.py
@@ -13,9 +13,11 @@
 '''
 
 import os
+import re
 import sys
 import time
 import shutil
+import pexpect
 import platform
 import xmlrpclib
 import subprocess
@@ -41,6 +43,32 @@ class RemoteManagement(object):
             return {'success':True,'msg':list} 
         return {'success':True,'msg':'Nothing running.'}
 
+    def pExpect(self, execCmd, expect, send, timeout=None, terminate=True):
+        if not type(expect) == list and not type(send) == list:
+            return {'success':False,'msg':'[pExpect] The expect and send arguments must be lists.'}
+
+        try:
+            p = pexpect.spawn(execCmd)
+        except:
+            return {'success':False,'msg':'[pExpect] Unable to execute %s' % execCmd}
+
+        for n in range(0, len(expect)):        
+            if timeout:
+                p.expect(expect[n], timeout)
+            else:
+                p.expect(expect[n])
+
+            if re.match('ctrl+', send[n]):
+                send[n] = send[n].replace('ctrl+', '')
+                p.sendcontrol(send[n])
+            else:
+                p.sendline(send[n])
+
+        if terminate == True:
+            p.terminate(force=True)
+        
+        return {'success':True}
+
     def run(self, hostName, globalVars, plugin, label, execCmd, wait=False):
         if plugin in processList:
             if label in processList[plugin]:

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


-- 
asterisk-scf/integration/testsuite.git



More information about the asterisk-scf-commits mailing list