[asterisk-scf-commits] asterisk-scf/release/testsuite.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Jun 7 12:28:51 CDT 2012


branch "master" has been updated
       via  ec74b4ebc6485b6ce7d9944d8e0bceefa3d12a58 (commit)
       via  2ec6c73807c7b459b43c220566e4b97da2605fac (commit)
       via  cfd221d061201559fcd7acca5a32842dadc07f2c (commit)
       via  be14171239c88677e68be96cedceee804a71ae87 (commit)
       via  5101049cdd69d39810b8d49b7969119dffb84f21 (commit)
       via  74231e55d5cb01c6be2846447424e4c0a77af1fe (commit)
       via  0c724c7f5541b5e02d8db9ec97146add573bcaa7 (commit)
       via  f1003d0426fb3f5f92924cfdd42fb9622f8f5579 (commit)
       via  266c1b68eb8f5a80d78f843f6a914e3392f8fe7b (commit)
       via  bcd22aeb4cd99690a52473afed3754f3fb46b46f (commit)
       via  eff1c0fc3a73fc343b8bc5b42e12960586a3724b (commit)
      from  417bdb90608d23abf4ea95df9b0a8bfeb274191a (commit)

Summary of changes:
 plugins/asteriskscf_activator.py                   |  187 ++++----------------
 plugins/asteriskscf_configurator.py                |    2 +-
 plugins/build.py                                   |    6 +
 plugins/failover.py                                |    8 +-
 plugins/wireshark.py                               |   15 +-
 .../sip/Functional_Registrar_Simple/testcase.yaml  |  119 ++-----------
 .../scenarios/register.xml                         |    0
 .../testcase.yaml                                  |   90 +++++++---
 .../testcase.yaml                                  |    4 +-
 9 files changed, 124 insertions(+), 307 deletions(-)
 copy tests/asteriskscf/sip/{Functional_Registrar_Simple => Functional_Registrar_Simple_Failover}/scenarios/register.xml (100%)
 copy tests/asteriskscf/{failover/sip => sip/Functional_Registrar_Simple_Failover}/testcase.yaml (64%)


- Log -----------------------------------------------------------------
commit ec74b4ebc6485b6ce7d9944d8e0bceefa3d12a58
Author: Darren Sessions <dsessions at digium.com>
Date:   Thu Jun 7 12:28:03 2012 -0500

    Modified the SIPSessionManager category to SIPSessionGateway to support name changes made in the core Asterisk SCF code.

diff --git a/tests/asteriskscf/sip/Functional_Simple_Call_Plus_Failover/testcase.yaml b/tests/asteriskscf/sip/Functional_Simple_Call_Plus_Failover/testcase.yaml
index 6803e94..bde2733 100644
--- a/tests/asteriskscf/sip/Functional_Simple_Call_Plus_Failover/testcase.yaml
+++ b/tests/asteriskscf/sip/Functional_Simple_Call_Plus_Failover/testcase.yaml
@@ -164,7 +164,7 @@ tests :
                 service_locator_host : [testsuite-remote-1.digium.internal, public1, ipv4]
                 cmd : 
                     activate : 
-                        replica_name : SIPSessionManager.Replica
+                        replica_name : SIPSessionGateway.Replica
                         instance_id : SIPServiceActive
                         service_name : default
             - sipp:
@@ -197,7 +197,7 @@ tests :
                 service_locator_host : [testsuite-remote-1.digium.internal, public1, ipv4]
                 cmd :       
                     activate : 
-                        replica_name : SIPSessionManager.Replica
+                        replica_name : SIPSessionGateway.Replica
                         instance_id : SIPServiceStandby
                         service_name : default
             - sipp:         

commit 2ec6c73807c7b459b43c220566e4b97da2605fac
Author: Darren Sessions <dsessions at digium.com>
Date:   Thu Jun 7 12:27:13 2012 -0500

    Accidently committed a vi swap file. Opps!

diff --git a/tests/asteriskscf/sip/Functional_Registrar_Simple_Failover/.testcase.yaml.swp b/tests/asteriskscf/sip/Functional_Registrar_Simple_Failover/.testcase.yaml.swp
deleted file mode 100644
index c433dc5..0000000
Binary files a/tests/asteriskscf/sip/Functional_Registrar_Simple_Failover/.testcase.yaml.swp and /dev/null differ

commit cfd221d061201559fcd7acca5a32842dadc07f2c
Author: Darren Sessions <dsessions at digium.com>
Date:   Thu Jun 7 12:26:19 2012 -0500

    This is a duplicate of the Functional_Registrar_Simple test with addition of failover testing.

