cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gir...@apache.org
Subject [1/2] CLOUDSTACK-5925: get_*() functionality changed in marvin, changed BVT too.
Date Tue, 28 Jan 2014 05:46:23 GMT
Updated Branches:
  refs/heads/marvin edfd2b679 -> 7305063fb


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7305063f/test/integration/smoke/test_templates.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_templates.py b/test/integration/smoke/test_templates.py
index 65b4f35..b9e32a1 100644
--- a/test/integration/smoke/test_templates.py
+++ b/test/integration/smoke/test_templates.py
@@ -18,6 +18,7 @@
 """
 #Import Local Modules
 import marvin
+from marvin.cloudstackTestClient import getZoneForTests
 from marvin.cloudstackTestCase import *
 from marvin.cloudstackAPI import *
 from marvin.sshClient import SshClient
@@ -53,23 +54,26 @@ class TestCreateTemplate(cloudstackTestCase):
     @classmethod
     def setUpClass(cls):
         
-        cloudstackTestClient = super(TestCreateTemplate, cls).getClsTestClient()
-        cls.api_client = cloudstackTestClient.getApiClient()
-        cls.services = cloudstackTestClient.getConfigParser().parsedDict
+        testClient = super(TestCreateTemplate, cls).getClsTestClient()
+        cls.apiclient = testClient.getApiClient()
+        cls.services = testClient.getParsedTestDataConfig()
 
         # Get Zone, Domain and templates
-        cls.domain = get_domain(cls.api_client, cls.services)
-        cls.zone = get_zone(cls.api_client, cls.services)
+        cls.domain = get_domain(cls.apiclient)
+        cls.zone = get_zone(cls.apiclient, cls.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
         cls.disk_offering = DiskOffering.create(
-                                    cls.api_client,
+                                    cls.apiclient,
                                     cls.services["disk_offering"]
                                     )
         template = get_template(
-                            cls.api_client,
+                            cls.apiclient,
                             cls.zone.id,
                             cls.services["ostype"]
                             )
+        if template == FAILED:
+            cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
+
         cls.services["template"]["ostypeid"] = template.ostypeid
         cls.services["template_2"]["ostypeid"] = template.ostypeid
         cls.services["ostypeid"] = template.ostypeid
@@ -80,19 +84,19 @@ class TestCreateTemplate(cloudstackTestCase):
         cls.services["sourcezoneid"] = cls.zone.id
 
         cls.account = Account.create(
-                            cls.api_client,
+                            cls.apiclient,
                             cls.services["account"],
                             domainid=cls.domain.id
                             )
         cls.services["account"] = cls.account.name
 
         cls.service_offering = ServiceOffering.create(
-                                            cls.api_client,
+                                            cls.apiclient,
                                             cls.services["service_offerings"]
                                             )
         #create virtual machine
         cls.virtual_machine = VirtualMachine.create(
-                                    cls.api_client,
+                                    cls.apiclient,
                                     cls.services["virtual_machine"],
                                     templateid=template.id,
                                     accountid=cls.account.name,
@@ -102,7 +106,7 @@ class TestCreateTemplate(cloudstackTestCase):
                                     )
 
         #Stop virtual machine
-        cls.virtual_machine.stop(cls.api_client)
+        cls.virtual_machine.stop(cls.apiclient)
 
         # Poll listVM to ensure VM is stopped properly
         timeout = cls.services["timeout"]
@@ -111,7 +115,7 @@ class TestCreateTemplate(cloudstackTestCase):
 
             # Ensure that VM is in stopped state
             list_vm_response = list_virtual_machines(
-                                            cls.api_client,
+                                            cls.apiclient,
                                             id=cls.virtual_machine.id
                                             )
 
@@ -129,7 +133,7 @@ class TestCreateTemplate(cloudstackTestCase):
             timeout = timeout - 1
 
         list_volume = list_volumes(
-                                   cls.api_client,
+                                   cls.apiclient,
                                    virtualmachineid=cls.virtual_machine.id,
                                    type='ROOT',
                                    listall=True
@@ -146,9 +150,9 @@ class TestCreateTemplate(cloudstackTestCase):
     @classmethod
     def tearDownClass(cls):
         try:
-            cls.api_client = super(TestCreateTemplate, cls).getClsTestClient().getApiClient()
+            cls.apiclient = super(TestCreateTemplate, cls).getClsTestClient().getApiClient()
             #Cleanup resources used
-            cleanup_resources(cls.api_client, cls._cleanup)
+            cleanup_resources(cls.apiclient, cls._cleanup)
 
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
@@ -222,29 +226,32 @@ class TestTemplates(cloudstackTestCase):
     @classmethod
     def setUpClass(cls):
 
-        cloudstackTestClient = super(TestTemplates, cls).getClsTestClient()
-        cls.api_client = cloudstackTestClient.getApiClient()
-        cls.services = cloudstackTestClient.getConfigParser().parsedDict
+        testClient = super(TestTemplates, cls).getClsTestClient()
+        cls.apiclient = testClient.getApiClient()
+        cls.services = testClient.getParsedTestDataConfig()
 
         # Get Zone, Domain and templates
-        cls.domain = get_domain(cls.api_client, cls.services)
-        cls.zone = get_zone(cls.api_client, cls.services)
+        cls.domain = get_domain(cls.apiclient, cls.getZoneForTests())
+        cls.zone = get_zone(cls.apiclient, cls.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
         #populate second zone id for iso copy
         cmd = listZones.listZonesCmd()
-        cls.zones = cls.api_client.listZones(cmd)
+        cls.zones = cls.apiclient.listZones(cmd)
         if not isinstance(cls.zones, list):
             raise Exception("Failed to find zones.")
 
         cls.disk_offering = DiskOffering.create(
-                                    cls.api_client,
+                                    cls.apiclient,
                                     cls.services["disk_offering"]
                                     )
         template = get_template(
-                            cls.api_client,
+                            cls.apiclient,
                             cls.zone.id,
                             cls.services["ostype"]
                             )
+        if template == FAILED:
+            cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
+
         cls.services["virtual_machine"]["zoneid"] = cls.zone.id
         cls.services["volume"]["diskoffering"] = cls.disk_offering.id
         cls.services["volume"]["zoneid"] = cls.zone.id
@@ -256,14 +263,14 @@ class TestTemplates(cloudstackTestCase):
         cls.services["ostypeid"] = template.ostypeid
 
         cls.account = Account.create(
-                            cls.api_client,
+                            cls.apiclient,
                             cls.services["account"],
                             admin=True,
                             domainid=cls.domain.id
                             )
 
         cls.user = Account.create(
-                            cls.api_client,
+                            cls.apiclient,
                             cls.services["account"],
                             domainid=cls.domain.id
                             )
@@ -271,12 +278,12 @@ class TestTemplates(cloudstackTestCase):
         cls.services["account"] = cls.account.name
 
         cls.service_offering = ServiceOffering.create(
-                                            cls.api_client,
+                                            cls.apiclient,
                                             cls.services["service_offerings"]
                                         )
         #create virtual machine
         cls.virtual_machine = VirtualMachine.create(
-                                    cls.api_client,
+                                    cls.apiclient,
                                     cls.services["virtual_machine"],
                                     templateid=template.id,
                                     accountid=cls.account.name,
@@ -285,7 +292,7 @@ class TestTemplates(cloudstackTestCase):
                                     mode=cls.services["mode"]
                                     )
         #Stop virtual machine
-        cls.virtual_machine.stop(cls.api_client)
+        cls.virtual_machine.stop(cls.apiclient)
 
         # Poll listVM to ensure VM is stopped properly
         timeout = cls.services["timeout"]
@@ -294,7 +301,7 @@ class TestTemplates(cloudstackTestCase):
 
             # Ensure that VM is in stopped state
             list_vm_response = list_virtual_machines(
-                                            cls.api_client,
+                                            cls.apiclient,
                                             id=cls.virtual_machine.id
                                             )
 
@@ -312,7 +319,7 @@ class TestTemplates(cloudstackTestCase):
             timeout = timeout - 1
 
         list_volume = list_volumes(
-                                   cls.api_client,
+                                   cls.apiclient,
                                    virtualmachineid=cls.virtual_machine.id,
                                    type='ROOT',
                                    listall=True
@@ -326,14 +333,14 @@ class TestTemplates(cloudstackTestCase):
 
         #Create templates for Edit, Delete & update permissions testcases
         cls.template_1 = Template.create(
-                                         cls.api_client,
+                                         cls.apiclient,
                                          cls.services["template"],
                                          cls.volume.id,
                                          account=cls.account.name,
                                          domainid=cls.account.domainid
                                          )
         cls.template_2 = Template.create(
-                                         cls.api_client,
+                                         cls.apiclient,
                                          cls.services["template_2"],
                                          cls.volume.id,
                                          account=cls.account.name,
@@ -349,9 +356,9 @@ class TestTemplates(cloudstackTestCase):
     @classmethod
     def tearDownClass(cls):
         try:
-            cls.api_client = super(TestTemplates, cls).getClsTestClient().getApiClient()
+            cls.apiclient = super(TestTemplates, cls).getClsTestClient().getApiClient()
             #Cleanup created resources such as templates and VMs
-            cleanup_resources(cls.api_client, cls._cleanup)
+            cleanup_resources(cls.apiclient, cls._cleanup)
 
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7305063f/test/integration/smoke/test_vm_life_cycle.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py
index 9afcba5..0494672 100644
--- a/test/integration/smoke/test_vm_life_cycle.py
+++ b/test/integration/smoke/test_vm_life_cycle.py
@@ -18,6 +18,7 @@
 """
 #Import Local Modules
 import marvin
