cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject [05/50] [abbrv] git commit: updated refs/heads/4.2 to a23322b
Date Mon, 26 Aug 2013 23:32:41 GMT
CLOUDSTACK-4448: Fix test_03_RouterStartOnVmDeploy to stop all the pre-existing VMs before
starting the test

Signed-off-by: Prasanna Santhanam <tsp@apache.org>


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

Branch: refs/heads/4.2
Commit: 4a8119c8077ca15dfa42c11a425f3c5273f39f13
Parents: db673b2
Author: SrikanteswaraRao Talluri <kanti.sri@gmail.com>
Authored: Thu Aug 22 16:09:22 2013 +0530
Committer: Prasanna Santhanam <tsp@apache.org>
Committed: Fri Aug 23 12:37:03 2013 +0530

----------------------------------------------------------------------
 test/integration/component/test_routers.py | 29 +++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4a8119c8/test/integration/component/test_routers.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_routers.py b/test/integration/component/test_routers.py
index a724a3f..396c54e 100644
--- a/test/integration/component/test_routers.py
+++ b/test/integration/component/test_routers.py
@@ -492,6 +492,35 @@ class TestRouterServices(cloudstackTestCase):
         # 4. listRouters should report router to have come back to "Running" state
         # 5. All other VMs in the account should remain in "Stopped" state
 
+
+        #stop all pre-existing virtual machines if they are in 'Running' state
+        virtual_machines = list_virtual_machines(
+                                self.apiclient,
+                                account=self.account.name,
+                                domainid=self.account.domainid,
+                                )
+
+        self.assertEqual(
+                        isinstance(virtual_machines, list),
+                        True,
+                        "Check for list virtual machines response return valid data"
+                        )
+        self.assertNotEqual(
+                             len(virtual_machines),
+                             0,
+                             "Check list virtual machines response"
+                             )
+        for virtual_machine in virtual_machines:
+            self.debug("VM ID: %s & VM state: %s" % (
+                                                     virtual_machine.id,
+                                                     virtual_machine.state
+                                                    ))
+            if virtual_machine.state == 'Running':
+                # Stop virtual machine
+                cmd = stopVirtualMachine.stopVirtualMachineCmd()
+                cmd.id = virtual_machine.id
+                self.apiclient.stopVirtualMachine(cmd)
+
         vm = VirtualMachine.create(
                                     self.apiclient,
                                     self.services["virtual_machine"],


Mime
View raw message