mirror of https://github.com/apache/cloudstack.git
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:
parent
bc40ed85e5
commit
221ac72a2e
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue