Skip to content

Commit

Permalink
hwbench: Using absolute paths for out & tuning directories
Browse files Browse the repository at this point in the history
As per issue #38, the dmidecode call to save the SMBIOS table in a
binary file for later reading is broken as the file is not present into
the hwbench-out directory.

It appear that when dmidecode --dump-file is called, that is done with a
relative path.

The stderr log show the following error :
	hwbench-out-20241025123459/dmidecode.bin: open: No such file or directory

It appear the relative path passed to dmidecode is not existing because
dmidecode is not started in the same home dir as we are currently
running the tool.

This commit is about using an absolute path instead of a relative one to
ensure that every command/tool can dump content in the proper directory.

With this patch, the dmidecode-bin file is now present in the
hwbench-out archive.

Signed-off-by: Erwan Velu <e.velu@criteo.com>
  • Loading branch information
ErwanAliasr1 committed Oct 25, 2024
1 parent c7669f9 commit 3084817
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hwbench/hwbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def create_output_directory() -> tuple[pathlib.Path, pathlib.Path]:
tuning_out_dir = out_dir / "tuning"
tuning_out_dir.mkdir()

return out_dir, tuning_out_dir
return out_dir.absolute(), tuning_out_dir.absolute()


def parse_options():
Expand Down

0 comments on commit 3084817

Please sign in to comment.