On Thu, Oct 12, 2023 at 10:12 AM Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx> wrote: > > The commit b6356f6 ("nvme/rc: Add common file_path name define") defined > a global variable 'def_file_path' in nvme/rc, which refers TMPDIR. > However, when nvme/rc is sourced and def_file_path is defined for the > nvme test group, TMPDIR is not yet defined since TMPDIR is defined for > each test case. Then an unexpected path is set to def_file_path and > temporary files are created at the unexpected path. > > Fix this by replacing the global variable def_file_path with a helper > function _nvme_def_file_path(). This helper function allows to refer > TMPDIR not at nvme/rc source timing but in test() or test_device() > context of each test case. > > Reported-by: Yi Zhang <yi.zhang@xxxxxxxxxx> > Fixes: b6356f6 ("nvme/rc: Add common file_path name define") > Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx> LGTM, thanks for the fix. Reviewed-by: Yi Zhang <yi.zhang@xxxxxxxxxx>