[LTP] [PATCH 3/3] tst_test: Print used temporary dir and its filesystem

Petr Vorel pvorel@suse.cz
Fri Jul 26 11:55:46 CEST 2024


It helps debugging to know used filesystem (and in case of
TST_ALL_FILESYSTEMS=1 the underlying filesystem). This follows
5cabf2bea7 change in C API, using 'stat' which should work also on
busybox.

Missing 'stat' binary (or busybox symlink) does not break test (just the
output is mangled), thus 'stat' presence is not tested/required.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/tst_test.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index 5ea2c9ba98..c19c30b76f 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -745,6 +745,7 @@ tst_run()
 
 		TST_STARTWD=$(pwd)
 		cd "$TST_TMPDIR"
+		tst_res TINFO "Using $TST_TMPDIR as tmpdir ($(stat -f -c '%T' $TST_TMPDIR) filesystem)"
 	fi
 
 	# needs to be after cd $TST_TMPDIR to keep test_dev.img under $TST_TMPDIR
-- 
2.45.2



More information about the ltp mailing list