[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 1 15:56:38 CDT 2011


branch "review" has been updated
       via  6df7fcd588d000f49aa3a2853827218740f6b706 (commit)
      from  c19d0d7b2126bfcc05008dd5d286e7e700fdca69 (commit)

Summary of changes:
 plugins/asteriskscf_configurator.py                |   34 +++++++++-------
 plugins/asteriskscf_icebox.py                      |   21 ++++++----
 plugins/sipp.py                                    |   42 +++++++++++++++++---
 .../testcase.yaml                                  |   11 ++++-
 tests/tests.yaml                                   |    2 +-
 testsuite.py                                       |    8 ++++
 6 files changed, 87 insertions(+), 31 deletions(-)


- Log -----------------------------------------------------------------
commit 6df7fcd588d000f49aa3a2853827218740f6b706
Author: Darren Sessions <dsessions at digium.com>
Date:   Wed Jun 1 15:56:34 2011 -0500

    modified the icebox configuration to get scf up and running again. added a check for an artifacts directory for bamboo. added the same remote host ipv4/ipv6 address resolver from the configurator plugin into sipp with some sipp specific modifications. fixed the configurator rtp visitor class. made some minor tweaks.

diff --git a/plugins/asteriskscf_configurator.py b/plugins/asteriskscf_configurator.py
index c172bd5..78e6d54 100644
--- a/plugins/asteriskscf_configurator.py
+++ b/plugins/asteriskscf_configurator.py
@@ -49,7 +49,11 @@ class plugin(TestSuite.BaseClass):
                 serviceLocatorParams.category = AsteriskSCF.Media.RTP.V1.ConfigurationDiscoveryCategory
             else:
                 return {'success':False,'shutdownExempt':'True','msg':'The %s command is invalid.' % cmd}
-            return ConfiguratorApp(cmd, testData['service_locator_host'], testData['cmd'][cmd], AsteriskSCF, testData['configuration_wipe'], serviceLocatorParams).main([''])
+            results = ConfiguratorApp(cmd, testData['service_locator_host'], testData['cmd'][cmd], AsteriskSCF, testData['configuration_wipe'], serviceLocatorParams).main([''])
+            if results['success'] == False:
+                return {'success':False, 'shutdownExempt':'True', 'msg':results['msg']}
+
+        return {'success':True, 'shutdownExempt':'True'}
 
 # Exception class used within the configurator application
 class ConfiguratorError(Exception):
@@ -89,9 +93,9 @@ class OptionMapper():
         except ValueError:
             # This is not a fatal error since we just use the default value.
             if default == None:
-                print "WARNING! The specified value for option '" + option + "' is not valid and no default value exists."
+                print >> sys.stderr, "WARNING! The specified value for option '" + option + "' is not valid and no default value exists."
             else:
-                print "WARNING! The specified value for option '" + option + "' is not valid. Using default value."
+                print >> sys.stderr, "WARNING! The specified value for option '" + option + "' is not valid. Using default value."
                 setattr(object, item, default)
 
         # This has the potential to overwrite an existing item but this is done on purpose so that
@@ -106,7 +110,7 @@ class OptionMapper():
             default = self.options[option][4]
             if default == None:
                 if item == None:
-                    print "WARNING! Option '" + option + "' requires a value to be set and no default value exists."
+                    print >> sys.stderr, "WARNING! Option '" + option + "' requires a value to be set and no default value exists."
 
 # Common configurator application logic
 class ConfiguratorApp(Ice.Application):
@@ -151,7 +155,9 @@ class ConfiguratorApp(Ice.Application):
 
         for config in self.config:
             for section in config:
-                visitor.visit(config[section], section)
+                results = visitor.visit(config[section], section)
+                if results['success'] == False:
+                    return results
 
         if visitor.groups:
             if self.configWipe == True:
@@ -169,7 +175,7 @@ class ConfiguratorApp(Ice.Application):
         else:
             return {'success':False,'msg':'No configuration to apply.'}
 
-        return {'success':True,'shutdownExempt':'True'}
+        return {'success':True}
 
 # Common section visitor pattern implementation
 class SectionVisitors():
@@ -189,7 +195,7 @@ class SectionVisitors():
 
     def visit_unsupported(self, config, section):
         """Handle an unsupported configuration section"""
-        print "Unsupported configuration section " + section
+        print >> sys.stderr, "Unsupported configuration section " + section
 
     def chkOption(self, config, option):
         try:
@@ -392,17 +398,17 @@ class SipSectionVisitors(SectionVisitors):
 
 class RtpSectionVisitors(SectionVisitors):
     def visit_general(self, config, section):
-        mapper = Configurator.OptionMapper()
+        mapper = OptionMapper()
 
-        group = AsteriskSCF.Media.RTP.V1.RtpGeneralGroup()
+        group = self.AsteriskSCF.Media.RTP.V1.RtpGeneralGroup()
         group.configurationItems = {}
 
-        portsItem = AsteriskSCF.Media.RTP.V1.PortRangesItem()
-        mapper.map('startport', portsItem, 'startPort', AsteriskSCF.Media.RTP.V1.PortRangesItemName, self.chkOption(config, 'startport'), 10000)
-        mapper.map('endport', portsItem, 'endPort', AsteriskSCF.Media.RTP.V1.PortRangesItemName, self.chkOption(config, 'endport'), 20000)
+        portsItem = self.AsteriskSCF.Media.RTP.V1.PortRangesItem()
+        mapper.map('startport', portsItem, 'startPort', self.AsteriskSCF.Media.RTP.V1.PortRangesItemName, self.chkOption(config, 'startport'), 10000)
+        mapper.map('endport', portsItem, 'endPort', self.AsteriskSCF.Media.RTP.V1.PortRangesItemName, self.chkOption(config, 'endport'), 20000)
 
-        workerItem = AsteriskSCF.Media.RTP.V1.WorkerThreadCountItem()
-        mapper.map('workerthreadcount', workerItem, 'count', AsteriskSCF.Media.RTP.V1.WorkerThreadCountItemName, self.chkOption(config, 'workerthreadcount'), 4)
+        workerItem = self.AsteriskSCF.Media.RTP.V1.WorkerThreadCountItem()
+        mapper.map('workerthreadcount', workerItem, 'count', self.AsteriskSCF.Media.RTP.V1.WorkerThreadCountItemName, self.chkOption(config, 'workerthreadcount'), 4)
  
         for option in config:
             mapper.execute(group, section, option)
diff --git a/plugins/asteriskscf_icebox.py b/plugins/asteriskscf_icebox.py
index 5d3d1de..211319e 100644
--- a/plugins/asteriskscf_icebox.py
+++ b/plugins/asteriskscf_icebox.py
@@ -46,7 +46,6 @@ class plugin(TestSuite.RemoteBaseClass):
                 'ServiceLocatorStateReplicator.ThreadPool.Size=4']
         elif component == 'service_locator': 
             return [
-                'Ice.Default.CollocationOptimized=0',
                 'IceBox.InheritProperties=1',
                 'IceBox.Service.ServiceDiscovery=service_locator:create',
                 'LocatorService.Proxy=LocatorService:tcp -p 4411',
@@ -74,10 +73,9 @@ class plugin(TestSuite.RemoteBaseClass):
                 'AsteriskSCF.Logging.logger.AsteriskSCF=Info']
         elif component == 'bridge_state_replicator':
             return [
+                'Ice.ThreadPool.Client.Size=4',
                 'IceBox.InheritProperties=1',
                 'IceBox.Service.Replicator=BridgeReplicator:create',
-                'Ice.ThreadPool.Client.Size=4',
-                'Ice.Default.CollocationOptimized=0',
                 'LocatorService.Proxy=LocatorService:tcp -p 4411',
                 'TopicManager.Proxy=AsteriskSCFIceStorm/TopicManager:default -p 10000',
                 'ServiceLocatorManagementProxy=LocatorServiceManagement:tcp -p 4422',
@@ -87,7 +85,7 @@ class plugin(TestSuite.RemoteBaseClass):
             return [
                 'IceBox.InheritProperties=1',
                 'IceBox.Service.BridgeManager=bridgeservice:create',
-                'Ice.ThreadPool.Client.Size=4',
+                'Ice.ThreadPool.Client.Size=10',
                 'TopicManager.Proxy=AsteriskSCFIceStorm/TopicManager:default -p 10000',
                 'LocatorService.Proxy=LocatorService:tcp -p 4411',
                 'ServiceLocatorManagementProxy=LocatorServiceManagement:tcp -p 4422',
@@ -96,6 +94,7 @@ class plugin(TestSuite.RemoteBaseClass):
                 'BridgeManager.BridgeService.Endpoints=default']
         elif component == 'routing_state_replicator':
             return [
+                'Ice.ThreadPool.Client.Size=4',
                 'IceBox.InheritProperties=1',
                 'IceBox.Service.Replicator=BasicRoutingStateReplicator:create',
                 'Replicator.InstanceName=Replicator',
@@ -109,12 +108,13 @@ class plugin(TestSuite.RemoteBaseClass):
                 'LocatorService.Proxy=LocatorService:tcp -p 4411']
         elif component == 'routing':
             return [
+                'Ice.ThreadPool.Client.Size=10',
                 'IceBox.InheritProperties=1',
                 'IceBox.Service.RoutingService=BasicRoutingService:create',
                 'RoutingService.Endpoints=tcp -p 10050',
                 'RoutingService.ComponentService.Endpoints=tcp -p 10051',
-                'RoutingService.ThreadPool.Size=8',
-                'RoutingService.ThreadPool.SizeMax=14',
+                'RoutingService.ThreadPool.Size=4',
+                'RoutingService.ThreadPool.SizeMax=10',
                 'RoutingService.ThreadPool.SizeWarn=9',
                 'RoutingService.Standby=no',
                 'RoutingService.StateReplicatorName=Replicator',
@@ -125,6 +125,7 @@ class plugin(TestSuite.RemoteBaseClass):
                 'BridgeManager.ServiceLocatorId=BridgeService']
         elif component == 'sip_state_replicator':
             return [
+                'Ice.ThreadPool.Client.Size=4',
                 'IceBox.InheritProperties=1',
                 'IceBox.Service.SipStateReplicator=SipStateReplicator:create',
                 'TopicManager.Proxy=AsteriskSCFIceStorm/TopicManager:default -p 10000',
@@ -143,6 +144,7 @@ class plugin(TestSuite.RemoteBaseClass):
                 'SipConfiguration.Name=testsuite']
         elif component == 'sip_session_gateway':
             return [
+                'Ice.ThreadPool.Client.Size=10',
                 'IceBox.InheritProperties=1',
                 'IceBox.Service.SipSessionManager=SipSessionManager:create',
                 'SipSessionManagerAdapter.Endpoints=tcp -p 9985',
@@ -153,11 +155,13 @@ class plugin(TestSuite.RemoteBaseClass):
                 'LocatorServiceManagement.Proxy=LocatorServiceManagement:tcp -p 4422',
                 'LocatorService.Proxy=LocatorService:tcp -p 4411',
                 'Sip.RoutingId=testsuite',
-                'Sip.Modules=Session',
+                'Sip.Modules=Session Logging',
                 'Sip.StateReplicatorName=default',
-                'Sip.StateReplicatorListener=no']
+                'Sip.StateReplicatorListener=no',
+                'Sip.Standalone=false']
         elif component == 'rtp_state_replicator':
             return [
+                'Ice.ThreadPool.Client.Size=4',
                 'IceBox.InheritProperties=1',
                 'IceBox.Service.RtpStateReplicator=RtpStateReplicator:create',
                 'RtpStateReplicator.Endpoints=tcp:udp',
@@ -174,6 +178,7 @@ class plugin(TestSuite.RemoteBaseClass):
                 'RtpConfiguration.Name=testsuite']
         elif component == 'media_rtp_pjmedia':
             return [
+                'Ice.ThreadPool.Client.Size=10',
                 'IceBox.InheritProperties=1',
                 'IceBox.Service.MediaRTPpjmedia=media_rtp_pjmedia:create',
                 'MediaRTPpjmediaAdapter.Endpoints=default',
diff --git a/plugins/sipp.py b/plugins/sipp.py
index d82f602..0545091 100644
--- a/plugins/sipp.py
+++ b/plugins/sipp.py
@@ -13,6 +13,8 @@ import TestSuite
 
 class plugin(TestSuite.RemoteBaseClass):
     def main(self, testData, testPath, globalVars, rpc):
+        self.hosts = {}
+
         config = {}
         modes = ['uas', 'uac']
 
@@ -31,11 +33,12 @@ class plugin(TestSuite.RemoteBaseClass):
                     waitForPidToFinish = False
                 if mode == 'uac':
                     waitForPidToFinish = True
-                results = rpc.run('sipp', mode, self._componentConfig(mode, config[mode], testPath, rpc), waitForPidToFinish)
+                #print ' '.join(self._componentConfig(mode, config[mode], testPath, rpc, testData['testsuite_remote_host']))
+                results = rpc.run('sipp', mode, self._componentConfig(mode, config[mode], testPath, rpc, testData['testsuite_remote_host']), waitForPidToFinish)
                 if results['success'] == False:
                     return results
 
-        return {'success':True,'shutdownExempt':True}
+        return {'success':True}
 
     def _loadScenarioFile(self, fp, fn, rpc):
         fd = self.file().read(fp + '/' + fn)
@@ -46,10 +49,9 @@ class plugin(TestSuite.RemoteBaseClass):
             list.append(execBlock)
         return list
 
-    def _componentConfig(self, mode, config, testPath, rpc):
+    def _componentConfig(self, mode, config, testPath, rpc, testsuite_remote_host):
         execCmd = ['sipp']
 
-        ''' general options '''
         if 'scenario_file' in config:
             results = self._loadScenarioFile(testPath, config['scenario_file'], rpc)
             if results['success'] == False:
@@ -57,6 +59,15 @@ class plugin(TestSuite.RemoteBaseClass):
             execCmd = self._execBuilder(execCmd, '-sf !!TMP!!/%s' % config['scenario_file'])
         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:
+            execCmd = self._execBuilder(execCmd, '-timeout %s' % config['timeout'])
+
         if 'transport' in config:
             if config['transport'] == 'udp':
                 execCmd = self._execBuilder(execCmd, '-t u1')
@@ -71,7 +82,6 @@ class plugin(TestSuite.RemoteBaseClass):
         #if 'port' in config:
         #    execCmd = self._execBuilder(execCmd, '-cp %s' % config['port'])
 
-        ''' UAC specific options '''
         if mode == 'uac':
             if 'calls' in config:
                 execCmd = self._execBuilder(execCmd, '-m %s' % config['calls'])
@@ -80,6 +90,26 @@ class plugin(TestSuite.RemoteBaseClass):
             if 'duration' in config:
                 execCmd = self._execBuilder(execCmd, '-d %s' % config['duration'])
             if 'targethost' in config:
-                execCmd = self._execBuilder(execCmd, '%s' % config['targethost'])
+                results = self.getRemoteHost(config, config['targethost'])
+                if results['success'] == False:
+                    return results
+                execCmd = self._execBuilder(execCmd, '%s' % results['ip'])
     
         return execCmd
+
+    def getRemoteHost(self, config, host):
+        try:
+            config['ipv4oripv6']
+        except:
+            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'."}
+        try:
+            self.hosts[host][config['ipv4oripv6']]
+        except:
+            self.hosts[host] = plugin().rpc(host)
+        if self.hosts[host]['success'] == False:
+            return self.hosts[host]
+        if config['ipv4oripv6'] == 'ipv6':
+            self.hosts[host][config['ipv4oripv6']] = '[%s]' % self.hosts[host][config['ipv4oripv6']]
+        return {'success':True, 'ip':self.hosts[host][config['ipv4oripv6']]}
diff --git a/tests/sip/SysTest_Functional_Basic_CallSetup/testcase.yaml b/tests/sip/SysTest_Functional_Basic_CallSetup/testcase.yaml
index b88c3f5..37256b8 100644
--- a/tests/sip/SysTest_Functional_Basic_CallSetup/testcase.yaml
+++ b/tests/sip/SysTest_Functional_Basic_CallSetup/testcase.yaml
@@ -36,17 +36,21 @@ tests :
                             type : endpoint
                             targethost : testsuite-remote-2.digium.internal
                             targetport : 5060
+                            sourcehost : testsuite-remote-1.digium.internal
+                            sourceport : 5060
                             ipv4oripv6 : ipv4
                             direction : both
                         - sipp :
                             type : endpoint
                             targethost : testsuite-remote-3.digium.internal
                             targetport : 5060
+                            sourcehost : testsuite-remote-1.digium.internal
+                            sourceport : 5060
                             ipv4oripv6 : ipv4
                             direction : both
                     rtp :
                          - general :
-                            startport : 10000
+                            startport : 10001
                             endport : 20000
                             workerthreadcount : 4
             - sipp:
@@ -54,13 +58,16 @@ tests :
                 cmd :
                     - uas :
                         transport : udp
+                        ipv4oripv6 : ipv4
+                        timeout : 10
             - sipp:
                 testsuite_remote_host : testsuite-remote-3.digium.internal
                 cmd :
                     - uac :
-                        calls : 10
+                        calls : 1
                         cps : 1
                         duration : 10
                         targethost : testsuite-remote-1.digium.internal
                         ipv4oripv6 : ipv4
                         transport : udp
+                        timeout : 10
diff --git a/tests/tests.yaml b/tests/tests.yaml
index 9e29cbc..e27a5e6 100644
--- a/tests/tests.yaml
+++ b/tests/tests.yaml
@@ -1,4 +1,4 @@
 tests :
-    - build
+#    - build
     - sip
 #    - failover
diff --git a/testsuite.py b/testsuite.py
index cf17c7c..42da5f7 100755
--- a/testsuite.py
+++ b/testsuite.py
@@ -33,6 +33,13 @@ class __main__:
     def __init__(self):
         if not os.path.exists('%s/tmp' % cwd):
             os.makedirs('%s/tmp' % cwd)
+        if not os.path.exists('%s/artifacts' % cwd):
+            os.makedirs('%s/artifacts' % cwd)
+        try:
+            os.remove('testsuite_results.xml')
+        except:
+            pass
+
         self.globalVars = {'cwd':cwd, 'hostname':hostname}
         self.yamlData = yaml_parser.testcases().returnData
         self.testsuite()
@@ -90,6 +97,7 @@ class __main__:
                                         if not runResults['success'] == True:
                                             break
                                     if runResults['success'] == False:
+                                        print runResults
                                         runResults['msg'] = '%s: %s' % (plugin, runResults['msg'])
                                         break
 

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


-- 
asterisk-scf/integration/testsuite.git



More information about the asterisk-scf-commits mailing list