diff --git a/tests/asteriskscf/sip/Functional_Registrar_Simple_Failover/.testcase.yaml.swp b/tests/asteriskscf/sip/Functional_Registrar_Simple_Failover/.testcase.yaml.swp
new file mode 100644
index 0000000..c433dc5
Binary files /dev/null and b/tests/asteriskscf/sip/Functional_Registrar_Simple_Failover/.testcase.yaml.swp differ
diff --git a/tests/asteriskscf/sip/Functional_Registrar_Simple_Failover/scenarios/register.xml b/tests/asteriskscf/sip/Functional_Registrar_Simple_Failover/scenarios/register.xml
new file mode 100644
index 0000000..b86f5aa
--- /dev/null
+++ b/tests/asteriskscf/sip/Functional_Registrar_Simple_Failover/scenarios/register.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<scenario name="Basic Sipstone UAC">
+    <!-- In client mode (service placing calls), the Call-ID MUST be         -->
+    <!-- generated by service. To do so, use [call_id] keyword.                -->
+    <send retrans="500">
+        <![CDATA[
+
+        REGISTER sip:service@[remote_ip]:[remote_port] SIP/2.0
+        Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+        From: service <sip:service@[local_ip]:[local_port]>;tag=[pid]serviceTag00[call_number]
+        To: <sip:service@[remote_ip]:[remote_port]>
+        Call-ID: [call_id]
+        CSeq: 1 REGISTER
+        Contact: sip:service@[local_ip]:[local_port]
+        Max-Forwards: 70
+        Expires: 3600
+        Content-Length: 0
+
+        ]]>
+    </send>
+
+    <recv response="200" rtd="true" optional="false" />
+</scenario>
diff --git a/tests/asteriskscf/sip/Functional_Registrar_Simple_Failover/testcase.yaml b/tests/asteriskscf/sip/Functional_Registrar_Simple_Failover/testcase.yaml
new file mode 100644
index 0000000..17f92a0
--- /dev/null
+++ b/tests/asteriskscf/sip/Functional_Registrar_Simple_Failover/testcase.yaml
@@ -0,0 +1,181 @@
+name : Functional_Registrar_Simple_Failover
+docs :
+    template : generic
+    category : functional
+    summary : Test simple ipv4 and ipv6 registrations and confirm working calls.
+    description : "Using both ipv4 and ipv6 scenarios, this test starts Asterisk SCF and uses SIPp to send a simple REGISTER message followed by a simple call test."
+    repo_url : 'http://git.asterisk.org/gitweb/?p=asterisk-scf/release/testsuite.git;a=tree;f=bamboo;hb=HEAD'
+    components : 'Service Locator, Bridge, Routing, Sip Session Gateway, and Media_RTP_PJMedia'
+    requirements : 'Asterisk SCF, SIPp, Wireshark (optional), CallFlow (optional)'
+tests :
+    - ipv4 :
+        expected_failure : False
+        timeline:
+            - failover :
+                cmd :
+                    assign :
+                        active_testsuite_remote_host : [testsuite-remote-2.digium.internal, public1, ipv4]
+                        standby_testsuite_remote_host : [testsuite-remote-3.digium.internal, public1, ipv4]
+                        address_pool : failover_pool_1
+                        shared_ip_label : failover-shared-ip-1
+            - wireshark :
+                remote_agent : [testsuite-remote-4.digium.internal, public1, ipv4]
+                cmd :
+                    start:
+                        host_filter :
+                            - [testsuite-remote-1.digium.internal, public1, ipv4]
+                            - [testsuite-remote-2.digium.internal, public1, ipv4]
+                            - [testsuite-remote-3.digium.internal, public1, ipv4]
+                            - [testsuite-remote-4.digium.internal, public1, ipv4]
+                            - [testsuite-remote-5.digium.internal, public1, ipv4]
+                            - [failover-shared-ip-1, public1, ipv4]
+                        protocol_filter :
+                            - sip
+                            - rtp
+                            - icmp
+                            - t38
+                            - dns
+            - asteriskscf_icebox :
+                service_locator : [testsuite-remote-1.digium.internal, public1, ipv4]
+                remote_agent : [testsuite-remote-1.digium.internal, public1, ipv4]
+                cmd :
+                    start :
+                        components :
+                            - ServiceDiscovery
+                            - Logger
+                            - MediaFormatGeneric
+                            - MediaServiceRTP
+                            - BridgeManager
+                            - RoutingService
+                            - SipStateReplicator
+                        mode : failover
+            - asteriskscf_icebox :
+                service_locator : [testsuite-remote-1.digium.internal, public1, ipv4]
+                remote_agent : [testsuite-remote-2.digium.internal, public1, ipv4]
+                shared_addr : [failover-shared-ip-1, public1, ipv4]
+                cmd :
+                    start :
+                        components :
+                            - SIPServiceActive
+                        mode : failover
+            - asteriskscf_icebox :
+                service_locator : [testsuite-remote-1.digium.internal, public1, ipv4]
+                remote_agent : [testsuite-remote-3.digium.internal, public1, ipv4]
+                shared_addr : [failover-shared-ip-1, public1, ipv4]
+                cmd :
+                    start :
+                        components :
+                            - SIPServiceStandby
+                        mode : failover
+            - asteriskscf_activator :
+                remote_agent : [testsuite-remote-1.digium.internal, public1, ipv4]
+                service_locator_host : [testsuite-remote-1.digium.internal, public1, ipv4]
+                cmd :
+                    activate :
+                        category : SIPSessionGateway.Replica
+                        service_name : default
+                        instance_name : SIPServiceActive
+            - asteriskscf_configurator :
+                remote_agent : [testsuite-remote-1.digium.internal, public1, ipv4] 
+                service_locator_host : [testsuite-remote-1.digium.internal, public1, ipv4]
+                configuration_wipe : False
+                cmd :
+                    sip :
+                        - listen_udp4 :
+                            type : transport-udp
+                            host : [failover-shared-ip-1, public1, ipv4]
+                            port : 5060
+                            ipv4oripv6 : ipv4
+                        - service :
+                            type : endpoint
+                            sourcehost : [failover-shared-ip-1, public1, ipv4]
+                            sourceport : 5060
+                            ipv4oripv6 : ipv4
+                            direction : both
+                            securetransport : none
+                            rtpoveripv6 : False
+                            formats : 'ulaw/8000'
+                        - sipp :
+                            type : endpoint
+                            targethost : [testsuite-remote-3.digium.internal, public1, ipv4]
+                            targetport : 5060
+                            sourcehost : [failover-shared-ip-1, public1, ipv4]
+                            sourceport : 5060
+                            ipv4oripv6 : ipv4
+                            direction : both
+                            securetransport : none
+                            rtpoveripv6 : False
+                            formats : 'ulaw/8000'
+                    rtp :
+                         - general :
+                            startport : 10001
+                            endport : 20000
+                            workerthreadcount : 4
+            - sipp:
+                remote_agent : [testsuite-remote-4.digium.internal, public1, ipv4]
+                cmd :
+                    - uac :
+                        scenario_file : register.xml
+                        calls : 1
+                        cps : 1
+                        duration : 10
+                        targethost : [failover-shared-ip-1, public1, ipv4]
+                        ipv4oripv6 : ipv4
+                        transport : udp
+                        timeout : 20
+            - sipp:
+                remote_agent : [testsuite-remote-4.digium.internal, public1, ipv4]
+                cmd :
+                    - uas :
+                        transport : udp
+                        ipv4oripv6 : ipv4
+                        timeout : 10
+            - sipp:
+                remote_agent : [testsuite-remote-5.digium.internal, public1, ipv4]
+                cmd :
+                    - uac :
+                        calls : 1
+                        cps : 1
+                        duration : 10
+                        targethost : [failover-shared-ip-1, public1, ipv4]
+                        ipv4oripv6 : ipv4
+                        transport : udp
+                        timeout : 10
+            - failover :
+                cmd :
+                    failover :
+                        active_testsuite_remote_host : [testsuite-remote-2.digium.internal, public1, ipv4]
+                        standby_testsuite_remote_host : [testsuite-remote-3.digium.internal, public1, ipv4]
+                        address_pool : failover_pool_1
+                        shared_ip_label : failover-shared-ip-1
+            - asteriskscf_activator :
+                remote_agent : [testsuite-remote-1.digium.internal, public1, ipv4]
+                service_locator_host : [testsuite-remote-1.digium.internal, public1, ipv4]
+                cmd :
+                    activate :
+                        category : SIPSessionGateway.Replica
+                        service_name : default
+                        instance_name : SIPServiceStandby
+            - sipp:
+                remote_agent : [testsuite-remote-4.digium.internal, public1, ipv4]
+                cmd :
+                    - uas :
+                        transport : udp
+                        ipv4oripv6 : ipv4
+                        timeout : 10
+            - sipp:
+                remote_agent : [testsuite-remote-5.digium.internal, public1, ipv4]
+                cmd :
+                    - uac :
+                        calls : 1
+                        cps : 1
+                        duration : 10
+                        targethost : [failover-shared-ip-1, public1, ipv4]
+                        ipv4oripv6 : ipv4
+                        transport : udp
+                        timeout : 10
+            - wireshark :
+                run_on_test_failure : True
+                remote_agent : [testsuite-remote-4.digium.internal, public1, ipv4]
+                cmd :
+                    stop :

