Skip to content

Commit 5af302a

Browse files
Ming Leiaxboe
authored andcommitted
selftests: ublk: simplify UBLK_TEST_DIR handling
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>
1 parent 491af20 commit 5af302a

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

tools/testing/selftests/ublk/test_common.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ _prep_test() {
124124
local type=$1
125125
shift 1
126126
modprobe ublk_drv > /dev/null 2>&1
127-
TDIR=$(mktemp -d ${TMPDIR:-.}/ublktest-dir.XXXXXX)
128-
export UBLK_TEST_DIR=${TDIR}
127+
UBLK_TEST_DIR=$(mktemp -d ${TMPDIR:-.}/ublktest-dir.XXXXXX)
129128
UBLK_TMP=$(mktemp ${UBLK_TEST_DIR}/ublk_test_XXXXX)
130129
[ "$UBLK_TEST_QUIET" -eq 0 ] && echo "ublk $type: $*"
131130
echo "ublk selftest: $TID starting at $(date '+%F %T')" | tee /dev/kmsg
@@ -408,8 +407,6 @@ UBLK_PROG=$(_ublk_test_top_dir)/kublk
408407
UBLK_TEST_QUIET=1
409408
UBLK_TEST_SHOW_RESULT=1
410409
UBLK_BACKFILES=()
411-
UBLK_TEST_DIR=${TMPDIR:-.}
412410
export UBLK_PROG
413411
export UBLK_TEST_QUIET
414412
export UBLK_TEST_SHOW_RESULT
415-
export UBLK_TEST_DIR

0 commit comments

Comments
 (0)