Skip to content

Commit

Permalink
fio_windows: Update new check method for fio install
Browse files Browse the repository at this point in the history
1. The original fio installed judge condition does not accurate,
   change new here.
2. storage_benchmark remove fio does not clean since fio directory
   remain using, solve this problem as well.

Signed-off-by: Peixiu Hou <phou@redhat.com>
  • Loading branch information
peixiu committed Mar 15, 2024
1 parent fef9d14 commit d307be1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion provider/storage_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def _find_exe_file():
"""
Find the path of the given executable file in windows.
"""
cmd_dir = r'CD %s && DIR /S /B %s.exe' % (dst, self.name)
cmd_dir = r'DIR /S /B "%s" | find "%s.exe"' % (dst, self.name)
s, o = self.session.cmd_status_output(cmd_dir, timeout=timeout)
if not s:
return '"{}"'.format(o.splitlines()[0])
Expand All @@ -213,6 +213,7 @@ def _find_exe_file():
if not utils_misc.wait_for(
lambda: _find_exe_file(), timeout, step=3.0):
raise TestError('Failed to install fio under %.2f.' % timeout)
self.session.cmd_output(r'cd ..', timeout=timeout)

def install(self, src, dst, timeout=300):
"""
Expand Down
2 changes: 1 addition & 1 deletion qemu/tests/fio_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def run(test, params, env):
fio_cmd = params.get("fio_cmd")
timeout = float(params.get("login_timeout", 360))
cmd_timeout = int(params.get("cmd_timeout", "360"))
check_installed_cmd = 'dir "%s"|findstr /I fio' % install_path
check_installed_cmd = 'dir "%s/fio"|findstr /I fio.exe' % install_path
check_installed_cmd = params.get("check_installed_cmd",
check_installed_cmd)

Expand Down

0 comments on commit d307be1

Please sign in to comment.