commit be14171239c88677e68be96cedceee804a71ae87
Author: Darren Sessions <dsessions at digium.com>
Date:   Thu Jun 7 12:23:37 2012 -0500

    Updated the Functional_Registrar_Simple test case to use the new icebox configuration files and configurator options.

diff --git a/tests/asteriskscf/sip/Functional_Registrar_Simple/testcase.yaml b/tests/asteriskscf/sip/Functional_Registrar_Simple/testcase.yaml
index 9ed399a..c1871c6 100644
--- a/tests/asteriskscf/sip/Functional_Registrar_Simple/testcase.yaml
+++ b/tests/asteriskscf/sip/Functional_Registrar_Simple/testcase.yaml
@@ -30,20 +30,22 @@ tests :
                 cmd :
                     start :
                         components :
-                            - service_locator
-                            - bridge
-                            - routing
-                            - sip_session_gateway
-                            - media_rtp_pjmedia
-                            - media_format_generic
+                            - ServiceDiscovery
+                            - Logger
+                            - MediaFormatGeneric
+                            - MediaServiceRTP
+                            - BridgeManager
+                            - RoutingService
+                            - SIPService
                         mode : standalone
             - asteriskscf_configurator :
+                remote_agent : [testsuite-remote-1.digium.internal, public1, ipv4] 
                 service_locator_host : [testsuite-remote-1.digium.internal, public1, ipv4]
                 configuration_wipe : False
                 cmd :
                     sip :
                         - listen_udp4 :
