Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions test/integration/smoke/test_vm_life_cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,23 @@ def test_07_restore_vm(self):

return

def waitForHost(self, host, timeout):
while True:
resp = list_hosts(
self.apiclient,
id=host.id,
listall=True
)

if resp and resp[0].state == 'Up' and resp[0].resourcestate == 'Enabled':
break

if timeout == 0:
raise Exception("Timed out waiting for host to be Up and Enabled")

time.sleep(timeout)
timeout = timeout - 1

@attr(tags=["advanced", "advancedns", "smoke", "basic", "sg", "multihost"], required_hardware="false")
def test_08_migrate_vm(self):
"""Test migrate VM
Expand Down Expand Up @@ -647,6 +664,8 @@ def test_08_migrate_vm(self):

target_host = suitable_hosts[0]
migrate_host = suitable_hosts[1]
self.waitForHost(target_host, 30)
self.waitForHost(migrate_host, 30)

# deploy VM on target host
vm_to_migrate = VirtualMachine.create(
Expand Down