cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sanj...@apache.org
Subject [2/3] git commit: updated refs/heads/master to cc8508d
Date Thu, 11 Feb 2016 10:49:20 GMT
CLOUDSTACK-8717: Failed to start instance after restoring the running instance
	-Modified code to add tag to aonly one cluster wide SP
	-Added validateList function
	-Added code to clear tags in tearDown class


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

Branch: refs/heads/master
Commit: 4bbf151eb7d39d0ab535a3a7c45d95af71cbd689
Parents: af28ded
Author: Priti Sarap <priti.sarap@clogeny.com>
Authored: Wed Aug 12 12:50:56 2015 +0530
Committer: Priti Sarap <priti.sarap@clogeny.com>
Committed: Wed Aug 12 12:56:12 2015 +0530

----------------------------------------------------------------------
 .../testpaths/testpath_restore_vm.py            | 30 +++++++++++++-------
 1 file changed, 20 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4bbf151e/test/integration/testpaths/testpath_restore_vm.py
----------------------------------------------------------------------
diff --git a/test/integration/testpaths/testpath_restore_vm.py b/test/integration/testpaths/testpath_restore_vm.py
index 7fd1610..d73499a 100644
--- a/test/integration/testpaths/testpath_restore_vm.py
+++ b/test/integration/testpaths/testpath_restore_vm.py
@@ -22,7 +22,7 @@ Test restore running VM on VMWare with one cluster having 2 Primary Storage
 
 from nose.plugins.attrib import attr
 from marvin.cloudstackTestCase import cloudstackTestCase
-from marvin.lib.utils import cleanup_resources
+from marvin.lib.utils import cleanup_resources, validateList
 from marvin.lib.base import (Account,
                              ServiceOffering,
                              VirtualMachine,
@@ -35,7 +35,7 @@ from marvin.lib.common import (get_domain,
                                list_virtual_machines
                                )
 
-from marvin.codes import CLUSTERTAG1, ROOT
+from marvin.codes import CLUSTERTAG1, ROOT, PASS
 import time
 
 
@@ -108,6 +108,12 @@ class TestRestoreVM(cloudstackTestCase):
 
     def tearDown(self):
         try:
+            if self.pools:
+                StoragePool.update(
+                    self.apiclient,
+                    id=self.pools[0].id,
+                    tags="")
+
             cleanup_resources(self.apiclient, self.cleanup)
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
@@ -126,6 +132,14 @@ class TestRestoreVM(cloudstackTestCase):
                 zoneid=self.zone.id,
                 scope="CLUSTER")
 
+            status = validateList(self.pools)
+
+            # Step 3
+            self.assertEqual(
+                status[0],
+                PASS,
+                "Check: Failed to list  cluster wide storage pools")
+
             if len(self.pools) < 2:
                 self.skipTest("There must be at atleast two cluster wide\
                 storage pools available in the setup")
@@ -135,14 +149,10 @@ class TestRestoreVM(cloudstackTestCase):
 
         # Adding tags to Storage Pools
         cluster_no = 1
-        self.debug("Storage Pools: %s" % self.pools)
-        for storagePool in self.pools:
-            if storagePool.scope == "CLUSTER":
-                StoragePool.update(
-                    self.apiclient,
-                    id=storagePool.id,
-                    tags=[CLUSTERTAG1[:-1] + repr(cluster_no)])
-                cluster_no += 1
+        StoragePool.update(
+            self.apiclient,
+            id=self.pools[0].id,
+            tags=[CLUSTERTAG1[:-1] + repr(cluster_no)])
 
         self.vm = VirtualMachine.create(
             self.apiclient,


Mime
View raw message