[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 May 25 15:39:06 CDT 2011


branch "review" has been updated
       via  12aca01bf526848db24f8ecc11e3593319dc215e (commit)
      from  9dbc7968010003b66033221f70ce5d1898ba7641 (commit)

Summary of changes:
 plugins/failover.py                                |   62 ++++++++++++-------
 remote.py                                          |    5 +-
 .../testcase.yaml                                  |    9 +--
 testsuite.py                                       |   15 +++--
 4 files changed, 56 insertions(+), 35 deletions(-)


- Log -----------------------------------------------------------------
commit 12aca01bf526848db24f8ecc11e3593319dc215e
Author: Darren Sessions <dsessions at digium.com>
Date:   Wed May 25 15:39:03 2011 -0500

    more functionality on the failover plugin. modified the testsuite so that multiple plugins for multiple hosts can be submitted into the shutdown list. updated the corosync configuration to use unicast traffic instead of multicast so as to avoid generating excessive network traffic.

diff --git a/plugins/failover.py b/plugins/failover.py
index 7081d64..b5a06cc 100644
--- a/plugins/failover.py
+++ b/plugins/failover.py
@@ -25,11 +25,15 @@ class testsuite(util.TestSuiteBaseClass):
         if not 'testsuite_remote_standby' in testData['cmd']:
             return {'success':False,'msg':'No testsuite-remote specified for the standby failover configuration.'}
 
+        if not 'ipv4oripv6' in testData['cmd']:
+            return {'success':False,'msg':'No ip version specified.'}
+
+
         results = self.rpc(testData['cmd']['testsuite_remote_active'])
         if not results['success'] == True:
             return results
-        else:
             activeNode['rpc'] = results['rpc']
+            activeNode['nodeID'] = '0'
             (activeNode['ipv4'], activeNode['ipv6'])  = activeNode['rpc'].whatAreMyIps()
 
         results = self.rpc(testData['cmd']['testsuite_remote_standby'])
@@ -37,11 +41,14 @@ class testsuite(util.TestSuiteBaseClass):
             return results
         else:
             standbyNode['rpc'] = results['rpc']
+            activeNode['nodeID'] = '1'
             (standbyNode['ipv4'], standbyNode['ipv6'])  = standbyNode['rpc'].whatAreMyIps()
 
-        print 'sweet'
+        
+        print self._corosyncConfig(
+        
 
-        return {'success':True}
+        return {'success':True,'shutdownList':[testData['cmd']['testsuite_remote_active'], testData['cmd']['testsuite_remote_standby']]}
 
         ''' start and stop individual components. shutdown is implemented in the main testsuite code ''' 
         for cmd in testData['cmd']:
@@ -67,33 +74,42 @@ class testsuite(util.TestSuiteBaseClass):
         if ipV == 4:
             config = [
                 'totem {',
-                '    version: 2',
-                '    token: 160',
-                '    token_retransmits_before_loss_const: 3',
-                '    join: 30',
-                '    consensus: 300',
-                '    vsftype: none',
-                '    max_messages: 20',
-                '    clear_node_high_bit: yes',
-                '    secauth: off',
-                '    threads: 0',
-                '    nodeid: %s' % nodeID,
-                '    rrp_mode: none',
-                '    interface {',
-                '        ringnumber: 0',
-                '        bindnetaddr: %s' % hostIP,
-                '    }',
+                '   version: 2',
+                '   token: 160',
+                '   token_retransmits_before_loss_const: 3',
+                '   join: 30',
+                '   consensus: 300',
+                '   vsftype: none',
+                '   max_messages: 20',
+                '   clear_node_high_bit: yes',
+                '   secauth: off',
+                '   threads: 0',
+                '   nodeid: %s' % nodeID,
+                '   rrp_mode: none',
+                '   interface {',
+                '       member {',
+                '           memberaddr: %s' % node1,
+                '       }',
+                '       member {',
+                '           memberaddr: %s' % node2,
+                '       }',
+                '       ringnumber: 0',
+                '       bindnetaddr: %s' % networkAddr,
+                '       mcastport: 5405',
+                '       ttl: 1',
+                '   }',
+                '   transport: udpu',
                 '}',
                 'amf {',
                 '    mode: disabled',
                 '}',
                 'service {',
-                '    ver:       0',
-                '    name:      pacemaker',
+                '    ver: 0',
+                '    name: pacemaker',
                 '}',
                 'aisexec {',
-                '    user:   root',
-                '    group:  root',
+                '    user: root',
+                '    group: root',
                 '}',
                 'logging {',
                 '    fileline: off',
diff --git a/remote.py b/remote.py
index b6482fe..a3cc87a 100755
--- a/remote.py
+++ b/remote.py
@@ -191,8 +191,11 @@ class RemoteManagement(object):
         return results
 
     def writeFile(self, fn, fd):
+        return self._wFile("%s/tmp/%s" % (cwd, fn), fd)
+
+    def wFile(self, fn, fd):
         try:
-            f = open("%s/tmp/%s" % (cwd, fn), "w")
+            f = open("%s" % fn, "w")
         except IOError:
             return {'success':False,'msg':'Failed to open test results output file: %s/tmp/%s' % (cwd, fn)}
         except:
diff --git a/tests/failover/SysTest_Functional_Basic_Call_Setup_w_Failover/testcase.yaml b/tests/failover/SysTest_Functional_Basic_Call_Setup_w_Failover/testcase.yaml
index 0d3ce2b..984582b 100644
--- a/tests/failover/SysTest_Functional_Basic_Call_Setup_w_Failover/testcase.yaml
+++ b/tests/failover/SysTest_Functional_Basic_Call_Setup_w_Failover/testcase.yaml
@@ -4,18 +4,15 @@ options :
     call_flow_diagrams: True
     restart_persistant_plugins_between_tests: False
 tests :
-    - ipv4toipv4 :
+    - ipv4 :
         expected_failure : False 
         timeline :
             - failover :
                 cmd :
                     testsuite_remote_active : testsuite-remote-1.digium.internal
                     testsuite_remote_standby : testsuite-remote-2.digium.internal
+                    ipv4oripv6 : ipv4
                     start :
-                        - corosync :
-                            ipv4oripv6 : ipv4
-                            nodeID : 0
+                        - corosync
                         - pacemaker :
-                            other_node : testsuite-remote-2.digium.internal
-                            preferred_resource_owner : True
                             shared_ip : 10.19.139.44
diff --git a/testsuite.py b/testsuite.py
index 21c3f1d..e6ab27d 100755
--- a/testsuite.py
+++ b/testsuite.py
@@ -72,8 +72,12 @@ class __main__:
                                     for plugin in timeLine:
                                         runResults = util.plugins().execute(plugin, pluginData[plugin]['module'], timeLine[plugin], testData['path'])
                                         if runResults['success'] == True:
-                                            if not 'shutdownExempt' in runResults:
-                                                shutdownList.append({timeLine[plugin]['testsuite_remote']:plugin})
+                                            if not 'shutdownList' in runResults:
+                                                if not 'shutdownExempt' in runResults:
+                                                    shutdownList.append({timeLine[plugin]['testsuite_remote']:plugin})
+                                            else:
+                                                for remote in runResults['shutdownList']:
+                                                    shutdownList.append({remote:plugin})
                                         else:
                                             break
                                     if runResults['success'] == False:
@@ -81,9 +85,10 @@ class __main__:
                                         break
 
                                 ''' shutdown if 'restart_persistant_plugins_between_tests' is true or not specified '''
-                                for host in [host for d in shutdownList for host in d]:
-                                    remote = xmlrpclib.Server('http://%s:8000' % host)
-                                    remote.shutdown(d[host]) 
+                                for d in shutdownList:
+                                    for host in d:
+                                        remote = xmlrpclib.Server('http://%s:8000' % host)
+                                        remote.shutdown(d[host]) 
 
                                 if runResults['success'] == False:
                                     print '   |- Test "' + testName + '" - FAILED!\n    \- ' + runResults['msg']

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


-- 
asterisk-scf/integration/testsuite.git



More information about the asterisk-scf-commits mailing list