On Thu, Oct 12, 2023 at 11:11:51AM +0900, Shin'ichiro Kawasaki 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> Reviewed-by: Daniel Wagner <dwagern@xxxxxxx> Thanks, Daniel