Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vioser: Supplement the correct function #4212

Merged
Merged
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
10 changes: 10 additions & 0 deletions qemu/tests/vioser_in_use.py
Original file line number Diff line number Diff line change
@@ -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):
"""
35 changes: 34 additions & 1 deletion qemu/tests/virtio_serial_hotplug_port_pci.py
Original file line number Diff line number Diff line change
@@ -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):
"""