cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gir...@apache.org
Subject [4/4] git commit: updated refs/heads/marvin to d70ef2a
Date Wed, 26 Feb 2014 11:43:48 GMT
CLOUDSTACK-5925: Changes to regression tests as per new get_zone, get_pod etc definitions


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d70ef2a2
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d70ef2a2
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d70ef2a2

Branch: refs/heads/marvin
Commit: d70ef2a279c9ed344ffb31fdd8276992aabea8f0
Parents: 4a0e95c
Author: Girish Shilamkar <girish@clogeny.com>
Authored: Wed Feb 26 17:13:21 2014 +0530
Committer: Girish Shilamkar <girish@clogeny.com>
Committed: Wed Feb 26 17:13:21 2014 +0530

----------------------------------------------------------------------
 .../maint/test_egress_rules_host_maintenance.py |  12 +-
 .../component/maint/test_high_availability.py   |  20 +--
 .../maint/test_host_high_availability.py        |  17 +--
 .../component/maint/test_multiple_ip_ranges.py  |  14 +-
 .../component/maint/test_redundant_router.py    |  55 ++++----
 ...test_redundant_router_deployment_planning.py |  11 +-
 .../test_redundant_router_network_rules.py      |  11 +-
 .../maint/test_vpc_host_maintenance.py          |  15 +-
 .../maint/test_vpc_on_host_maintenance.py       |  11 +-
 test/integration/component/test_accounts.py     | 141 +++++++++----------
 .../component/test_add_remove_network.py        |  60 +++++---
 .../component/test_advancedsg_networks.py       |  65 ++++-----
 .../component/test_affinity_groups.py           |  71 ++++++----
 .../component/test_allocation_states.py         |  17 ++-
 test/integration/component/test_asa1000v_fw.py  |  18 +--
 test/integration/component/test_assign_vm.py    |  13 +-
 test/integration/component/test_baremetal.py    |  28 ++--
 .../component/test_base_image_updation.py       |  16 +--
 test/integration/component/test_blocker_bugs.py |  69 ++++++---
 .../component/test_cpu_domain_limits.py         |  20 +--
 test/integration/component/test_cpu_limits.py   |  21 +--
 .../component/test_cpu_max_limits.py            |  11 +-
 .../component/test_cpu_project_limits.py        |   9 +-
 .../component/test_custom_hostname.py           |  38 ++---
 .../component/test_deploy_vm_userdata_reg.py    |   5 +-
 .../component/test_egress_fw_rules.py           |  13 +-
 test/integration/component/test_egress_rules.py | 120 +++++++---------
 test/integration/component/test_eip_elb.py      |  16 ++-
 .../component/test_explicit_dedication.py       |   9 +-
 test/integration/component/test_haproxy.py      |   9 +-
 .../component/test_implicit_planner.py          |   9 +-
 .../component/test_ip_reservation.py            |  10 +-
 .../integration/component/test_memory_limits.py |  18 +--
 .../component/test_mm_domain_limits.py          |  18 +--
 .../integration/component/test_mm_max_limits.py |   9 +-
 .../component/test_mm_project_limits.py         |   9 +-
 .../component/test_multiple_ip_ranges.py        |  22 +--
 .../component/test_netscaler_configs.py         | 110 +++++++--------
 test/integration/component/test_netscaler_lb.py | 110 +++++++--------
 .../component/test_netscaler_lb_algo.py         | 100 ++++++-------
 .../component/test_netscaler_lb_sticky.py       |  11 +-
 .../component/test_netscaler_nw_off.py          |  76 +++++-----
 .../component/test_network_offering.py          |  33 ++---
 .../component/test_non_contiguous_vlan.py       |  12 +-
 .../component/test_persistent_networks.py       |  10 +-
 test/integration/component/test_portable_ip.py  |  72 ++++++----
 .../component/test_project_configs.py           |  50 +++----
 .../component/test_project_limits.py            |  29 ++--
 .../component/test_project_resources.py         |  63 ++++-----
 .../integration/component/test_project_usage.py |  96 ++++++-------
 test/integration/component/test_projects.py     | 103 +++++---------
 .../component/test_recurring_snapshots.py       |  10 +-
 .../component/test_redundant_router_cleanups.py |  11 +-
 .../component/test_redundant_router_services.py |  11 +-
 .../component/test_redundant_router_upgrades.py |  11 +-
 test/integration/component/test_regions.py      |   2 +-
 .../component/test_regions_accounts.py          |   2 +-
 .../component/test_reset_ssh_keypair.py         |  18 ++-
 .../component/test_resource_limits.py           |  27 ++--
 test/integration/component/test_routers.py      |  32 +++--
 .../component/test_security_groups.py           |  53 +++----
 .../component/test_shared_networks.py           |  11 +-
 test/integration/component/test_snapshot_gc.py  |   8 +-
 .../component/test_snapshot_limits.py           |   8 +-
 test/integration/component/test_snapshots.py    |  24 ++--
 .../component/test_snapshots_improvement.py     |  20 +--
 test/integration/component/test_stopped_vm.py   |  88 ++++++------
 .../component/test_storage_motion.py            |   9 +-
 test/integration/component/test_tags.py         |  15 +-
 test/integration/component/test_templates.py    |  20 +--
 test/integration/component/test_update_vm.py    |   6 +-
 test/integration/component/test_usage.py        |  72 ++++++----
 .../component/test_vm_passwdenabled.py          |  12 +-
 test/integration/component/test_vmware_drs.py   |  55 +++-----
 test/integration/component/test_volumes.py      |  52 +++----
 test/integration/component/test_vpc.py          |  15 +-
 test/integration/component/test_vpc_network.py  |  48 +++----
 .../component/test_vpc_network_lbrules.py       |  11 +-
 .../component/test_vpc_network_pfrules.py       |  11 +-
 .../component/test_vpc_network_staticnatrule.py |  11 +-
 .../integration/component/test_vpc_offerings.py |  11 +-
 test/integration/component/test_vpc_routers.py  |  22 ++-
 .../component/test_vpc_vm_life_cycle.py         |  55 ++++----
 .../component/test_vpc_vms_deployment.py        |  11 +-
 test/integration/component/test_vpn_users.py    |  13 +-
 85 files changed, 1304 insertions(+), 1386 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/maint/test_egress_rules_host_maintenance.py
