[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
Wed Jun 8 16:59:38 CDT 2011


branch "review" has been updated
       via  fa256937d128848668694ad7a2fa50428e1f3108 (commit)
       via  4a4434c06bacae89cc659aca3387553c89c189aa (commit)
       via  00d63aeaab298ff698453ecf3e94d972b2cf68eb (commit)
       via  8fc84ca5583c3cb7733f7005ff25ccec36482d2e (commit)
      from  0fcee61a1efeac16e4d7f719cbb02ee5f6dfb1ad (commit)

Summary of changes:
 lib/python/TestSuite.py                            |    2 +-
 plugins/testsuite_remotes.py                       |    2 +-
 plugins/wireshark.py                               |   52 +++++++++++++++++++
 remote.py                                          |    7 ++-
 tests/sip/Functional_Basic_CallSetup/testcase.yaml |   53 +++++++++++++-------
 5 files changed, 92 insertions(+), 24 deletions(-)
 create mode 100644 plugins/wireshark.py


- Log -----------------------------------------------------------------
commit fa256937d128848668694ad7a2fa50428e1f3108
Author: Darren Sessions <dsessions at digium.com>
Date:   Wed Jun 8 16:59:30 2011 -0500

    fixed a minor issue with the testsuite remote plugin where it would completely dump if a file it was wanting to delete as part of the cleanup process did not exist.

diff --git a/plugins/testsuite_remotes.py b/plugins/testsuite_remotes.py
index 3f0662f..3eaa000 100644
--- a/plugins/testsuite_remotes.py
+++ b/plugins/testsuite_remotes.py
@@ -49,7 +49,7 @@ class plugin(TestSuite.BaseClass):
                 for remote in testData['cmd']['cleanup']:
                     results = rpc[remote]['rpc']('removeFile', 'tmp.tar.gz')
                     if results['success'] == False:
-                        return results
+                        pass
 
                     results = rpc[remote]['rpc']('archiveDir', globalVars, 'artifacts')
                     if results['success'] == False:

commit 4a4434c06bacae89cc659aca3387553c89c189aa
Author: Darren Sessions <dsessions at digium.com>
Date:   Wed Jun 8 16:58:42 2011 -0500

    started in on the wireshark plugin and options in the test yaml files.

diff --git a/plugins/wireshark.py b/plugins/wireshark.py
new file mode 100644
index 0000000..7409b38
--- /dev/null
+++ b/plugins/wireshark.py
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+'''
+
+ Wireshark Plugin
+
+ Copyright (C) 2011, Digium, Inc.
+
+ This program is free software, distributed under the terms of
+ the GNU General Public License Version 2.
+
+'''
+
+import TestSuite
+
+class plugin(TestSuite.RemoteBaseClass):
+    def main(self, testData, testPath, globalVars, remote):
+        rpc = {}
+        hostFilter = []
+        ''' start and stop individual components. shutdown is implemented in the main testsuite code ''' 
+        for cmd in testData['cmd']:
+            if cmd == 'start': 
+                if 'host_filter' in testData['cmd'][cmd]:
+                    ''' Quick check to make sure we can connect to the remotes before we do anything else. '''
+                    for remoteHost in testData['cmd'][cmd]['host_filter']:
+                        rpc[remoteHost] = self.RPC().connect(remoteHost)
+                        if rpc[remoteHost]['success'] == False:
+                            return rpc[remoteHost]
+                        ipv6 = rpc[remoteHost]['ipv6']
+                        ipv6 = ipv6.replace('[', '')
+                        ipv6 = ipv6.replace(']', '')
+                        hostFilter.append('ip.addr == %s or ipv6.addr == %s' % (rpc[remoteHost]['ipv4'], ipv6))
+                    hostFilters = ' or '.join(hostFilter)
+                else:
+                    return {'success':False,'msg':'The host_filter option is required.'}
+
+                if 'protocol_filter' in testData['cmd'][cmd]:
+                    protocolFilters = ' or '.join(testData['cmd'][cmd]['protocol_filter'])
+                else:
+                    return {'success':False,'msg':'The protocol_filter command is required.'}
+
+                runCmd = [
+                    'tshark',
+                    '-w',
+                    '!!TMP!!/artifacts/%s/%s.capture.pcap' % (globalVars['testInfo']['testPath'], remote['hostname']),
+                    '-R', 
+                    "'(%s) and (%s)'" % (protocolFilters, hostFilters)]
+
+                results = remote['rpc']('run', globalVars, 'wireshark', 'start', runCmd)
+                if results['success'] == False:
+                    return results
+
+        return {'success':True}   
diff --git a/tests/sip/Functional_Basic_CallSetup/testcase.yaml b/tests/sip/Functional_Basic_CallSetup/testcase.yaml
index f604df6..80140ad 100644
--- a/tests/sip/Functional_Basic_CallSetup/testcase.yaml
+++ b/tests/sip/Functional_Basic_CallSetup/testcase.yaml
@@ -4,15 +4,29 @@ options :
     call_flow_diagrams: True
     restart_persistant_plugins_between_tests: True
 tests :
-    - ipv6toipv6 :
+    - 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
+                            - rtcp
+                            - icmp
+                            - t38
+                            - dns
             - asteriskscf_icebox :
                 testsuite_remote_host : testsuite-remote-1.digium.internal
                 cmd :
                     start :
                         - service_locator
-                        - logger_server
                         - bridge
                         - routing
                         - sip_session_gateway
@@ -22,31 +36,31 @@ tests :
                 configuration_wipe : False
                 cmd :
                     sip :
-                        - listen_udp6 :
+                        - listen_udp4 :
                             type : transport_udp
                             host : testsuite-remote-1.digium.internal
                             port : 5060
-                            ipv4oripv6 : ipv6
+                            ipv4oripv6 : ipv4
                         - service :
                             type : endpoint
                             targethost : testsuite-remote-2.digium.internal
                             targetport : 5060
                             sourcehost : testsuite-remote-1.digium.internal
                             sourceport : 5060
-                            ipv4oripv6 : ipv6
+                            ipv4oripv6 : ipv4
                             direction : both
                             securetransport : none
-                            rtpoveripv6 : True
+                            rtpoveripv6 : False
                         - sipp :
                             type : endpoint
                             targethost : testsuite-remote-3.digium.internal
                             targetport : 5060
                             sourcehost : testsuite-remote-1.digium.internal
                             sourceport : 5060
-                            ipv4oripv6 : ipv6
+                            ipv4oripv6 : ipv4
                             direction : both
                             securetransport : none
-                            rtpoveripv6 : True
+                            rtpoveripv6 : False
                     rtp :
                          - general :
                             startport : 10001
@@ -57,7 +71,7 @@ tests :
                 cmd :
                     - uas :
                         transport : udp
-                        ipv4oripv6 : ipv6
+                        ipv4oripv6 : ipv4
                         timeout : 10
             - sipp:
                 testsuite_remote_host : testsuite-remote-3.digium.internal
@@ -67,10 +81,10 @@ tests :
                         cps : 1
                         duration : 10
                         targethost : testsuite-remote-1.digium.internal
-                        ipv4oripv6 : ipv6
+                        ipv4oripv6 : ipv4
                         transport : udp
                         timeout : 10
-    - ipv4toipv4 :
+    - ipv6toipv6 :
         expected_failure : False 
         timeline:
             - asteriskscf_icebox :
@@ -78,6 +92,7 @@ tests :
                 cmd :
                     start :
                         - service_locator
+                        - logger_server
                         - bridge
                         - routing
                         - sip_session_gateway
@@ -87,31 +102,31 @@ tests :
                 configuration_wipe : False
                 cmd :
                     sip :
-                        - listen_udp4 :
+                        - listen_udp6 :
                             type : transport_udp
                             host : testsuite-remote-1.digium.internal
                             port : 5060
-                            ipv4oripv6 : ipv4
+                            ipv4oripv6 : ipv6
                         - service :
                             type : endpoint
                             targethost : testsuite-remote-2.digium.internal
                             targetport : 5060
                             sourcehost : testsuite-remote-1.digium.internal
                             sourceport : 5060
-                            ipv4oripv6 : ipv4
+                            ipv4oripv6 : ipv6
                             direction : both
                             securetransport : none
-                            rtpoveripv6 : False
+                            rtpoveripv6 : True
                         - sipp :
                             type : endpoint
                             targethost : testsuite-remote-3.digium.internal
                             targetport : 5060
                             sourcehost : testsuite-remote-1.digium.internal
                             sourceport : 5060
-                            ipv4oripv6 : ipv4
+                            ipv4oripv6 : ipv6
                             direction : both
                             securetransport : none
-                            rtpoveripv6 : False
+                            rtpoveripv6 : True
                     rtp :
                          - general :
                             startport : 10001
@@ -122,7 +137,7 @@ tests :
                 cmd :
                     - uas :
                         transport : udp
-                        ipv4oripv6 : ipv4
+                        ipv4oripv6 : ipv6
                         timeout : 10
             - sipp:
                 testsuite_remote_host : testsuite-remote-3.digium.internal
@@ -132,7 +147,7 @@ tests :
                         cps : 1
                         duration : 10
                         targethost : testsuite-remote-1.digium.internal
-                        ipv4oripv6 : ipv4
+                        ipv4oripv6 : ipv6
                         transport : udp
                         timeout : 10
     - ipv6toipv4 :

commit 00d63aeaab298ff698453ecf3e94d972b2cf68eb
Author: Darren Sessions <dsessions at digium.com>
Date:   Wed Jun 8 16:57:28 2011 -0500

    fixed the remote remove file so if the file doesnt exist, the function is wrapped in a try except block.

diff --git a/remote.py b/remote.py
index 1a52b86..8e8d1e7 100755
--- a/remote.py
+++ b/remote.py
@@ -194,7 +194,10 @@ class RemoteManagement(object):
         os.chdir('%s/tmp' % cwd)
         fn = self._filePathCheck(fn)
         fn = fn.replace('/', '/invalid')
-        os.remove(fn)
+        try:
+            os.remove(fn)
+        except:
+            return {'success':False, 'msg':'Unable to remove %s' % fn}
         return {'success':True}
 
     def archiveDir(self, globalVars, dn):
@@ -270,11 +273,9 @@ class RemoteManagement(object):
         return 1
 
     def _artifactNameCheck(self, name):
-        print name
         name = name.replace(' ', '_')
         name = name.replace('.', '_')
         name = name.replace('/', '_')
-        print name
         return name
 
     def _filePathCheck(self, fp):

commit 8fc84ca5583c3cb7733f7005ff25ccec36482d2e
Author: Darren Sessions <dsessions at digium.com>
Date:   Wed Jun 8 16:52:26 2011 -0500

    added the hostname to the list of elements returned when an rpc connection is established. will be useful for several things.

diff --git a/lib/python/TestSuite.py b/lib/python/TestSuite.py
index 83f5738..0a3b140 100644
--- a/lib/python/TestSuite.py
+++ b/lib/python/TestSuite.py
@@ -77,7 +77,7 @@ class utils():
             except:
                 return {'success':False,'msg':'Connection to %s was refused.' % self.host}
             ipv4, ipv6 = self.rpc[self.host].whatAreMyIps() 
-            return {'success':True, 'rpc':self.cmd, 'ipv4':ipv4, 'ipv6':ipv6}
+            return {'success':True, 'rpc':self.cmd, 'ipv4':ipv4, 'ipv6':ipv6, 'hostname':self.host}
 
         def cmd(self, cmd, *args):
             try:

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


-- 
asterisk-scf/integration/testsuite.git



More information about the asterisk-scf-commits mailing list