You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sa...@apache.org on 2015/06/17 14:10:51 UTC

git commit: updated refs/heads/master to 64361d2

Repository: cloudstack
Updated Branches:
  refs/heads/master 5e96d1394 -> 64361d2b7


In case of vm deployment failure vm cleanup was not handled properly Corrected few script issues
This closes #472


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

Branch: refs/heads/master
Commit: 64361d2b7164b0a91d5de19aa972689d44f0b5ce
Parents: 5e96d13
Author: Sanjeev Neelarapu <sa...@citrix.com>
Authored: Wed Jun 17 17:14:12 2015 +0530
Committer: sanjeev <sa...@apache.org>
Committed: Wed Jun 17 17:38:35 2015 +0530

----------------------------------------------------------------------
 test/integration/testpaths/testpath_vmlc.py | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/64361d2b/test/integration/testpaths/testpath_vmlc.py
----------------------------------------------------------------------
diff --git a/test/integration/testpaths/testpath_vmlc.py b/test/integration/testpaths/testpath_vmlc.py
index c8b52fa..f637627 100755
--- a/test/integration/testpaths/testpath_vmlc.py
+++ b/test/integration/testpaths/testpath_vmlc.py
@@ -130,6 +130,7 @@ def CreateNetwork(self, networktype):
                          account=self.account.name,
                          domainid=self.account.domainid
                          )
+        self.cleanup.append(vpc)
         self.vpcid = vpc.id
         vpcs = VPC.list(self.apiclient, id=vpc.id)
         self.assertEqual(
@@ -148,7 +149,6 @@ def CreateNetwork(self, networktype):
             gateway="10.1.1.1",
             netmask="255.255.255.0")
         self.cleanup.append(network)
-        self.cleanup.append(vpc)
     return network
 
 
@@ -306,12 +306,12 @@ class TestPathVMLC(cloudstackTestCase):
         # Cleanup VM before proceeding the cleanup as networks will be
         # cleaned up properly, continue if VM deletion fails,
         # because in that case VM is already deleted from the test case
+        # try:
+        #     self.virtual_machine.delete(self.apiclient, expunge=True)
+        # except Exception:
+        #     self.debug("Exception while destroying VM")
         try:
-
-            self.virtual_machine.delete(self.apiclient, expunge=True)
-        except Exception:
-            self.debug("Exception while destroying VM")
-        try:
+            self.cleanup = self.cleanup[::-1]
             cleanup_resources(self.apiclient, self.cleanup)
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
@@ -382,7 +382,7 @@ class TestPathVMLC(cloudstackTestCase):
             networkids=[network.id, ],
             zoneid=self.zone.id
         )
-
+        self.cleanup.append(self.virtual_machine)
         publicip = PublicIPAddress.create(
             self.userapiclient, accountid=self.account.name,
             zoneid=self.zone.id, domainid=self.account.domainid,
@@ -560,6 +560,7 @@ class TestPathVMLC(cloudstackTestCase):
             networkids=[network.id, ],
             zoneid=self.zone.id
         )
+        self.cleanup.append(self.virtual_machine)
         return
 
     @attr(tags=["basic"], required_hardware="True")
@@ -639,7 +640,7 @@ class TestPathVMLC(cloudstackTestCase):
             zoneid=self.zone.id,
             securitygroupids=[security_group.id, ]
         )
-
+        self.cleanup.append(self.virtual_machine)
         # Check VM accessibility
         try:
             SshClient(host=self.virtual_machine.ssh_ip,
@@ -754,6 +755,7 @@ class TestPathVMLC(cloudstackTestCase):
             networkids=[networkid, ],
             zoneid=self.zone.id
         )
+        self.cleanup.append(self.virtual_machine)
         # Stop the VM and try to reboot it, it should fail
         self.virtual_machine.stop(self.userapiclient)
         with self.assertRaises(Exception):
@@ -797,6 +799,7 @@ class TestPathVMLC(cloudstackTestCase):
             serviceofferingid=self.service_offering_1.id,
             zoneid=self.zone.id
         )
+        self.cleanup.append(self.virtual_machine)
         # Stop the VM and try to reboot it, it should fail
         self.virtual_machine.stop(self.userapiclient)
         with self.assertRaises(Exception):