-                            type : transport_udp
+                            type : transport-udp
                             host : [testsuite-remote-1.digium.internal, public1, ipv4]
                             port : 5060
                             ipv4oripv6 : ipv4
@@ -73,7 +75,7 @@ tests :
                             endport : 20000
                             workerthreadcount : 4
             - sipp:
-                remote_agent : testsuite-remote-2.digium.interna
+                remote_agent : [testsuite-remote-2.digium.internal, public1, ipv4]
                 cmd :
                     - uac :
                         scenario_file : register.xml
@@ -85,7 +87,7 @@ tests :
                         transport : udp
                         timeout : 20
             - sipp:
-                remote_agent : testsuite-remote-2.digium.interna
+                remote_agent : [testsuite-remote-2.digium.internal, public1, ipv4]
                 cmd :
                     - uas :
                         transport : udp
@@ -107,102 +109,3 @@ tests :
                 remote_agent : [testsuite-remote-1.digium.internal, public1, ipv4]
                 cmd :
                     stop :
-    - ipv6 :
-        expected_failure : False
-        timeline:
-            - wireshark :
-                remote_agent : [testsuite-remote-1.digium.internal, public1, ipv4]
-                cmd :
-                    start:
-                        host_filter :
-                            - [testsuite-remote-1.digium.internal, public1, ipv4]
-                            - testsuite-remote-2.digium.interna
-                            - [testsuite-remote-3.digium.internal, public1, ipv4]
-                        protocol_filter :
-                            - sip
-                            - rtp
-                            - icmp
-                            - t38
-                            - dns
-            - asteriskscf_icebox :
-                remote_agent : [testsuite-remote-1.digium.internal, public1, ipv4]
-                cmd :
-                    start :
-                        components :
-                            - service_locator
-                            - bridge
-                            - routing
-                            - sip_session_gateway
-                            - media_rtp_pjmedia
-                            - media_format_generic
-                        mode : standalone
-            - asteriskscf_configurator :
-                service_locator_host : [testsuite-remote-1.digium.internal, public1, ipv4]
-                configuration_wipe : False
-                cmd :
-                    sip :
-                        - listen_udp6 :
-                            type : transport_udp
-                            host : [testsuite-remote-1.digium.internal, public1, ipv4]
-                            port : 5060
-                            ipv4oripv6 : ipv6
-                        - service :
-                            type : endpoint
-                            sourcehost : [testsuite-remote-1.digium.internal, public1, ipv4]
-                            sourceport : 5060
-                            ipv4oripv6 : ipv6
-                            direction : both
-                            securetransport : none
-                            rtpoveripv6 : True
-                            formats : 'ulaw/8000'
-                        - sipp :
-                            type : endpoint
-                            targethost : [testsuite-remote-3.digium.internal, public1, ipv4]
-                            targetport : 5060
-                            sourcehost : [testsuite-remote-1.digium.internal, public1, ipv4]
-                            sourceport : 5060
-                            ipv4oripv6 : ipv6
-                            direction : both
-                            securetransport : none
-                            rtpoveripv6 : True
-                            formats : 'ulaw/8000'
-                    rtp :
-                         - general :
-                            startport : 10001
-                            endport : 20000
-                            workerthreadcount : 4
-            - sipp:
-                remote_agent : testsuite-remote-2.digium.interna
-                cmd :
-                    - uac :
-                        scenario_file : register.xml
-                        calls : 1
-                        cps : 1
-                        duration : 10
-                        targethost : [testsuite-remote-1.digium.internal, public1, ipv4]
-                        ipv4oripv6 : ipv6
-                        transport : udp
-                        timeout : 20
-            - sipp:
-                remote_agent : testsuite-remote-2.digium.interna
-                cmd :
-                    - uas :
-                        transport : udp
-                        ipv4oripv6 : ipv6
-                        timeout : 10
-            - sipp:
-                remote_agent : [testsuite-remote-3.digium.internal, public1, ipv4]
-                cmd :
-                    - uac :
-                        calls : 1
-                        cps : 1
-                        duration : 10
-                        targethost : [testsuite-remote-1.digium.internal, public1, ipv4]
-                        ipv4oripv6 : ipv6
-                        transport : udp
-                        timeout : 10
-            - wireshark :
-                run_on_test_failure : True
-                remote_agent : [testsuite-remote-1.digium.internal, public1, ipv4]
-                cmd :
-                    stop :

