Skip to contentSkip to conversation

selftests: ublk: organize test directories by test ID

PATCH Applied Ming Lei 2 participants 2 messages Feb 1 – Feb 5

Subsystems (3)
lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH 1/1 selftests: ublk: organize test directories by test ID

Set UBLK_TEST_DIR to ${TMPDIR:-./ublktest-dir}/${TID}.XXXXXX to create per-test subdirectories organized by test ID. This makes it easier to identify and debug specific test runs.

---
 tools/testing/selftests/ublk/test_common.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/testing/selftests/ublk/test_common.sh +3 -1
index c3afd00783a2..163a40007910 100755
@@ -129,7 +129,9 @@ _prep_test() {
 	local type=$1
 	shift 1
 	modprobe ublk_drv > /dev/null 2>&1
-	UBLK_TEST_DIR=$(mktemp -d ${TMPDIR:-.}/ublktest-dir.XXXXXX)
+	local base_dir=${TMPDIR:-./ublktest-dir}
+	mkdir -p "$base_dir"
+	UBLK_TEST_DIR=$(mktemp -d ${base_dir}/${TID}.XXXXXX)
 	UBLK_TMP=$(mktemp ${UBLK_TEST_DIR}/ublk_test_XXXXX)
 	[ "$UBLK_TEST_QUIET" -eq 0 ] && echo "ublk $type: $*"
 	echo "ublk selftest: $TID starting at $(date '+%F %T')" | tee /dev/kmsg
Signature · 1 line
2.47.1
maintainer Applied
#1 lore raw
Quoted 5 lines · Ming Lei

Set UBLK_TEST_DIR to ${TMPDIR:-./ublktest-dir}/${TID}.XXXXXX to create per-test subdirectories organized by test ID. This makes it easier to identify and debug specific test runs.

Applied, thanks!

[1/1] selftests: ublk: organize test directories by test ID

      commit: 5d3ae80b4dc43d1c49f5ab6e9835ae5fc9ac5d37

Best regards,

Signature · 1 line
Jens Axboe