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

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2013-01-25 19:01:23 -08:00
parent bc40ed85e5
commit 221ac72a2e
1 changed files with 9 additions and 14 deletions

View File

@ -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,