Repository: cloudstack
Updated Branches:
  refs/heads/master c6b3fe2c5 -> b9a0b8807


CLOUDSTACK-8512: Fixed test script issues in test_escalations_hosts.py

Signed-off-by: Gaurav Aradhye <[email protected]>
This closes #299


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

Branch: refs/heads/master
Commit: b9a0b880787886b002bd8331c05ef157499a347d
Parents: c6b3fe2
Author: Gaurav Aradhye <[email protected]>
Authored: Mon May 25 18:44:51 2015 +0530
Committer: Gaurav Aradhye <[email protected]>
Committed: Mon May 25 18:47:52 2015 +0530

----------------------------------------------------------------------
 .../component/maint/test_escalations_hosts.py          | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b9a0b880/test/integration/component/maint/test_escalations_hosts.py
----------------------------------------------------------------------
diff --git a/test/integration/component/maint/test_escalations_hosts.py 
b/test/integration/component/maint/test_escalations_hosts.py
index 9e19cfd..bdc1074 100644
--- a/test/integration/component/maint/test_escalations_hosts.py
+++ b/test/integration/component/maint/test_escalations_hosts.py
@@ -77,13 +77,12 @@ def update_pod(apiclient, state, pod_id):
     return pod_status.allocationstate
 
 
-def update_zone(apiclient, state, zone_id):
+def update_zone(apiclient, state, zone):
     """
     Function to Enable/Disable zone
     """
-    zone_status = Zone.update(
+    zone_status = zone.update(
         apiclient,
-        id=zone_id,
         allocationstate=state
     )
     return zone_status.allocationstate
@@ -119,12 +118,12 @@ class TestHosts(cloudstackTestCase):
         cls._cleanup = []
 
         # get zone, domain etc
-        cls.zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests())
+        cls.zone = Zone(get_zone(cls.apiclient, 
cls.testClient.getZoneForTests()).__dict__)
         cls.domain = get_domain(cls.apiclient)
         cls.pod = get_pod(cls.apiclient, cls.zone.id)
 
         # list hosts
-        hosts = list_hosts(cls.apiclient)
+        hosts = list_hosts(cls.apiclient, type="Routing")
         if len(hosts) > 0:
             cls.my_host_id = hosts[0].id
             cls.host_db_id = cls.dbclient.execute(
@@ -299,7 +298,7 @@ class TestHosts(cloudstackTestCase):
         zone_allocationstate = update_zone(
             self.apiclient,
             zone_state,
-            self.zone.id)
+            self.zone)
         self.assertEqual(
             zone_allocationstate,
             zone_state,
@@ -311,7 +310,7 @@ class TestHosts(cloudstackTestCase):
         zone_allocationstate = update_zone(
             self.apiclient,
             zone_state,
-            self.zone.id)
+            self.zone)
         self.assertEqual(
             zone_allocationstate,
             zone_state,

Reply via email to