commit 5101049cdd69d39810b8d49b7969119dffb84f21
Author: Darren Sessions <dsessions at digium.com>
Date:   Thu Jun 7 12:22:14 2012 -0500

    Streamlined the remote agent host names and how they are used in the yaml files and parsed out in the plugin. This was done to support multiple network labels within the testsuite.

diff --git a/plugins/wireshark.py b/plugins/wireshark.py
index 29f9a23..22d9807 100644
--- a/plugins/wireshark.py
+++ b/plugins/wireshark.py
@@ -31,7 +31,6 @@ class plugin(Plugin.BaseClass):
                         if res['success'] == False:
                             return res
 
-			print res['ip']
                         #ipv6 = res['ip']
                         #ipv6 = ipv6.replace('[', '')
                         #ipv6 = ipv6.replace(']', '')
@@ -75,14 +74,14 @@ class plugin(Plugin.BaseClass):
                     '-w',
                     '/tmp/capture.pcap']
        
-                res = globalVars.rpc.cmd[testData['remote_agent']]('run', 'wireshark', 'start', runCmd) 
+                res = globalVars.rpc.cmd[testData['remote_agent'][0]]('run', 'wireshark', 'start', runCmd) 
                 if res['success'] == False:
                     return res
 
                 return res
 
             elif cmd == 'stop':
-                res = globalVars.rpc.cmd[testData['remote_agent']]('moveFile', '/tmp/capture.pcap', '!!TMP!!/artifacts/%s/%s.capture.pcap' % (globalVars.testInfo['testLogs'], globalVars.remoteInfo[testData['remote_agent']]['hostInfo']['hostname']))
+                res = globalVars.rpc.cmd[testData['remote_agent'][0]]('moveFile', '/tmp/capture.pcap', '!!TMP!!/artifacts/%s/%s.capture.pcap' % (globalVars.testInfo['testLogs'], globalVars.remoteInfo[testData['remote_agent'][0]]['hostInfo']['hostname']))
                 if res['success'] == False:
                     return res
 
@@ -91,21 +90,21 @@ class plugin(Plugin.BaseClass):
                         if testData['cmd']['stop']['call_flow_graph'] == False:
                             return res
 
-                res = globalVars.rpc.cmd[testData['remote_agent']]('changeDir', '!!TMP!!/artifacts/%s' % globalVars.testInfo['testLogs'])
+                res = globalVars.rpc.cmd[testData['remote_agent'][0]]('changeDir', '!!TMP!!/artifacts/%s' % globalVars.testInfo['testLogs'])
                 if res['success'] == False:
                     return res
 
-                res = globalVars.rpc.cmd[testData['remote_agent']]('run', 'wireshark', 'callflow', ['callflow', '%s.capture.pcap' % globalVars.remoteInfo[testData['remote_agent']]['hostInfo']['hostname']], True)
+                res = globalVars.rpc.cmd[testData['remote_agent'][0]]('run', 'wireshark', 'callflow', ['callflow', '%s.capture.pcap' % globalVars.remoteInfo[testData['remote_agent'][0]]['hostInfo']['hostname']], True)
                 if res['success'] == False:
                     return res
 
-                callflowDir = '!!TMP!!/artifacts/%s/%s.capture' % (globalVars.testInfo['testLogs'], globalVars.remoteInfo[testData['remote_agent']]['hostInfo']['hostname'])
+                callflowDir = '!!TMP!!/artifacts/%s/%s.capture' % (globalVars.testInfo['testLogs'], globalVars.remoteInfo[testData['remote_agent'][0]]['hostInfo']['hostname'])
 
-                res = globalVars.rpc.cmd[testData['remote_agent']]('moveFile', '%s/index.html' % callflowDir, '%s/index_standard.html' % callflowDir)
+                res = globalVars.rpc.cmd[testData['remote_agent'][0]]('moveFile', '%s/index.html' % callflowDir, '%s/index_standard.html' % callflowDir)
                 if res['success'] == False:
                     return res
 
-                res = globalVars.rpc.cmd[testData['remote_agent']]('moveFile', '%s/index_with_frames.html' % callflowDir, '%s/index.html' % callflowDir)
+                res = globalVars.rpc.cmd[testData['remote_agent'][0]]('moveFile', '%s/index_with_frames.html' % callflowDir, '%s/index.html' % callflowDir)
                 if res['success'] == False:
                     return res
             else: 

commit 74231e55d5cb01c6be2846447424e4c0a77af1fe
Author: Darren Sessions <dsessions at digium.com>
Date:   Thu Jun 7 12:20:37 2012 -0500

    Added the ability to not check the return code when deleteing ipv6 addresses

diff --git a/plugins/failover.py b/plugins/failover.py
index ecd87b0..7705345 100644
--- a/plugins/failover.py
+++ b/plugins/failover.py
@@ -162,11 +162,9 @@ class plugin(Plugin.BaseClass):
                     return ipv4addr, ipv4network, ipv4netmask, ipv4broadcast, ipv6addr, pluginData
 
 class platformCmds_Linux:
