]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests: ublk: simplify UBLK_TEST_DIR handling
authorMing Lei <ming.lei@redhat.com>
Sat, 31 Jan 2026 16:23:32 +0000 (00:23 +0800)
committerJens Axboe <axboe@kernel.dk>
Sat, 31 Jan 2026 21:56:28 +0000 (14:56 -0700)
Remove intermediate TDIR variable and set UBLK_TEST_DIR directly
in _prep_test(). Remove default initialization since the directory
is created dynamically when tests run.

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 21ba51fcc7d775c031da95f4f54f2a0214fed0a4..8d298a7ee7b163ecea399990194ce3f30c27ec10 100755 (executable)
@@ -124,8 +124,7 @@ _prep_test() {
        local type=$1
        shift 1
        modprobe ublk_drv > /dev/null 2>&1
-       TDIR=$(mktemp -d ${TMPDIR:-.}/ublktest-dir.XXXXXX)
-       export UBLK_TEST_DIR=${TDIR}
+       UBLK_TEST_DIR=$(mktemp -d ${TMPDIR:-.}/ublktest-dir.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
@@ -408,8 +407,6 @@ UBLK_PROG=$(_ublk_test_top_dir)/kublk
 UBLK_TEST_QUIET=1
 UBLK_TEST_SHOW_RESULT=1
 UBLK_BACKFILES=()
-UBLK_TEST_DIR=${TMPDIR:-.}
 export UBLK_PROG
 export UBLK_TEST_QUIET
 export UBLK_TEST_SHOW_RESULT
-export UBLK_TEST_DIR