You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ke...@apache.org on 2013/02/02 00:27:32 UTC

[10/50] [abbrv] git commit: refs/heads/master - test_vm_life_cycle: Consider 600s threshold for expunge.delay as per server logic

test_vm_life_cycle: Consider 600s threshold for expunge.delay as per server logic

Signed-off-by: Rohit Yadav <bh...@apache.org>


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

Branch: refs/heads/master
Commit: 221ac72a2e8cf3c68b5bce8f1d086b6bd4415923
Parents: bc40ed8
Author: Rohit Yadav <bh...@apache.org>
Authored: Fri Jan 25 19:01:23 2013 -0800
Committer: Rohit Yadav <bh...@apache.org>
Committed: Fri Jan 25 19:01:23 2013 -0800

----------------------------------------------------------------------
 test/integration/smoke/test_vm_life_cycle.py |   23 ++++++++------------
 1 files changed, 9 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/221ac72a/test/integration/smoke/test_vm_life_cycle.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py
index 0834f5d..7ee9a03 100644
--- a/test/integration/smoke/test_vm_life_cycle.py
+++ b/test/integration/smoke/test_vm_life_cycle.py
@@ -853,32 +853,27 @@ class TestVMLifeCycle(cloudstackTestCase):
                                      name='expunge.delay'
                                      )
 
-        response = config[0]
+        expunge_delay = int(config[0].value)
+        if expunge_delay < 600:
+            expunge_delay = 600
         # Wait for some time more than expunge.delay
-        time.sleep(int(response.value) * 2)
-        
+        time.sleep(expunge_delay * 2)
+
         #VM should be destroyed unless expunge thread hasn't run
         #Wait for two cycles of the expunge thread
         config = list_configurations(
                                      self.apiclient,
                                      name='expunge.interval'
                                      )
-        expunge_cycle = int(config[0].value)*2
+        expunge_cycle = int(config[0].value)
         if expunge_cycle < 600:
-            expunge_cycle = 600*2
+            expunge_cycle = 600
 
-        while expunge_cycle > 0:
-            list_vm_response = list_virtual_machines(
+        time.sleep(expunge_cycle * 2)
+        list_vm_response = list_virtual_machines(
                                                 self.apiclient,
                                                 id=self.small_virtual_machine.id
                                                 )
-            if list_vm_response:
-                time.sleep(expunge_cycle)
-                expunge_cycle = 0
-                continue
-            else:
-                break
-            
         self.assertEqual(
                         list_vm_response,
                         None,