-    def _cmd(self, globalVars, nodeType, cluster, cmd):
+    def _cmd(self, globalVars, nodeType, cluster, cmd, checkReturnCode=True):
         time.sleep(.5)
-        #print 'run', 'failover', nodeType, cmd
-        return cluster[nodeType]('run', 'failover', nodeType, cmd, True)
-        #return [nodeType]['rpc']('run', cluster[nodeType]['hostname'], globalVars, 'failover', nodeType, cmd, True)
+        return cluster[nodeType]('run', 'failover', nodeType, cmd, True, checkReturnCode)
 
     def gratuitousArp(self, globalVars, nodeType, cluster, ipv4addr, ipv4network, hostname):
 
@@ -197,7 +195,7 @@ class platformCmds_Linux:
     def remove(self, globalVars, nodeType, cluster, pools):
         for addressPool in pools:
             for ipAddressPool in pools[addressPool]['ipv6']:
-                results = self._cmd(globalVars, nodeType, cluster, ['ifconfig', 'eth0', 'inet6', 'del', ipAddressPool])
+                results = self._cmd(globalVars, nodeType, cluster, ['ifconfig', 'eth0', 'inet6', 'del', ipAddressPool], checkReturnCode=False)
                 if results['success'] == False:
                     return results
 

commit 0c724c7f5541b5e02d8db9ec97146add573bcaa7
Author: Darren Sessions <dsessions at digium.com>
Date:   Thu Jun 7 12:18:50 2012 -0500

    Added the ASTSCF_HOME environment variable to the run command. The remote agents will now parse that arg and merge the dictionary with the local environment to set whatever variable is specified.

diff --git a/plugins/asteriskscf_configurator.py b/plugins/asteriskscf_configurator.py
index 5f857ad..47eb08e 100644
--- a/plugins/asteriskscf_configurator.py
+++ b/plugins/asteriskscf_configurator.py
@@ -54,7 +54,7 @@ class plugin(Plugin.BaseClass):
             locator = "LocatorService:tcp -p 4411 -h %s" % results['ip']
             cmdList = [configurator, "-l", "%s" % locator, "-c", "!!TMP!!/%s" % configFile]
 
-            results = globalVars.rpc.cmd[testData['remote_agent'][0]]('run', 'configurator', cmd, cmdList, True, True) 
+            results = globalVars.rpc.cmd[testData['remote_agent'][0]]('run', 'configurator', cmd, cmdList, True, True, {'ASTSCF_HOME':'/usr/local/testsuite/tmp/gitall'}) 
             if results['success'] == False: return results
 
         return {'success':True, 'shutdownExempt':'True'}

commit f1003d0426fb3f5f92924cfdd42fb9622f8f5579
Author: Darren Sessions <dsessions at digium.com>
Date:   Thu Jun 7 12:17:02 2012 -0500

    Completely refactored the Asterisk SCF activator plugin to exercise the activator.py python script in the configurator repo instead of using a built-in version.

diff --git a/plugins/asteriskscf_activator.py b/plugins/asteriskscf_activator.py
index 73c2418..90af78e 100644
--- a/plugins/asteriskscf_activator.py
+++ b/plugins/asteriskscf_activator.py
@@ -1,173 +1,52 @@
 '''
 
- Asterisk SCF IceBox Plugin
+ Asterisk SCF Activator Plugin
 
- Test-Suite - Copyright (C) 2011, Digium, Inc.
+ Test-Suite - Copyright (C) 2012, Digium, Inc.
 
- Written by Darren Sessions
+ Written by Darren Sessions 
 
  See http://wiki.asterisk.org for more information.
 
- This program is free software, distributed under the
+ This program is free software, distributed under the 
  terms of the GNU General Public License Version 2.
 
 '''
 
 from GlobalVars import globalVars
 
-import os
-import sys
 import time
-import uuid
-
 import Plugin
 
-sys.path.append('/opt/Ice-3.4/python')
+class plugin(Plugin.BaseClass):
+    def main(self, testData):
+        ''' The activator doesn't implement a start or stop function as it's just pushing config '''
+
+        if not 'cmd' in testData or not 'remote_agent' in testData or not 'service_locator_host' in testData:
+            return {'success':False,'msg':'remote_agent, service_locator_host, and a cmd must be specified.'}
 
-import Ice
+	for cmd in testData['cmd']:
+	    if cmd == 'activate':
 
-class plugin(Plugin.BaseClass):
-    Plugin.BaseClass().cleanup('process', 'icebox')
+                if not 'category' in testData['cmd']['activate'] or \
+                   not 'service_name' in testData['cmd']['activate'] or \
+                   not 'instance_name' in testData['cmd']['activate']:
+                    return {'success':False,'msg':'activate requires a category, service_name, and instance_name.'}
 
