Skip to content

Commit

Permalink
Reboot vm during virtiofs is working
Browse files Browse the repository at this point in the history
Signed-off-by: qcheng-redhat <[email protected]>
  • Loading branch information
qcheng-redhat committed Jan 17, 2025
1 parent bd33da7 commit fe1d06b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions qemu/tests/cfg/virtio_fs_share_data.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions qemu/tests/virtio_fs_share_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit fe1d06b

Please sign in to comment.