diff --git a/qemu/tests/vioser_in_use.py b/qemu/tests/vioser_in_use.py index 549437a637..098d52cea2 100644 --- a/qemu/tests/vioser_in_use.py +++ b/qemu/tests/vioser_in_use.py @@ -46,6 +46,16 @@ def live_migration_guest(test, params, vm, session): vm.migrate() +def subw_guest_pause_resume(test, params, vm, session): + vm.monitor.cmd("stop") + if not vm.monitor.verify_status("paused"): + test.error("VM is not paused Current status: %s" % vm.monitor.get_status()) + time.sleep(float(params.get("wait_timeout", "1800"))) + vm.monitor.cmd("cont") + if not vm.monitor.verify_status("running"): + test.error("VM is not running. Current status: %s" % vm.monitor.get_status()) + + @error_context.context_aware def vcpu_hotplug_guest(test, params, vm, session): """ diff --git a/qemu/tests/virtio_serial_hotplug_port_pci.py b/qemu/tests/virtio_serial_hotplug_port_pci.py index e7b9f43654..eb98dba46d 100644 --- a/qemu/tests/virtio_serial_hotplug_port_pci.py +++ b/qemu/tests/virtio_serial_hotplug_port_pci.py @@ -1,4 +1,4 @@ -from virttest import env_process, error_context +from virttest import env_process, error_context, qemu_migration from virttest.qemu_monitor import QMPCmdError from provider import win_driver_utils @@ -34,6 +34,39 @@ def get_buses_and_serial_devices(vm, params, char_devices, serials): return buses, serial_devices +@error_context.context_aware +def reboot_guest(test, params, vm, session): + """ + Reboot guest from system_reset or shell. + """ + + vm.reboot(session, method=params["reboot_method"]) + + +@error_context.context_aware +def shutdown_guest(test, params, vm, session): + """ + Shutdown guest via system_powerdown or shell. + """ + + if params.get("shutdown_method") == "shell": + session.sendline(params["shutdown_command"]) + elif params.get("shutdown_method") == "system_powerdown": + vm.monitor.system_powerdown() + if not vm.wait_for_shutdown(int(params.get("shutdown_timeout", 360))): + test.fail("guest refuses to go down") + + +@error_context.context_aware +def live_migration_guest(test, params, vm, session): + """ + Run migrate_set_speed, then migrate guest. + """ + + qemu_migration.set_speed(vm, params.get("mig_speed", "1G")) + vm.migrate() + + @error_context.context_aware def run(test, params, env): """