-    def main(self, testData):
-        time.sleep(1)
-        try:
-            gitall = "%s/tmp/gitall/" % os.getcwd()
-            slice = gitall + "slice/slice"
-            AstSCFslice = slice + "/AsteriskSCF/"
-
-            Ice.loadSlice("-I\"" + slice + "\" -I\"" + Ice.getSliceDir() + "\" --all \"" + AstSCFslice + "System/Component/ReplicaIf.ice\"")
-            Ice.loadSlice("-I\"" + slice + "\" -I\"" + Ice.getSliceDir() + "\" --all \"" + AstSCFslice + "Core/Discovery/ServiceLocatorIf.ice\"")
-        except:
-            return {'success':False,'shutdownExempt':'True','msg':'Slice preprocessing failed. Unable to locate slice files.'}
-
-        try: 
-            import AsteriskSCF.Core.Discovery.V1
-            import AsteriskSCF.System.Component.V1 
-        except:
-            return {'success':False,'shutdownExempt':'True','msg':'Unable to import required Asterisk SCF python modules.'}
-
-        for cmd in testData['cmd']:
-            if cmd == 'activate':
-                if 'service_locator_host' in testData:
-                    res = self.hostLabelResolver(testData['service_locator_host'])
-                    if res['success'] == False:
-                        return res
-
-                    service_locator_host = res['ip']
-                else:
-                    service_locator_host = None
-
-                if 'discovery_replica_host' in testData:
-                    res = self.hostLabelResolver(testData['discovery_replica_host'])
-                    if res['success'] == False:
-                        return res
-
-                    discovery_replica_host = res['ip']
-                else:
-                    discovery_replica_host = None
-
-                if 'skip_service_locator_host' in testData:
-                    skip_service_locator_host = True
-                else:
-                    skip_service_locator_host = False
-
-                if not 'replica_name' in testData['cmd']['activate']:
-                    return {'success':False, 'msg':'A replica name is required.'}
-
-                if not 'instance_id' in testData['cmd']['activate']:
-                    return {'success':False, 'msg':'An instance id is required.'}
-
-                if not 'service_name' in testData['cmd']['activate']:
-                    return {'success':False, 'msg':'A service name is required.'}
-
-                res = ReplicaActivatorApp(AsteriskSCF, 
-                                            testData['cmd']['activate']['replica_name'],
-                                            testData['cmd']['activate']['instance_id'],
-                                            testData['cmd']['activate']['service_name'],
-                                            discovery_replica_host,
-                                            service_locator_host,
-                                            skip_service_locator_host).main([''])
-
-                time.sleep(1)
-                return res
-
-class ReplicaActivatorApp(Ice.Application):
-    def __init__(self, AsteriskSCF, replica_name, instance_id, service_name, discoveryReplicaStringHost, serviceLocatorStringHost, skip_service_locator_host):
-        self.AsteriskSCF = AsteriskSCF
-        self.replica_name = replica_name
-        self.instance_id = instance_id
-        self.service_name = service_name
-        self.discoveryReplicaStringHost = discoveryReplicaStringHost
-        self.serviceLocatorStringHost = serviceLocatorStringHost
-        self.skip_service_locator_host = skip_service_locator_host
-
-    def createContext(self):
-        newContext = self.AsteriskSCF.System.V1.OperationContext()
-        newContext.id = str(uuid.uuid4()) # Random UUID
-        newContext.transactionId = newContext.id
-        return newContext
-
-    def run(self, args):
-        discoveryReplicaString = 'ServiceLocatorReplica:tcp -p 4410'
-        serviceLocatorString = 'LocatorService:tcp -p 4411'
-
-        # First we try to activate the Service Locator component itself, so that we can use it to locate all 
-        # the other Asterisk SCF components.
-        if not self.discoveryReplicaStringHost == None:
-            discoveryReplicaString = discoveryReplicaString + ' -h ' + self.discoveryReplicaStringHost
-
-        if not self.serviceLocatorStringHost == None:
-            serviceLocatorString = serviceLocatorString + ' -h ' + self.serviceLocatorStringHost
-
-
-        try:
-            discoveryReplica = self.AsteriskSCF.System.Component.V1.ReplicaPrx.checkedCast(self.communicator().stringToProxy(discoveryReplicaString))
-        except:
-            return {'success':False,'msg':"Exception trying to activate a Service Locator component: %s" % sys.exc_info()[1]}
-
-        if discoveryReplica == None:
-            return {'success':False,'msg':"Invalid Replica proxy specified."}
-
-        try:
-             discoveryReplica.activate(self.createContext())
-        except:
-             return {'success':False,'msg':"Exception trying to activate a Service Locator component: %s" % sys.exc_info()[1]}
-
-        #except Ice.Exception as ex:
-        #    return {'success':False,'msg':"Exception trying to activate a Service Locator component: " + ex.what()}
-
-        if self.skip_service_locator_host == True:
-            return {'success':True}
-
-        # We have an active Service Locator component. Get a proxy to the Service Locator interface so that
-        # we can lookup registered interfaces.
-        serviceLocator = self.AsteriskSCF.Core.Discovery.V1.ServiceLocatorPrx.checkedCast(self.communicator().stringToProxy(serviceLocatorString))
-
-        if serviceLocator == None:
-            return {'success':False,'msg':"Invalid service locator proxy specified."}
-
-        # Activate the component
-        componentLocatorParams = self.AsteriskSCF.Core.Discovery.V1.ServiceLocatorParams()
-        componentLocatorParams.category = self.replica_name
-        componentLocatorParams.service = self.service_name
-        componentLocatorParams.id = self.instance_id
-
-        try:
-            componentReplicaObjPrx = serviceLocator.locate(componentLocatorParams)
-        except self.AsteriskSCF.Core.Discovery.V1.ServiceNotFound:
-            return {'success':False,'msg':'The \'%s\' replica interface was not found by the specified service locator. %s' % (self.replica_name, sys.exc_info()[1])}
-
-        componentReplica = self.AsteriskSCF.System.Component.V1.ReplicaPrx.checkedCast(componentReplicaObjPrx)
-
-	if componentReplica == None:
-            return {'success':False,'msg':'Invalid replica proxy specified.'}
-
-        try:
-            results = componentReplica.activate(self.createContext())
-            if results == True:
-               return {'success':True}
-            else:
-               return {'success':False,'msg':'Unable to activate replica.'}
-        except:
-            return {'success':False,'msg':'Unable to activate replica. %s' % sys.exc_info()[1]}
+                results = self.hostLabelResolver(testData['service_locator_host'])
+                if results['success'] == False: return results
+
+                activator = "!!TMP!!/gitall/configurator/Activator.py"
+
+                cmdList = [activator, '-c', testData['cmd']['activate']['category'], 
+                                      '-s', testData['cmd']['activate']['service_name'],
+                                      '-i', testData['cmd']['activate']['instance_name'],
+                                      '-sh', results['ip']]
+
+                results = globalVars.rpc.cmd[testData['remote_agent'][0]]('run', 'Activator', cmd, cmdList, True, True, {'ASTSCF_HOME':'/usr/local/testsuite/tmp/gitall'})
+                if results['success'] == False: return results
+
+	    else:
+                return {'success':False,'msg':'Unknown command.'}
+
+        return {'success':True, 'shutdownExempt':'True'}

