]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests: ublk: organize test directories by test ID
authorMing Lei <ming.lei@redhat.com>
Sun, 1 Feb 2026 03:10:44 +0000 (11:10 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 5 Feb 2026 03:46:44 +0000 (20:46 -0700)
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.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
tools/testing/selftests/ublk/test_common.sh

index c3afd00783a2c563a072889ed4576820d7e310ce..163a4000791029179b97106adec35271c106c0b2 100755 (executable)
@@ -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