From fe1d06b16e098899795665358b402372b8fe7c66 Mon Sep 17 00:00:00 2001 From: qcheng-redhat Date: Wed, 27 Nov 2024 17:29:43 +0800 Subject: [PATCH] Reboot vm during virtiofs is working Signed-off-by: qcheng-redhat --- qemu/tests/cfg/virtio_fs_share_data.cfg | 5 +++++ qemu/tests/virtio_fs_share_data.py | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/qemu/tests/cfg/virtio_fs_share_data.cfg b/qemu/tests/cfg/virtio_fs_share_data.cfg index da2080a67a..26966245cb 100644 --- a/qemu/tests/cfg/virtio_fs_share_data.cfg +++ b/qemu/tests/cfg/virtio_fs_share_data.cfg @@ -71,6 +71,11 @@ only default.default.with_cache.auto.default reboot_guest = 'yes' cmd_ps_virtiofsd = 'ps -eo pid,args |grep "socket-path=%s" |grep -v grep' + variants: + - with_system_reset: + reboot_method = system_reset + - with_shell: + reboot_method = shell - with_log_check: only Windows only default.default.with_cache.auto.default diff --git a/qemu/tests/virtio_fs_share_data.py b/qemu/tests/virtio_fs_share_data.py index 58ad7ccd6e..c69e0673b7 100644 --- a/qemu/tests/virtio_fs_share_data.py +++ b/qemu/tests/virtio_fs_share_data.py @@ -1016,20 +1016,24 @@ def get_vfsd_num(): vfsd_num += len(vfsd_ps.strip().splitlines()) return vfsd_num + reboot_method = params.get("reboot_method") + error_context.context( "Check virtiofs daemon before reboot vm.", test.log.info ) vfsd_num_bf = get_vfsd_num() + error_context.context( "Reboot guest and check virtiofs daemon.", test.log.info ) - session = vm.reboot(session) + session = vm.reboot(session, reboot_method) if not vm.is_alive(): test.fail("After rebooting vm quit unexpectedly.") vfsd_num_af = get_vfsd_num() if vfsd_num_bf != vfsd_num_af: test.fail( - "Virtiofs daemon is different before and after reboot.\n" + "Virtiofs daemon is different before " + "and after reboot.\n" "Before reboot: %s\n" "After reboot: %s\n", (vfsd_num_bf, vfsd_num_af),