+from marvin.cloudstackTestClient import getZoneForTests
 from marvin.cloudstackTestCase import *
 from marvin.cloudstackAPI import *
 from marvin.integration.lib.utils import *
@@ -33,13 +34,13 @@ class TestDeployVM(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cloudstackTestClient = super(TestDeployVM, cls).getClsTestClient()
-        cls.api_client = cloudstackTestClient.getApiClient()
-        cls.services = cloudstackTestClient.getConfigParser().parsedDict
+        testClient = super(TestDeployVM, cls).getClsTestClient()
+        cls.apiclient = testClient.getApiClient()
+        cls.services = testClient.getParsedTestDataConfig()
 
         # Get Zone, Domain and templates
-        domain = get_domain(cls.apiclient, cls.services)
-        cls.zone = get_zone(cls.apiclient, cls.services)
+        domain = get_domain(cls.apiclient)
+        cls.zone = get_zone(cls.apiclient, cls.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
 
         #If local storage is enabled, alter the offerings to use localstorage
@@ -54,6 +55,9 @@ class TestDeployVM(cloudstackTestCase):
             cls.zone.id,
             cls.services["ostype"]
         )
+        if template == FAILED:
+            cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
+
         # Set Zones and disk offerings
         cls.services["small"]["zoneid"] = cls.zone.id
         cls.services["small"]["template"] = template.id
@@ -191,13 +195,13 @@ class TestVMLifeCycle(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cloudstackTestClient = super(TestVMLifeCycle, cls).getClsTestClient()
-        cls.api_client = cloudstackTestClient.getApiClient()
-        cls.services = cloudstackTestClient.getConfigParser().parsedDict
+        testClient = super(TestVMLifeCycle, cls).getClsTestClient()
+        cls.apiclient = testClient.getApiClient()
+        cls.services = testClient.getParsedTestDataConfig()
 
         # Get Zone, Domain and templates
-        domain = get_domain(cls.api_client, cls.services)
-        cls.zone = get_zone(cls.api_client, cls.services)
+        domain = get_domain(cls.apiclient)
+        cls.zone = get_zone(cls.apiclient, cls.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
 
         #if local storage is enabled, alter the offerings to use localstorage
@@ -208,10 +212,13 @@ class TestVMLifeCycle(cloudstackTestCase):
             cls.services["service_offerings"]["medium"]["storagetype"] = 'local'
 
         template = get_template(
-                            cls.api_client,
+                            cls.apiclient,
                             cls.zone.id,
                             cls.services["ostype"]
                             )
+        if template == FAILED:
+            cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
+
         # Set Zones and disk offerings
         cls.services["small"]["zoneid"] = cls.zone.id
         cls.services["small"]["template"] = template.id
@@ -222,23 +229,23 @@ class TestVMLifeCycle(cloudstackTestCase):
 
         # Create VMs, NAT Rules etc
         cls.account = Account.create(
-                            cls.api_client,
+                            cls.apiclient,
                             cls.services["account"],
                             domainid=domain.id
                             )
 
         cls.small_offering = ServiceOffering.create(
-                                    cls.api_client,
+                                    cls.apiclient,
                                     cls.services["service_offerings"]["small"]
                                     )
 
         cls.medium_offering = ServiceOffering.create(
-                                    cls.api_client,
+                                    cls.apiclient,
                                     cls.services["service_offerings"]["medium"]
                                     )
         #create small and large virtual machines
         cls.small_virtual_machine = VirtualMachine.create(
-                                        cls.api_client,
+                                        cls.apiclient,
                                         cls.services["small"],
                                         accountid=cls.account.name,
                                         domainid=cls.account.domainid,
@@ -246,7 +253,7 @@ class TestVMLifeCycle(cloudstackTestCase):
                                         mode=cls.services["mode"]
                                         )
         cls.medium_virtual_machine = VirtualMachine.create(
-                                       cls.api_client,
+                                       cls.apiclient,
                                        cls.services["medium"],
                                        accountid=cls.account.name,
                                        domainid=cls.account.domainid,
@@ -254,7 +261,7 @@ class TestVMLifeCycle(cloudstackTestCase):
                                        mode=cls.services["mode"]
                                     )
         cls.virtual_machine = VirtualMachine.create(
-                                        cls.api_client,
+                                        cls.apiclient,
                                         cls.services["small"],
                                         accountid=cls.account.name,
                                         domainid=cls.account.domainid,
@@ -269,8 +276,8 @@ class TestVMLifeCycle(cloudstackTestCase):
 
     @classmethod
     def tearDownClass(cls):
-        cls.api_client = super(TestVMLifeCycle, cls).getClsTestClient().getApiClient()
-        cleanup_resources(cls.api_client, cls._cleanup)
+        cls.apiclient = super(TestVMLifeCycle, cls).getClsTestClient().getApiClient()
+        cleanup_resources(cls.apiclient, cls._cleanup)
         return
 
     def setUp(self):
@@ -510,7 +517,7 @@ class TestVMLifeCycle(cloudstackTestCase):
 
         #deploy VM on target host
         self.vm_to_migrate = VirtualMachine.create(
-            self.api_client,
+            self.apiclient,
             self.services["small"],
             accountid=self.account.name,
             domainid=self.account.domainid,
@@ -523,7 +530,7 @@ class TestVMLifeCycle(cloudstackTestCase):
                                         migrate_host.id
                                         ))
 
-        self.vm_to_migrate.migrate(self.api_client, migrate_host.id)
+        self.vm_to_migrate.migrate(self.apiclient, migrate_host.id)
 
         list_vm_response = list_virtual_machines(
                                             self.apiclient,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7305063f/test/integration/smoke/test_vm_snapshots.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_vm_snapshots.py b/test/integration/smoke/test_vm_snapshots.py
index 7fc0b8f..617274c 100644
--- a/test/integration/smoke/test_vm_snapshots.py
+++ b/test/integration/smoke/test_vm_snapshots.py
@@ -17,6 +17,7 @@
 
 # Import Local Modules
 import marvin
+from marvin.cloudstackTestClient import getZoneForTests
 from nose.plugins.attrib import attr
 from marvin.cloudstackTestCase import *
 from marvin.cloudstackAPI import *
@@ -28,17 +29,20 @@ class TestVmSnapshot(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(TestVmSnapshot, cls).getClsTestClient().getApiClient()
+        cls.apiclient = super(TestVmSnapshot, cls).getClsTestClient().getApiClient()
         cls.services = Services().services
         # Get Zone, Domain and templates
-        cls.domain = get_domain(cls.api_client, cls.services)
-        cls.zone = get_zone(cls.api_client, cls.services)
+        cls.domain = get_domain(cls.apiclient)
+        cls.zone = get_zone(cls.apiclient, cls.getZoneForTests())
 
         template = get_template(
-                    cls.api_client,
+                    cls.apiclient,
                     cls.zone.id,
                     cls.services["ostype"]
                     )
+        if cls.template == FAILED:
+            cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
+
         cls.services["domainid"] = cls.domain.id
         cls.services["server"]["zoneid"] = cls.zone.id
         cls.services["templates"]["ostypeid"] = template.ostypeid
@@ -46,7 +50,7 @@ class TestVmSnapshot(cloudstackTestCase):
 
         # Create VMs, NAT Rules etc
         cls.account = Account.create(
-                    cls.api_client,
+                    cls.apiclient,
                     cls.services["account"],
                     domainid=cls.domain.id
                     )
@@ -54,11 +58,11 @@ class TestVmSnapshot(cloudstackTestCase):
         cls.services["account"] = cls.account.name
 
         cls.service_offering = ServiceOffering.create(
-                            cls.api_client,
+                            cls.apiclient,
                             cls.services["service_offerings"]
                             )
         cls.virtual_machine = VirtualMachine.create(
-                    cls.api_client,
+                    cls.apiclient,
                     cls.services["server"],
                     templateid=template.id,
                     accountid=cls.account.name,
@@ -79,7 +83,7 @@ class TestVmSnapshot(cloudstackTestCase):
     def tearDownClass(cls):
         try:
             # Cleanup resources used
-            cleanup_resources(cls.api_client, cls._cleanup)
+            cleanup_resources(cls.apiclient, cls._cleanup)
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
         return

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7305063f/test/integration/smoke/test_volumes.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py
index 7dee14c..860d989 100644
--- a/test/integration/smoke/test_volumes.py
+++ b/test/integration/smoke/test_volumes.py
@@ -18,6 +18,7 @@
 """
 #Import Local Modules
 import marvin
+from marvin.cloudstackTestClient import getZoneForTests
 from marvin.cloudstackTestCase import *
 from marvin.cloudstackException import *
 from marvin.cloudstackAPI import *
@@ -38,28 +39,31 @@ class TestCreateVolume(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cloudstackTestClient = super(TestCreateVolume, cls).getClsTestClient()
-        cls.api_client = cloudstackTestClient.getApiClient()
-        cls.services = cloudstackTestClient.getConfigParser().parsedDict
+        testClient = super(TestCreateVolume, cls).getClsTestClient()
+        cls.apiclient = testClient.getApiClient()
+        cls.services = testClient.getParsedTestDataConfig()
 
         # Get Zone, Domain and templates
-        cls.domain = get_domain(cls.api_client, cls.services)
-        cls.zone = get_zone(cls.api_client, cls.services)
+        cls.domain = get_domain(cls.apiclient)
+        cls.zone = get_zone(cls.apiclient, cls.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
         cls.disk_offering = DiskOffering.create(
-                                    cls.api_client,
+                                    cls.apiclient,
                                     cls.services["disk_offering"]
                                     )
         cls.custom_disk_offering = DiskOffering.create(
-                                    cls.api_client,
+                                    cls.apiclient,
                                     cls.services["disk_offering"],
                                     custom=True
                                     )
         template = get_template(
-                            cls.api_client,
+                            cls.apiclient,
                             cls.zone.id,
                             cls.services["ostype"]
                             )
+        if template == FAILED:
+            cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
+
         cls.services["domainid"] = cls.domain.id
         cls.services["zoneid"] = cls.zone.id
         cls.services["template"] = template.id
@@ -67,18 +71,18 @@ class TestCreateVolume(cloudstackTestCase):
 
         # Create VMs, NAT Rules etc
         cls.account = Account.create(
-                            cls.api_client,
+                            cls.apiclient,
                             cls.services["account"],
                             domainid=cls.domain.id
                             )
 
         cls.services["account"] = cls.account.name
         cls.service_offering = ServiceOffering.create(
-                                            cls.api_client,
+                                            cls.apiclient,
                                             cls.services["service_offerings"]
                                             )
         cls.virtual_machine = VirtualMachine.create(
-                                    cls.api_client,
+                                    cls.apiclient,
                                     cls.services,
                                     accountid=cls.account.name,
                                     domainid=cls.account.domainid,
@@ -218,8 +222,8 @@ class TestCreateVolume(cloudstackTestCase):
     @classmethod
     def tearDownClass(cls):
         try:
-            cls.api_client = super(TestCreateVolume, cls).getClsTestClient().getApiClient()
-            cleanup_resources(cls.api_client, cls._cleanup)
+            cls.apiclient = super(TestCreateVolume, cls).getClsTestClient().getApiClient()
+            cleanup_resources(cls.apiclient, cls._cleanup)
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
 
@@ -228,33 +232,36 @@ class TestVolumes(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cloudstackTestClient = super(TestVolumes, cls).getClsTestClient()
-        cls.api_client = cloudstackTestClient.getApiClient()
-        cls.services = cloudstackTestClient.getConfigParser().parsedDict
+        testClient = super(TestVolumes, cls).getClsTestClient()
+        cls.apiclient = testClient.getApiClient()
+        cls.services = testClient.getParsedTestDataConfig()
 
         # Get Zone, Domain and templates
-        cls.domain = get_domain(cls.api_client, cls.services)
-        cls.zone = get_zone(cls.api_client, cls.services)
+        cls.domain = get_domain(cls.apiclient)
+        cls.zone = get_zone(cls.apiclient, cls.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
         cls.disk_offering = DiskOffering.create(
-                                    cls.api_client,
+                                    cls.apiclient,
                                     cls.services["disk_offering"]
                                     )
         cls.resized_disk_offering = DiskOffering.create(
-                                    cls.api_client,
+                                    cls.apiclient,
                                     cls.services["resized_disk_offering"]
                                     )
         cls.custom_resized_disk_offering = DiskOffering.create(
-                                    cls.api_client,
+                                    cls.apiclient,
                                     cls.services["resized_disk_offering"],
                                     custom=True
                                     )
 
         template = get_template(
-                            cls.api_client,
+                            cls.apiclient,
                             cls.zone.id,
                             cls.services["ostype"]
                             )
+        if template == FAILED:
+            cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
+
         cls.services["domainid"] = cls.domain.id
         cls.services["zoneid"] = cls.zone.id
         cls.services["template"] = template.id
@@ -264,18 +271,18 @@ class TestVolumes(cloudstackTestCase):
 
         # Create VMs, VMs etc
         cls.account = Account.create(
-                            cls.api_client,
+                            cls.apiclient,
                             cls.services["account"],
                             domainid=cls.domain.id
                             )
 
         cls.services["account"] = cls.account.name
         cls.service_offering = ServiceOffering.create(
-                                            cls.api_client,
+                                            cls.apiclient,
                                             cls.services["service_offerings"]
                                         )
         cls.virtual_machine = VirtualMachine.create(
-                                    cls.api_client,
+                                    cls.apiclient,
                                     cls.services,
                                     accountid=cls.account.name,
                                     domainid=cls.account.domainid,
@@ -284,7 +291,7 @@ class TestVolumes(cloudstackTestCase):
                                 )
 
         cls.volume = Volume.create(
-                                   cls.api_client,
+                                   cls.apiclient,
                                    cls.services,
                                    account=cls.account.name,
                                    domainid=cls.account.domainid
@@ -301,7 +308,7 @@ class TestVolumes(cloudstackTestCase):
     @classmethod
     def tearDownClass(cls):
         try:
-            cleanup_resources(cls.api_client, cls._cleanup)
+            cleanup_resources(cls.apiclient, cls._cleanup)
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
 
@@ -649,7 +656,7 @@ class TestVolumes(cloudstackTestCase):
         self.debug("Delete Volume ID: %s" % self.volume.id)
 
         self.volume_1 = Volume.create(
-                                   self.api_client,
+                                   self.apiclient,
                                    self.services,
                                    account=self.account.name,
                                    domainid=self.account.domainid

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7305063f/test/integration/smoke/test_vpc_vpn.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_vpc_vpn.py b/test/integration/smoke/test_vpc_vpn.py
index d8e66d6..a117c6e 100644
--- a/test/integration/smoke/test_vpc_vpn.py
+++ b/test/integration/smoke/test_vpc_vpn.py
@@ -17,6 +17,7 @@
 """ Tests for VPN in VPC
 """
 #Import Local Modules
+from marvin.cloudstackTestClient import getZoneForTests
 from marvin.cloudstackTestCase import *
 from marvin.cloudstackAPI import *
 from marvin.integration.lib.utils import *
@@ -30,11 +31,11 @@ class TestVpcRemoteAccessVpn(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cloudstackTestClient = super(TestVpcRemoteAccessVpn, cls).getClsTestClient()
-        cls.api_client = cloudstackTestClient.getApiClient()
-        cls.services = cloudstackTestClient.getConfigParser().parsedDict
+        testClient = super(TestVpcRemoteAccessVpn, cls).getClsTestClient()
+        cls.apiclient = testClient.getApiClient()
+        cls.services = testClient.getParsedTestDataConfig()
 
-        cls.zone = get_zone(cls.apiclient, cls.services)
+        cls.zone = get_zone(cls.apiclient, cls.getZoneForTests())
         cls.domain = get_domain(cls.apiclient)
         cls.service_offering = ServiceOffering.create(
             cls.apiclient,
@@ -46,6 +47,9 @@ class TestVpcRemoteAccessVpn(cloudstackTestCase):
             cls.zone.id,
             cls.services["ostype"]
         )
+        if cls.template == FAILED:
+            cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
+
         cls.cleanup = [cls.account]
 
     @attr(tags=["advanced"])
@@ -134,11 +138,11 @@ class TestVpcSite2SiteVpn(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cloudstackTestClient = super(TestVpcSite2SiteVpn, cls).getClsTestClient()
-        cls.api_client = cloudstackTestClient.getApiClient()
-        cls.services = cloudstackTestClient.getConfigParser().parsedDict
+        testClient = super(TestVpcSite2SiteVpn, cls).getClsTestClient()
+        cls.apiclient = testClient.getApiClient()
+        cls.services = testClient.getParsedTestDataConfig()
 
-        cls.zone = get_zone(cls.apiclient, cls.services)
+        cls.zone = get_zone(cls.apiclient, cls.getZoneForTests())
         cls.domain = get_domain(cls.apiclient)
         cls.service_offering = ServiceOffering.create(
             cls.apiclient,
@@ -150,6 +154,9 @@ class TestVpcSite2SiteVpn(cloudstackTestCase):
             cls.zone.id,
             cls.services["ostype"]
         )
+        if cls.template == FAILED:
+            cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
+
         cls.cleanup = [cls.account]
 
     @attr(tags=["advanced"])

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7305063f/tools/marvin/marvin/integration/lib/common.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/common.py b/tools/marvin/marvin/integration/lib/common.py
index c16339b..e8cdfc1 100644
--- a/tools/marvin/marvin/integration/lib/common.py
+++ b/tools/marvin/marvin/integration/lib/common.py
@@ -214,13 +214,13 @@ def get_zone(apiclient, zone_name=None, zone_id=None):
 
 
 
-def get_pod(apiclient, pod_id=None, pod_name=None, zone_id=None):
+def get_pod(apiclient, zone_id=None, pod_id=None, pod_name=None):
     '''
     @name : get_pod
     @Desc :  Returns the Pod Information for a given zone id or Zone Name
-    @Input : pod_name : Name of the Pod
+    @Input : zone_id: Id of the Zone
+             pod_name : Name of the Pod
              pod_id : Id of the Pod
-             zone_id: Id of the Zone
     @Output : 1. Pod Information for the pod
               2. FAILED In case the cmd failed
     '''
@@ -239,9 +239,9 @@ def get_pod(apiclient, pod_id=None, pod_name=None, zone_id=None):
     return cmd_out
 
 
-def get_template(apiclient, template_id=None, template_name=None, account=None, template_type='BUILTIN'
-                 domain_id=None, zone_id=None, project_id=None,
-                 hypervisor=None, ostype_desc=None, template_filter="featured"):
+def get_template(apiclient, zone_id=None, ostype_desc=None, template_filter="featured", template_type='BUILTIN',
+                 template_id=None, template_name=None, account=None, domain_id=None, project_id=None,
+                 hypervisor=None):
     '''
     @Name : get_template
     @Desc : Retrieves the template Information based upon inputs provided


Mime
View raw message