commit 266c1b68eb8f5a80d78f843f6a914e3392f8fe7b
Author: Darren Sessions <dsessions at digium.com>
Date:   Wed May 23 11:56:13 2012 -0500

    Removed erroneous print command.

diff --git a/plugins/build.py b/plugins/build.py
index 771d0d2..6a0a24f 100644
--- a/plugins/build.py
+++ b/plugins/build.py
@@ -68,8 +68,6 @@ class plugin(Plugin.BaseClass):
             if "git_dir" in testData['cmd']:
                 getCmd.append("%s" % testData['cmd']['git_dir'])
 
-        print getCmd
-
         shutdownList = []
 
         if testData['cmd']['dl_type'] == 'wget':

commit bcd22aeb4cd99690a52473afed3754f3fb46b46f
Author: Darren Sessions <dsessions at digium.com>
Date:   Wed May 23 11:49:59 2012 -0500

    Added the ability to specifiy a git repo directory.

diff --git a/plugins/build.py b/plugins/build.py
index 4a92cdb..771d0d2 100644
--- a/plugins/build.py
+++ b/plugins/build.py
@@ -64,6 +64,10 @@ class plugin(Plugin.BaseClass):
 
         getCmd.append(testData['cmd']['dl_url'])
 
+        if testData['cmd']['dl_type'] == 'git':
+            if "git_dir" in testData['cmd']:
+                getCmd.append("%s" % testData['cmd']['git_dir'])
+
         print getCmd
 
         shutdownList = []

commit eff1c0fc3a73fc343b8bc5b42e12960586a3724b
Author: Darren Sessions <dsessions at digium.com>
Date:   Wed May 23 11:47:28 2012 -0500

    Added support for shallow clones in the build plugin.

diff --git a/plugins/build.py b/plugins/build.py
index 1e1c80b..4a92cdb 100644
--- a/plugins/build.py
+++ b/plugins/build.py
@@ -51,6 +51,8 @@ class plugin(Plugin.BaseClass):
         if testData['cmd']['dl_type'] == 'git':
             getCmd.append('clone')
             refreshCmd.append('pull')
+            if "git_depth" in testData['cmd']:
+                getCmd.append('--depth=%s' % testData['cmd']['git_depth'])
         elif testData['cmd']['dl_type'] == 'svn':
             getCmd.append('co')
             refreshCmd.append('update')
@@ -62,6 +64,8 @@ class plugin(Plugin.BaseClass):
 
         getCmd.append(testData['cmd']['dl_url'])
 
+        print getCmd
+
         shutdownList = []
 
         if testData['cmd']['dl_type'] == 'wget':

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


-- 
asterisk-scf/release/testsuite.git



More information about the asterisk-scf-commits mailing list