Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions libvirt/tests/cfg/sriov/vIOMMU/iommu_device_lifecycle.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@
- reboot_many_times:
loop_time = 5
- reset:
- shutdown:
start_after_shutdown = yes
16 changes: 16 additions & 0 deletions libvirt/tests/src/sriov/vIOMMU/iommu_device_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ def run(test, params, env):
s, o = utils_net.ping(ping_dest, count=5, timeout=10, session=session)
if s:
test.fail("Failed to ping %s! status: %s, output: %s." % (ping_dest, s, o))

elif test_scenario == "shutdown":
test.log.info("TEST_STEP: Shutdown the VM.")
virsh.shutdown(vm.name, **VIRSH_ARGS)
if not utils_misc.wait_for(lambda: vm.is_dead(), 60):
test.fail("VM failed to shutdown")
test.log.info("VM successfully shutdown")

# Optional: Start VM again based on parameter
start_after_shutdown = "yes" == params.get("start_after_shutdown", "no")
if start_after_shutdown:
test.log.info("TEST_STEP: Starting VM after shutdown")
vm.start()
vm.wait_for_login(timeout=int(params.get('login_timeout', 240)))
test.log.info("VM successfully started after shutdown")

else:
pid_ping, upsince = save_base.pre_save_setup(vm, serial=True)
if test_scenario == "save_restore":
Expand Down