Skip to content

virtio_fs_support_win_fs: wait some time for 7z.exe up #4291

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions qemu/tests/cfg/virtio_fs_support_win_fs.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
script_path = ":\simulate_right_click_on_7z_latest.au3"
Win10, Win2016, Win2019, Win2022:
script_path = ":\simulate_right_click_on_7z.au3"
check_task_cmd = tasklist -v | findstr %s
reg_add_cmd = "reg add HKLM\Software\VirtIO-FS /v FileSystemName /d NTFS /t REG_SZ /f"
reg_add_username = 'reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d ${guest_username} /f'
reg_add_pwd = 'reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d ${guest_username_pwd} /f'
26 changes: 24 additions & 2 deletions qemu/tests/virtio_fs_support_win_fs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import re

from virttest import error_context, utils_misc, utils_test

from provider import virtio_fs_utils
Expand Down Expand Up @@ -31,6 +33,7 @@ def run(test, params, env):
driver = params["driver_name"]
driver_verifier = params.get("driver_verifier", driver)
driver_running = params.get("driver_running", driver_verifier)
check_task_cmd = params["check_task_cmd"]

vm = env.get_vm(params.get("main_vm"))
vm.verify_alive()
Expand Down Expand Up @@ -69,13 +72,32 @@ def run(test, params, env):
session.cmd(reg_add_pwd)
error_context.context("Reboot the guest.", test.log.info)
session = vm.reboot(session)

error_context.context(
"Run autoit script to install executable in explorer.", test.log.info
)
# wait several seconds to virtiofs startup
if not utils_misc.wait_for(
lambda: re.search(
r"RUNNING", virtio_fs_utils.query_viofs_service(test, params, session)
),
60,
0,
5,
):
test.error("Virtiofs service wasn't start after vm reboot.")

session.cmd("start /w " + autoIt_path + " " + script_path)
exe_name = winutils_pack_path.encode("unicode_escape").decode()[4:]
output = session.cmd_output("tasklist -v | findstr %s" % exe_name)
test.log.info("The process found: %s", output)
if not utils_misc.wait_for(
lambda: session.cmd_output(check_task_cmd % exe_name).strip(),
60,
0,
2,
):
test.error(f"The {exe_name} isn't started.")

output = session.cmd_output(check_task_cmd % exe_name).strip()
output_lower = output.lower()
if "7-zip" in output_lower and "setup" in output_lower:
test.log.info(
Expand Down