----------------------------------------------------------------------
diff --git a/test/integration/component/maint/test_egress_rules_host_maintenance.py b/test/integration/component/maint/test_egress_rules_host_maintenance.py
index 55d6125..5ec1223 100644
--- a/test/integration/component/maint/test_egress_rules_host_maintenance.py
+++ b/test/integration/component/maint/test_egress_rules_host_maintenance.py
@@ -100,15 +100,13 @@ class TestEgressAfterHostMaintenance(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.services = Services().services
-        cls.api_client = super(
-                               TestEgressAfterHostMaintenance,
-                               cls
-                               ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestEgressAfterHostMaintenance, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
         cls.pod = get_pod(
                           cls.api_client,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/maint/test_high_availability.py
----------------------------------------------------------------------
diff --git a/test/integration/component/maint/test_high_availability.py b/test/integration/component/maint/test_high_availability.py
index 55cd293..da2655b 100644
--- a/test/integration/component/maint/test_high_availability.py
+++ b/test/integration/component/maint/test_high_availability.py
@@ -107,24 +107,16 @@ class TestHighAvailability(cloudstackTestCase):
     @classmethod
     def setUpClass(cls):
 
-        cls.api_client = super(
-                               TestHighAvailability,
-                               cls
-                               ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestHighAvailability, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.pod = get_pod(
                           cls.api_client,
-                          zoneid=cls.zone.id,
-                          services=cls.services
+                          zoneid=cls.zone.id
                           )
         cls.template = get_template(
                                     cls.api_client,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/maint/test_host_high_availability.py
----------------------------------------------------------------------
diff --git a/test/integration/component/maint/test_host_high_availability.py b/test/integration/component/maint/test_host_high_availability.py
index 4f22887..f81bff2 100644
--- a/test/integration/component/maint/test_host_high_availability.py
+++ b/test/integration/component/maint/test_host_high_availability.py
@@ -76,20 +76,13 @@ class TestHostHighAvailability(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-            TestHostHighAvailability,
-            cls
-        ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestHostHighAvailability, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
 
         cls.template = get_template(
             cls.api_client,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/maint/test_multiple_ip_ranges.py
----------------------------------------------------------------------
diff --git a/test/integration/component/maint/test_multiple_ip_ranges.py b/test/integration/component/maint/test_multiple_ip_ranges.py
index cc89706..982dd7c 100644
--- a/test/integration/component/maint/test_multiple_ip_ranges.py
+++ b/test/integration/component/maint/test_multiple_ip_ranges.py
@@ -18,7 +18,7 @@
 """
 from marvin.cloudstackTestCase import *
 from marvin.cloudstackAPI import *
-from marvin.cloudstackException import cloudstackAPIException
+from marvin.cloudstackException import CloudstackAPIException
 from marvin.lib.utils import *
 from marvin.lib.base import *
 from marvin.lib.common import *
@@ -87,13 +87,15 @@ class TestMultipleIpRanges(cloudstackTestCase):
     """
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(TestMultipleIpRanges, cls).getClsTestClient().getApiClient()
-        cls.dbclient = super(TestMultipleIpRanges, cls).getClsTestClient().getDbConnection()
+        cls.testClient = super(TestEgressAfterHostMaintenance, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+        cls.dbclient = cls.testClient.getDbConnection()
+
         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.pod = get_pod(cls.api_client, cls.zone.id, cls.services)
+        cls.domain = get_domain(cls.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
+        cls.pod = get_pod(cls.api_client, cls.zone.id)
         cls.services['mode'] = cls.zone.networktype
         cls.services["domainid"] = cls.domain.id
         cls.services["zoneid"] = cls.zone.id

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/maint/test_redundant_router.py
----------------------------------------------------------------------
diff --git a/test/integration/component/maint/test_redundant_router.py b/test/integration/component/maint/test_redundant_router.py
index 245ce37..66bb477 100644
--- a/test/integration/component/maint/test_redundant_router.py
+++ b/test/integration/component/maint/test_redundant_router.py
@@ -137,14 +137,13 @@ class TestCreateRvRNetworkOffering(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestCreateRvRNetworkOffering,
-                               cls
-                               ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestCreateRvRNetworkOffering, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls._cleanup = []
         return
 
@@ -231,14 +230,13 @@ class TestCreateRvRNetwork(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestCreateRvRNetwork,
-                               cls
-                               ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestCreateRvRNetwork, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.template = get_template(
                             cls.api_client,
                             cls.zone.id,
@@ -433,14 +431,13 @@ class TestCreateRvRNetworkNonDefaultGuestCidr(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestCreateRvRNetworkNonDefaultGuestCidr,
-                               cls
-                               ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestCreateRvRNetworkNonDefaultGuestCidr, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.template = get_template(
                             cls.api_client,
                             cls.zone.id,
@@ -642,14 +639,13 @@ class TestRVRInternals(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestRVRInternals,
-                               cls
-                               ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestRVRInternals, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.template = get_template(
                             cls.api_client,
                             cls.zone.id,
@@ -946,14 +942,13 @@ class TestRvRRedundancy(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestRvRRedundancy,
-                               cls
-                               ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestRvRRedundancy, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.template = get_template(
                             cls.api_client,
                             cls.zone.id,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/maint/test_redundant_router_deployment_planning.py
----------------------------------------------------------------------
diff --git a/test/integration/component/maint/test_redundant_router_deployment_planning.py b/test/integration/component/maint/test_redundant_router_deployment_planning.py
index 2801b39..b63cda9 100644
--- a/test/integration/component/maint/test_redundant_router_deployment_planning.py
+++ b/test/integration/component/maint/test_redundant_router_deployment_planning.py
@@ -136,14 +136,13 @@ class TestRvRDeploymentPlanning(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestRvRDeploymentPlanning,
-                               cls
-                               ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestRvRDeploymentPlanning, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.template = get_template(
                             cls.api_client,
                             cls.zone.id,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/maint/test_redundant_router_network_rules.py
----------------------------------------------------------------------
diff --git a/test/integration/component/maint/test_redundant_router_network_rules.py b/test/integration/component/maint/test_redundant_router_network_rules.py
index f49a118..12c4d2c 100644
--- a/test/integration/component/maint/test_redundant_router_network_rules.py
+++ b/test/integration/component/maint/test_redundant_router_network_rules.py
@@ -137,14 +137,13 @@ class TestRedundantRouterRulesLifeCycle(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestRedundantRouterRulesLifeCycle,
-                               cls
-                               ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestRedundantRouterRulesLifeCycle, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.template = get_template(
                             cls.api_client,
                             cls.zone.id,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/maint/test_vpc_host_maintenance.py
----------------------------------------------------------------------
diff --git a/test/integration/component/maint/test_vpc_host_maintenance.py b/test/integration/component/maint/test_vpc_host_maintenance.py
index 5c18de8..83ba271 100644
--- a/test/integration/component/maint/test_vpc_host_maintenance.py
+++ b/test/integration/component/maint/test_vpc_host_maintenance.py
@@ -25,8 +25,6 @@ from marvin.cloudstackAPI import *
 from marvin.lib.utils import *
 from marvin.lib.base import *
 from marvin.lib.common import *
-from marvin.sshClient import SshClient
-import datetime
 
 
 class Services:
@@ -190,14 +188,13 @@ class TestVMLifeCycleHostmaintenance(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestVMLifeCycleHostmaintenance,
-                               cls
-                               ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestVMLifeCycleHostmaintenance, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.template = get_template(
                             cls.api_client,
                             cls.zone.id,
@@ -554,4 +551,4 @@ class TestVMLifeCycleHostmaintenance(cloudstackTestCase):
                          "Router state should be running"
                          )
         #  TODO: Check for the network connectivity
-        return
\ No newline at end of file
+        return

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/maint/test_vpc_on_host_maintenance.py
----------------------------------------------------------------------
diff --git a/test/integration/component/maint/test_vpc_on_host_maintenance.py b/test/integration/component/maint/test_vpc_on_host_maintenance.py
index 3a2f7f5..eb3360a 100644
--- a/test/integration/component/maint/test_vpc_on_host_maintenance.py
+++ b/test/integration/component/maint/test_vpc_on_host_maintenance.py
@@ -77,14 +77,13 @@ class TestVPCHostMaintenance(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-            TestVPCHostMaintenance,
-            cls
-        ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestVPCHostMaintenance, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.template = get_template(
             cls.api_client,
             cls.zone.id,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/test_accounts.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_accounts.py b/test/integration/component/test_accounts.py
index b478ab8..7390463 100644
--- a/test/integration/component/test_accounts.py
+++ b/test/integration/component/test_accounts.py
@@ -17,14 +17,32 @@
 """ P1 tests for Account
 """
 #Import Local Modules
-from marvin.cloudstackTestCase import *
-from marvin.cloudstackAPI import *
-from marvin.lib.utils import *
-from marvin.lib.base import *
-from marvin.lib.common import *
-from marvin.sshClient import SshClient
+from marvin.cloudstackTestCase import cloudstackTestCase
+#from marvin.cloudstackAPI import *
+from marvin.lib.utils import (random_gen,
+                              cleanup_resources)
+from marvin.lib.base import (Domain,
+                             Account,
+                             ServiceOffering,
+                             VirtualMachine,
+                             Network,
+                             User,
+                             NATRule,
+                             Template,
+                             PublicIPAddress)
+from marvin.lib.common import (get_domain,
+                               get_zone,
+                               get_template,
+                               list_accounts,
+                               list_virtual_machines,
+                               list_service_offering,
+                               list_templates,
+                               list_users,
+                               get_builtin_template_info,
+                               wait_for_cleanup)
 from nose.plugins.attrib import attr
-from marvin.cloudstackException import cloudstackAPIException
+from marvin.cloudstackException import CloudstackAPIException
+import time
 
 class Services:
     """Test Account Services
@@ -102,13 +120,11 @@ class TestAccounts(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestAccounts,
-                               cls
-                               ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestAccounts, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
         cls.services = Services().services
-        # Get Zone, Domain and templates
-        cls.zone = get_zone(cls.api_client, cls.services)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
         cls.template = get_template(
                             cls.api_client,
@@ -232,13 +248,11 @@ class TestRemoveUserFromAccount(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestRemoveUserFromAccount,
-                               cls
-                               ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestRemoveUserFromAccount, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
         cls.services = Services().services
-        # Get Zone, Domain and templates
-        cls.zone = get_zone(cls.api_client, cls.services)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
         cls.template = get_template(
                             cls.api_client,
@@ -392,13 +406,11 @@ class TestNonRootAdminsPrivileges(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestNonRootAdminsPrivileges,
-                               cls
-                               ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestNonRootAdminsPrivileges, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
         cls.services = Services().services
-        # Get Zone settings
-        cls.zone = get_zone(cls.api_client, cls.services)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
         # Create an account, domain etc
         cls.domain = Domain.create(
@@ -726,15 +738,12 @@ class TestTemplateHierarchy(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestTemplateHierarchy,
-                               cls).getClsTestClient().getApiClient()
-        cls.hypervisor = super(
-                               TestTemplateHierarchy,
-                               cls).getClsTestClient().getHypervisorInfo()
+        cls.testClient = super(TestTemplateHierarchy, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+        cls.hypervisor = cls.testClient.getHypervisorInfo()
+
         cls.services = Services().services
-        # Get Zone settings
-        cls.zone = get_zone(cls.api_client, cls.services)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype 
 
         # Create domains, accounts and template
@@ -883,21 +892,12 @@ class TestAddVmToSubDomain(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestAddVmToSubDomain,
-                               cls
-                               ).getClsTestClient().getApiClient()
-        cls.services = Services().services
+        cls.testClient = super(TestAddVmToSubDomain, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
 
-        # Setup working Environment- Create domain, zone, pod cluster etc.
-        cls.domain = get_domain(
-                                   cls.api_client,
-                                   cls.services
-                                   )
-        cls.zone = get_zone(
-                               cls.api_client,
-                               cls.services,
-                               )
+        cls.services = Services().services
+        cls.domain = get_domain(cls.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
         cls.sub_domain = Domain.create(
                                    cls.api_client,
@@ -1035,14 +1035,12 @@ class TestUserDetails(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestUserDetails,
-                               cls
-                               ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestUserDetails, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
         cls.services = Services().services
-        # Get Zone, Domain etc
-        cls.domain = get_domain(cls.api_client, cls.services)
-        cls.zone = get_zone(cls.api_client, cls.services)
+        cls.domain = get_domain(cls.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
         cls._cleanup = []
         return
@@ -1335,14 +1333,12 @@ class TestUserLogin(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestUserLogin,
-                               cls
-                               ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestUserLogin, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
         cls.services = Services().services
-        # Get Zone, Domain etc
-        cls.domain = get_domain(cls.api_client, cls.services)
-        cls.zone = get_zone(cls.api_client, cls.services)
+        cls.domain = get_domain(cls.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
         cls._cleanup = []
         return
@@ -1486,21 +1482,12 @@ class TestDomainForceRemove(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestDomainForceRemove,
-                               cls
-                               ).getClsTestClient().getApiClient()
-        cls.services = Services().services
+        cls.testClient = super(TestDomainForceRemove, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
 
-        # Setup working Environment- Create domain, zone, pod cluster etc.
-        cls.domain = get_domain(
-                                   cls.api_client,
-                                   cls.services
-                                   )
-        cls.zone = get_zone(
-                               cls.api_client,
-                               cls.services,
-                               )
+        cls.services = Services().services
+        cls.domain = get_domain(cls.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
 
         cls.template = get_template(
@@ -1685,7 +1672,7 @@ class TestDomainForceRemove(cloudstackTestCase):
                 " to cleanup any remaining resouces")
             # Sleep 3*account.gc to ensure that all resources are deleted
             wait_for_cleanup(self.apiclient, ["account.cleanup.interval"]*3)
-            with self.assertRaises(cloudstackAPIException):
+            with self.assertRaises(CloudstackAPIException):
                 Domain.list(
                         self.apiclient,
                         id=domain.id,
@@ -1693,7 +1680,7 @@ class TestDomainForceRemove(cloudstackTestCase):
                         )
 
         self.debug("Checking if the resources in domain are deleted")
-        with self.assertRaises(cloudstackAPIException):
+        with self.assertRaises(CloudstackAPIException):
             Account.list(
                         self.apiclient,
                         name=self.account_1.name,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/test_add_remove_network.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_add_remove_network.py b/test/integration/component/test_add_remove_network.py
index b96d8d3..3e0e78b 100644
--- a/test/integration/component/test_add_remove_network.py
+++ b/test/integration/component/test_add_remove_network.py
@@ -60,6 +60,7 @@ from marvin.cloudstackAPI import (addNicToVirtualMachine,
 
 from marvin.codes import PASS
 import random
+import time
 
 class Services:
     """Test Add Remove Network Services
@@ -173,7 +174,10 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(TestAddNetworkToVirtualMachine, cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestAddNetworkToVirtualMachine, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
+        cls.services = Services().services
 
         hypervisor = get_hypervisor_type(cls.api_client)
         if hypervisor.lower() not in ["xenserver","kvm"]:
@@ -181,8 +185,8 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase):
 
         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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
 
         template = get_template(cls.api_client, cls.zone.id, cls.services["ostype"])
         # Set Zones and disk offerings
@@ -689,16 +693,18 @@ class TestRemoveNetworkFromVirtualMachine(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(TestRemoveNetworkFromVirtualMachine, cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestRemoveNetworkFromVirtualMachine, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
+        cls.services = Services().services
 
         hypervisor = get_hypervisor_type(cls.api_client)
         if hypervisor.lower() not in ["xenserver","kvm"]:
             raise unittest.SkipTest("This feature is supported only on XenServer and KVM")
 
-        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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
 
         template = get_template(cls.api_client,cls.zone.id,cls.services["ostype"])
         # Set Zones and disk offerings
@@ -869,16 +875,18 @@ class TestUpdateVirtualMachineNIC(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(TestUpdateVirtualMachineNIC, cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestUpdateVirtualMachineNIC, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
+        cls.services = Services().services
 
         hypervisor = get_hypervisor_type(cls.api_client)
         if hypervisor.lower() not in ["xenserver","kvm"]:
             raise unittest.SkipTest("This feature is supported only on XenServer and KVM")
 
-        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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
 
         template = get_template(cls.api_client,cls.zone.id,cls.services["ostype"])
         # Set Zones and disk offerings
@@ -1083,16 +1091,18 @@ class TestFailureScenariosAddNetworkToVM(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(TestFailureScenariosAddNetworkToVM, cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestFailureScenariosAddNetworkToVM, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
+        cls.services = Services().services
 
         hypervisor = get_hypervisor_type(cls.api_client)
         if hypervisor.lower() not in ["xenserver","kvm"]:
             raise unittest.SkipTest("This feature is supported only on XenServer and KVM")
 
-        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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         template = get_template(cls.api_client,cls.zone.id,cls.services["ostype"])
         # Set Zones and disk offerings
         cls.services["virtual_machine"]["zoneid"] = cls.zone.id
@@ -1315,16 +1325,18 @@ class TestFailureScenariosRemoveNicFromVM(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(TestFailureScenariosRemoveNicFromVM, cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestFailureScenariosRemoveNicFromVM, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
+        cls.services = Services().services
 
         hypervisor = get_hypervisor_type(cls.api_client)
         if hypervisor.lower() not in ["xenserver","kvm"]:
             raise unittest.SkipTest("This feature is supported only on XenServer and KVM")
 
-        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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
 
         template = get_template(cls.api_client,cls.zone.id,cls.services["ostype"])
         # Set Zones and disk offerings
@@ -1493,16 +1505,18 @@ class TestFailureScenariosUpdateVirtualMachineNIC(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(TestFailureScenariosUpdateVirtualMachineNIC, cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestFailureScenariosUpdateVirtualMachineNIC, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
+        cls.services = Services().services
 
         hypervisor = get_hypervisor_type(cls.api_client)
         if hypervisor.lower() not in ["xenserver","kvm"]:
             raise unittest.SkipTest("This feature is supported only on XenServer and KVM")
 
-        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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
 
         template = get_template(cls.api_client, cls.zone.id, cls.services["ostype"])
         # Set Zones and disk offerings

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/test_advancedsg_networks.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_advancedsg_networks.py b/test/integration/component/test_advancedsg_networks.py
index d2ea499..f9155ed 100644
--- a/test/integration/component/test_advancedsg_networks.py
+++ b/test/integration/component/test_advancedsg_networks.py
@@ -54,14 +54,12 @@ class TestCreateZoneSG(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cloudstackTestClient = super(TestCreateZoneSG,cls).getClsTestClient()
-        cls.api_client = cloudstackTestClient.getApiClient()
-
-        # Fill services from the external config file
-        cls.services = cloudstackTestClient.getConfigParser().parsedDict
+        cls.testClient = super(TestCreateZoneSG, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
 
+        cls.services = cls.testClient.getParsedTestDataConfig()
         # Get Zone, Domain and templates
-        cls.domain = get_domain(cls.api_client, cls.services)
+        cls.domain = get_domain(cls.api_client)
 
         cls._cleanup = []
         return
@@ -154,14 +152,13 @@ class TestNetworksInAdvancedSG(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cloudstackTestClient = super(TestNetworksInAdvancedSG,cls).getClsTestClient()
-        cls.api_client = cloudstackTestClient.getApiClient()
-
-        cls.services = cloudstackTestClient.getConfigParser().parsedDict
+        cls.testClient = super(TestNetworksInAdvancedSG, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
 
+        cls.services = cls.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.template = get_template(cls.api_client, cls.zone.id,
                                     cls.services["ostype"])
 
@@ -1102,14 +1099,13 @@ class TestNetworksInAdvancedSG_VmOperations(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cloudstackTestClient = super(TestNetworksInAdvancedSG_VmOperations,cls).getClsTestClient()
-        cls.api_client = cloudstackTestClient.getApiClient()
-
-        cls.services = cloudstackTestClient.getConfigParser().parsedDict
+        cls.testClient = super(TestNetworksInAdvancedSG_VmOperations, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+        cls.services = cls.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.template = get_template(cls.api_client,cls.zone.id,cls.services["ostype"])
 
         cls.services["virtual_machine"]["zoneid"] = cls.zone.id
@@ -2086,14 +2082,13 @@ class TestSecurityGroups_BasicSanity(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cloudstackTestClient = super(TestSecurityGroups_BasicSanity,cls).getClsTestClient()
-        cls.api_client = cloudstackTestClient.getApiClient()
-
-        cls.services = cloudstackTestClient.getConfigParser().parsedDict
+        cls.testClient = super(TestSecurityGroups_BasicSanity, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+        cls.services = cls.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.template = get_template(cls.api_client,cls.zone.id,cls.services["ostype"])
 
         cls.services["virtual_machine"]["zoneid"] = cls.zone.id
@@ -2548,14 +2543,13 @@ class TestSharedNetworkOperations(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cloudstackTestClient = super(TestSharedNetworkOperations,cls).getClsTestClient()
-        cls.api_client = cloudstackTestClient.getApiClient()
-
-        cls.services = cloudstackTestClient.getConfigParser().parsedDict
+        cls.testClient = super(TestSharedNetworkOperations, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+        cls.services = cls.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.template = get_template(cls.api_client,cls.zone.id,cls.services["ostype"])
 
         cls.services["virtual_machine"]["zoneid"] = cls.zone.id
@@ -2815,14 +2809,13 @@ class TestAccountBasedIngressRules(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cloudstackTestClient = super(TestAccountBasedIngressRules,cls).getClsTestClient()
-        cls.api_client = cloudstackTestClient.getApiClient()
-
-        cls.services = cloudstackTestClient.getConfigParser().parsedDict
+        cls.testClient = super(TestAccountBasedIngressRules, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+        cls.services = cls.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.template = get_template(cls.api_client,cls.zone.id,cls.services["ostype"])
 
         cls.services["virtual_machine"]["zoneid"] = cls.zone.id

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/test_affinity_groups.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_affinity_groups.py b/test/integration/component/test_affinity_groups.py
index e5d8028..62400c6 100644
--- a/test/integration/component/test_affinity_groups.py
+++ b/test/integration/component/test_affinity_groups.py
@@ -15,12 +15,20 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-from marvin.cloudstackTestCase import *
-from marvin.cloudstackAPI import *
-from marvin.lib.utils import *
-from marvin.lib.base import *
-from marvin.lib.common import *
-from marvin.sshClient import SshClient
+from marvin.cloudstackTestCase import cloudstackTestCase, unittest
+from marvin.cloudstackAPI import deleteAffinityGroup
+from marvin.lib.utils import (cleanup_resources,
+                              random_gen)
+from marvin.lib.base import (Account,
+                             ServiceOffering,
+                             VirtualMachine,
+                             AffinityGroup,
+                             Domain)
+from marvin.lib.common import (get_zone,
+                               get_domain,
+                               get_template,
+                               list_virtual_machines,
+                               wait_for_cleanup)
 from nose.plugins.attrib import attr
 
 class Services:
@@ -89,12 +97,12 @@ class TestCreateAffinityGroup(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-
-        cls.api_client = super(TestCreateAffinityGroup, cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestCreateAffinityGroup, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.template = get_template(
             cls.api_client,
             cls.zone.id,
@@ -283,12 +291,14 @@ class TestListAffinityGroups(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
+        cls.testClient = super(TestListAffinityGroups, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
 
-        cls.api_client = super(TestListAffinityGroups, 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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
+
         cls.template = get_template(
             cls.api_client,
             cls.zone.id,
@@ -530,11 +540,14 @@ class TestDeleteAffinityGroups(cloudstackTestCase):
     @classmethod
     def setUpClass(cls):
 
-        cls.api_client = super(TestDeleteAffinityGroups, cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestDeleteAffinityGroups, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
+
         cls.template = get_template(
             cls.api_client,
             cls.zone.id,
@@ -800,11 +813,14 @@ class TestUpdateVMAffinityGroups(cloudstackTestCase):
     @classmethod
     def setUpClass(cls):
 
-        cls.api_client = super(TestUpdateVMAffinityGroups, cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestUpdateVMAffinityGroups, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
+
         cls.template = get_template(
             cls.api_client,
             cls.zone.id,
@@ -1084,11 +1100,14 @@ class TestDeployVMAffinityGroups(cloudstackTestCase):
     @classmethod
     def setUpClass(cls):
 
-        cls.api_client = super(TestDeployVMAffinityGroups, cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestDeployVMAffinityGroups, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
+
         cls.template = get_template(
             cls.api_client,
             cls.zone.id,
@@ -1432,11 +1451,13 @@ class TestAffinityGroupsAdminUser(cloudstackTestCase):
     @classmethod
     def setUpClass(cls):
 
-        cls.api_client = super(TestAffinityGroupsAdminUser, cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestAffinityGroupsAdminUser, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.template = get_template(
             cls.api_client,
             cls.zone.id,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/test_allocation_states.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_allocation_states.py b/test/integration/component/test_allocation_states.py
index 2da0f7b..e7e7863 100644
--- a/test/integration/component/test_allocation_states.py
+++ b/test/integration/component/test_allocation_states.py
@@ -15,16 +15,15 @@
 # specific language governing permissions and limitations
 # under the License.
 
-import marvin
 from nose.plugins.attrib import attr
-from marvin.cloudstackTestCase import *
-from marvin.cloudstackAPI import *
-from marvin.lib.utils import *
-from marvin.lib.base import *
-from marvin.lib.common import *
-from nose.plugins.attrib import attr
-import datetime
-
+from marvin.cloudstackTestCase import cloudstackTestCase
+from marvin.lib.utils import cleanup_resources
+from marvin.lib.base import (Host,
+                             Pod,
+                             Zone,
+                             Cluster,
+                             StoragePool)
+from marvin.lib.common import get_zone
 
 class Services:
     """Test Resource Limits Services

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/test_asa1000v_fw.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_asa1000v_fw.py b/test/integration/component/test_asa1000v_fw.py
index e913c76..43d06d1 100644
--- a/test/integration/component/test_asa1000v_fw.py
+++ b/test/integration/component/test_asa1000v_fw.py
@@ -18,15 +18,15 @@
 """ Cisco ASA1000v external firewall
 """
 #Import Local Modules
-import marvin
 from nose.plugins.attrib import attr
-from marvin.cloudstackTestCase import *
-from marvin.cloudstackAPI import *
-from marvin.lib.utils import *
-from marvin.lib.base import *
-from marvin.lib.common import *
-from marvin.sshClient import SshClient
-import datetime
+from marvin.cloudstackTestCase import cloudstackTestCase
+from marvin.lib.utils import cleanup_resources
+from marvin.lib.base import (NetworkOffering,
+                             PhysicalNetwork,
+                             VNMC,
+                             ASA1000V,
+                             Cluster)
+from marvin.lib.common import get_zone
 
 
 class Services:
@@ -101,7 +101,7 @@ class TestASASetup(cloudstackTestCase):
         self.apiclient = self.testClient.getApiClient()
         self.dbclient = self.testClient.getDbConnection()
 
-        self.zone = get_zone(self.apiclient, self.services)
+        self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests())
         self.physicalnetworks = PhysicalNetwork.list(self.apiclient, zoneid=self.zone.id)
         self.assertNotEqual(len(self.physicalnetworks), 0, "Check if the list physical network API returns a non-empty response")
         self.clusters = Cluster.list(self.apiclient, hypervisor='VMware')

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/test_assign_vm.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_assign_vm.py b/test/integration/component/test_assign_vm.py
index 5de8dad..0429fa4 100644
--- a/test/integration/component/test_assign_vm.py
+++ b/test/integration/component/test_assign_vm.py
@@ -98,12 +98,13 @@ class TestVMOwnership(cloudstackTestCase):
     @classmethod
     def setUpClass(cls):
         cls._cleanup = []
-        cls.api_client = super(TestVMOwnership,
-                               cls).getClsTestClient().getApiClient()
-        cls.services  = Services().services
-        # Get Zone  Domain and create Domains and sub Domains.
-        cls.domain           = get_domain(cls.api_client, cls.services)
-        cls.zone             = get_zone(cls.api_client, cls.services)
+        cls.testClient = super(TestVMOwnership, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
+        cls.services = Services().services
+        # Get Zone, Domain and templates
+        cls.domain = get_domain(cls.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
         # Get and set template id for VM creation.
         cls.template = get_template(cls.api_client,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/test_baremetal.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_baremetal.py b/test/integration/component/test_baremetal.py
index 886b18c..6ab9146 100644
--- a/test/integration/component/test_baremetal.py
+++ b/test/integration/component/test_baremetal.py
@@ -17,18 +17,18 @@
 """ Test for baremetal
 """
 #Import Local Modules
-import marvin
-from marvin.cloudstackTestCase import *
-from marvin.cloudstackAPI import *
-from marvin.sshClient import SshClient
-from marvin.lib.utils import *
-from marvin.lib.base import *
-from marvin.lib.common import *
+from marvin.cloudstackTestCase import cloudstackTestCase
+from marvin.cloudstackAPI import createVlanIpRange
+from marvin.lib.utils import cleanup_resources
+from marvin.lib.base import (NetworkOffering,
+                             NetworkServiceProvider,
+                             PhysicalNetwork,
+                             Network,
+                             Pod)
+#from marvin.lib.common import *
 from nose.plugins.attrib import attr
-import telnetlib
 
 #Import System modules
-import time
 _multiprocess_shared_ = True
 
 class Services:
@@ -89,19 +89,19 @@ class TestBaremetal(cloudstackTestCase):
         
         physical_network = PhysicalNetwork.list(self.apiclient, zoneid=self.zoneid)[0];
         dhcp_provider = NetworkServiceProvider.list(self.apiclient, name="BaremetalDhcpProvider", physical_network_id=physical_network.id)[0]
-        response = NetworkServiceProvider.update(
+        NetworkServiceProvider.update(
                                           self.apiclient,
                                           id=dhcp_provider.id,
                                           state='Enabled'
                                           )
         pxe_provider = NetworkServiceProvider.list(self.apiclient, name="BaremetalPxeProvider", physical_network_id=physical_network.id)[0]
-        response = NetworkServiceProvider.update(
+        NetworkServiceProvider.update(
                                           self.apiclient,
                                           id=pxe_provider.id,
                                           state='Enabled'
                                           )
         userdata_provider = NetworkServiceProvider.list(self.apiclient, name="BaremetalUserdataProvider", physical_network_id=physical_network.id)[0]
-        response = NetworkServiceProvider.update(
+        NetworkServiceProvider.update(
                                           self.apiclient,
                                           id=userdata_provider.id,
                                           state='Enabled'
@@ -119,5 +119,5 @@ class TestBaremetal(cloudstackTestCase):
         cmd.startip = "10.1.1.20"
         cmd.endip = "10.1.1.40"
         cmd.forVirtualNetwork="false"
-        response = self.apiclient.createVlanIpRange(cmd)
-        
\ No newline at end of file
+        self.apiclient.createVlanIpRange(cmd)
+        

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/test_base_image_updation.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_base_image_updation.py b/test/integration/component/test_base_image_updation.py
index c663fe0..28ac88b 100644
--- a/test/integration/component/test_base_image_updation.py
+++ b/test/integration/component/test_base_image_updation.py
@@ -25,11 +25,10 @@
 """
 
 #Import Local Modules
-import marvin
 from marvin.codes import (PASS,
                           RECURRING)
 from nose.plugins.attrib import attr
-from marvin.cloudstackTestCase import cloudstackTestCase, unittest
+from marvin.cloudstackTestCase import cloudstackTestCase
 
 from marvin.lib.base import (ServiceOffering,
                                          Account,
@@ -51,7 +50,6 @@ from marvin.lib.utils import (validateList,
                                           cleanup_resources)
 
 import time
-from datetime import datetime, timedelta
 
 class Services:
     """Test Base Image Updation
@@ -150,14 +148,14 @@ class TestBaseImageUpdate(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestBaseImageUpdate,
-                               cls
-                               ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestBaseImageUpdate, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
+
         cls.template = get_template(
                             cls.api_client,
                             cls.zone.id,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/test_blocker_bugs.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_blocker_bugs.py b/test/integration/component/test_blocker_bugs.py
index d00218e..f5f00bb 100644
--- a/test/integration/component/test_blocker_bugs.py
+++ b/test/integration/component/test_blocker_bugs.py
@@ -16,15 +16,29 @@
 # under the License.
 """ Tests for Blocker bugs
 """
-import marvin
 from nose.plugins.attrib import attr
-from marvin.lib.base import *
-from marvin.lib.utils import *
-from marvin.lib.common import *
+from marvin.lib.base import (Snapshot,
+                             Template,
+                             Domain,
+                             Account,
+                             ServiceOffering,
+                             Network,
+                             VirtualMachine,
+                             PublicIPAddress,
+                             StaticNATRule,
+                             FireWallRule,
+                             Volume)
+from marvin.lib.utils import cleanup_resources
+from marvin.lib.common import (get_zone,
+                               get_domain,
+                               get_template,
+                               list_routers,
+                               get_builtin_template_info)
 
 #Import Local Modules
-from marvin.cloudstackTestCase import *
-from marvin.cloudstackAPI import *
+from marvin.cloudstackTestCase import cloudstackTestCase
+from marvin.cloudstackAPI import restartNetwork
+import time
 
 
 class Services:
@@ -110,12 +124,13 @@ class TestTemplate(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.services = Services().services
-        cls.api_client = super(TestTemplate, cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestTemplate, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
         cls.services["virtual_machine"]["zoneid"] = cls.zone.id
         cls.services["template"]["zoneid"] = cls.zone.id
@@ -243,12 +258,14 @@ class TestNATRules(cloudstackTestCase):
     @classmethod
     def setUpClass(cls):
 
-        cls.api_client = super(TestNATRules, cls).getClsTestClient().getApiClient()
-        cls.services = Services().services
+        cls.testClient = super(TestNATRules, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
+
         cls.services['mode'] = cls.zone.networktype
         template = get_template(
                             cls.api_client,
@@ -449,10 +466,12 @@ class TestRouters(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(TestRouters, cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestRouters, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
         cls.services = Services().services
         # Get Zone, Domain and templates
-        cls.zone = get_zone(cls.api_client, cls.services)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
         cls.template = get_template(
                             cls.api_client,
@@ -574,11 +593,13 @@ class TestRouterRestart(cloudstackTestCase):
     @classmethod
     def setUpClass(cls):
 
-        cls.api_client = super(TestRouterRestart, cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestRouterRestart, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
+        cls.domain = get_domain(cls.api_client)
         cls.services['mode'] = cls.zone.networktype
         template = get_template(
                             cls.api_client,
@@ -707,12 +728,14 @@ class TestTemplates(cloudstackTestCase):
     @classmethod
     def setUpClass(cls):
 
+        cls.testClient = super(TestTemplates, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
         cls.services = Services().services
-        cls.api_client = super(TestTemplates, cls).getClsTestClient().getApiClient()
+        # Get Zone, Domain and templates
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
+        cls.domain = get_domain(cls.api_client)
 
-        # Get Zone, templates etc
-        cls.domain = get_domain(cls.api_client, cls.services)
-        cls.zone = get_zone(cls.api_client, cls.services)
         cls.services['mode'] = cls.zone.networktype
 
         template = get_template(

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/test_cpu_domain_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_cpu_domain_limits.py b/test/integration/component/test_cpu_domain_limits.py
index 3828d05..7421559 100644
--- a/test/integration/component/test_cpu_domain_limits.py
+++ b/test/integration/component/test_cpu_domain_limits.py
@@ -19,7 +19,7 @@
 """
 # Import Local Modules
 from nose.plugins.attrib import attr
-from marvin.cloudstackTestCase import cloudstackTestCase, unittest
+from marvin.cloudstackTestCase import cloudstackTestCase
 from marvin.lib.base import (
                                         Account,
                                         ServiceOffering,
@@ -90,12 +90,13 @@ class TestDomainCPULimitsUpdateResources(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(TestDomainCPULimitsUpdateResources,
-                               cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestDomainCPULimitsUpdateResources, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services["mode"] = cls.zone.networktype
         cls.template = get_template(
                             cls.api_client,
@@ -500,12 +501,13 @@ class TestMultipleChildDomains(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(TestMultipleChildDomains,
-                               cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestMultipleChildDomains, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services["mode"] = cls.zone.networktype
         cls.template = get_template(
                             cls.api_client,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/test_cpu_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_cpu_limits.py b/test/integration/component/test_cpu_limits.py
index 4776519..12b0790 100644
--- a/test/integration/component/test_cpu_limits.py
+++ b/test/integration/component/test_cpu_limits.py
@@ -19,7 +19,7 @@
 """
 # Import Local Modules
 from nose.plugins.attrib import attr
-from marvin.cloudstackTestCase import cloudstackTestCase, unittest
+from marvin.cloudstackTestCase import cloudstackTestCase
 from marvin.lib.base import (
                                         Account,
                                         ServiceOffering,
@@ -91,12 +91,13 @@ class TestCPULimits(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(TestCPULimits,
-                               cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestCPULimits, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services["mode"] = cls.zone.networktype
 
         cls.template = get_template(
@@ -349,12 +350,14 @@ class TestDomainCPULimitsConfiguration(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(TestDomainCPULimitsConfiguration,
-                               cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestDomainCPULimitsConfiguration, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
+
         cls.services["mode"] = cls.zone.networktype
         cls.template = get_template(
                             cls.api_client,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/test_cpu_max_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_cpu_max_limits.py b/test/integration/component/test_cpu_max_limits.py
index a6ab7a6..d9f5cf2 100644
--- a/test/integration/component/test_cpu_max_limits.py
+++ b/test/integration/component/test_cpu_max_limits.py
@@ -19,7 +19,7 @@
 """
 # Import Local Modules
 from nose.plugins.attrib import attr
-from marvin.cloudstackTestCase import cloudstackTestCase, unittest
+from marvin.cloudstackTestCase import cloudstackTestCase
 from marvin.lib.base import (
                                         Account,
                                         ServiceOffering,
@@ -89,12 +89,13 @@ class TestMaxCPULimits(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(TestMaxCPULimits,
-                               cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestMaxCPULimits, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services["mode"] = cls.zone.networktype
         cls.template = get_template(
                             cls.api_client,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/test_cpu_project_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_cpu_project_limits.py b/test/integration/component/test_cpu_project_limits.py
index ccfa691..f038fb4 100644
--- a/test/integration/component/test_cpu_project_limits.py
+++ b/test/integration/component/test_cpu_project_limits.py
@@ -90,12 +90,13 @@ class TestProjectsCPULimits(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(TestProjectsCPULimits,
-                               cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestProjectsCPULimits, cls).getClsTestClient()
+        cls.api_client = cls.testClient.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.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services["mode"] = cls.zone.networktype
         cls.template = get_template(
                             cls.api_client,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/test_custom_hostname.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_custom_hostname.py b/test/integration/component/test_custom_hostname.py
index 74da3d6..dadcbea 100644
--- a/test/integration/component/test_custom_hostname.py
+++ b/test/integration/component/test_custom_hostname.py
@@ -94,13 +94,13 @@ class TestInstanceNameFlagTrue(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestInstanceNameFlagTrue,
-                               cls
-                               ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestInstanceNameFlagTrue, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
         cls.services = Services().services
-        # Get Zone, default template
-        cls.zone = get_zone(cls.api_client, cls.services)
+        # Get Zone, Domain and templates
+        cls.domain = get_domain(cls.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services["mode"] = cls.zone.networktype
         cls.template = get_template(
                             cls.api_client,
@@ -108,12 +108,7 @@ class TestInstanceNameFlagTrue(cloudstackTestCase):
                             cls.services["ostype"]
                             )
 
-        # Create domains, account etc.
-        cls.domain = get_domain(
-                                   cls.api_client,
-                                   cls.services
-                                   )
-
+        # Create account
         cls.account = Account.create(
                             cls.api_client,
                             cls.services["account"],
@@ -561,13 +556,13 @@ class TestInstanceNameFlagFalse(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(
-                               TestInstanceNameFlagFalse,
-                               cls
-                               ).getClsTestClient().getApiClient()
+        cls.testClient = super(TestInstanceNameFlagFalse, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
         cls.services = Services().services
-        # Get Zone, default template
-        cls.zone = get_zone(cls.api_client, cls.services)
+        # Get Zone, Domain and templates
+        cls.domain = get_domain(cls.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
 
         cls.template = get_template(
                             cls.api_client,
@@ -575,12 +570,7 @@ class TestInstanceNameFlagFalse(cloudstackTestCase):
                             cls.services["ostype"]
                             )
 
-        # Create domains, account etc.
-        cls.domain = get_domain(
-                                   cls.api_client,
-                                   cls.services
-                                   )
-
+        # Create account
         cls.account = Account.create(
                             cls.api_client,
                             cls.services["account"],

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/test_deploy_vm_userdata_reg.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_deploy_vm_userdata_reg.py b/test/integration/component/test_deploy_vm_userdata_reg.py
index 321bc33..c87a41a 100755
--- a/test/integration/component/test_deploy_vm_userdata_reg.py
+++ b/test/integration/component/test_deploy_vm_userdata_reg.py
@@ -71,9 +71,10 @@ class TestDeployVmWithUserData(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.apiClient = super(TestDeployVmWithUserData, cls).getClsTestClient().getApiClient()
+        cls.testClient = super(TestDeployVmWithUserData, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
         cls.services = Services().services
-        cls.zone = get_zone(cls.apiClient, cls.services)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         if cls.zone.localstorageenabled:
             #For devcloud since localstroage is enabled
             cls.services["service_offering"]["storagetype"] = "local"

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d70ef2a2/test/integration/component/test_egress_fw_rules.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_egress_fw_rules.py b/test/integration/component/test_egress_fw_rules.py
index 06203e0..74eb55f 100644
--- a/test/integration/component/test_egress_fw_rules.py
+++ b/test/integration/component/test_egress_fw_rules.py
@@ -132,12 +132,13 @@ class TestEgressFWRules(cloudstackTestCase):
     @classmethod
     def setUpClass(cls):
         cls._cleanup = []
-        cls.api_client = super(TestEgressFWRules,
-                               cls).getClsTestClient().getApiClient()
-        cls.services  = Services().services
-        # Get Zone  Domain and create Domains and sub Domains.
-        cls.domain           = get_domain(cls.api_client, cls.services)
-        cls.zone             = get_zone(cls.api_client, cls.services)
+        cls.testClient = super(TestEgressFWRules, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
+        cls.services = Services().services
+        # Get Zone, Domain and templates
+        cls.domain = get_domain(cls.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
         # Get and set template id for VM creation.
         cls.template = get_template(cls.api_client,


Mime
View raw message