Skip to content

Commit 5d3ae80

Browse files
Ming Leiaxboe
authored andcommitted
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. Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent ee81212 commit 5d3ae80

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tools/testing/selftests/ublk/test_common.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ _prep_test() {
129129
local type=$1
130130
shift 1
131131
modprobe ublk_drv > /dev/null 2>&1
132-
UBLK_TEST_DIR=$(mktemp -d ${TMPDIR:-.}/ublktest-dir.XXXXXX)
132+
local base_dir=${TMPDIR:-./ublktest-dir}
133+
mkdir -p "$base_dir"
134+
UBLK_TEST_DIR=$(mktemp -d ${base_dir}/${TID}.XXXXXX)
133135
UBLK_TMP=$(mktemp ${UBLK_TEST_DIR}/ublk_test_XXXXX)
134136
[ "$UBLK_TEST_QUIET" -eq 0 ] && echo "ublk $type: $*"
135137
echo "ublk selftest: $TID starting at $(date '+%F %T')" | tee /dev/kmsg

0 commit comments

Comments
 (0)