Skip to content

Commit beb3198

Browse files
Ming Leiaxboe
authored andcommitted
selftests: ublk: add variable for user to not show test result
Some user decides test result by exit code only, and wouldn't like to be bothered by the test result. Signed-off-by: Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/20250320013743.4167489-4-ming.lei@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent fe2230d commit beb3198

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

tools/testing/selftests/ublk/test_common.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,14 @@ _remove_test_files()
9494

9595
_show_result()
9696
{
97-
if [ "$2" -eq 0 ]; then
98-
echo "$1 : [PASS]"
99-
elif [ "$2" -eq 4 ]; then
100-
echo "$1 : [SKIP]"
101-
else
102-
echo "$1 : [FAIL]"
97+
if [ "$UBLK_TEST_SHOW_RESULT" -ne 0 ]; then
98+
if [ "$2" -eq 0 ]; then
99+
echo "$1 : [PASS]"
100+
elif [ "$2" -eq 4 ]; then
101+
echo "$1 : [SKIP]"
102+
else
103+
echo "$1 : [FAIL]"
104+
fi
103105
fi
104106
[ "$2" -ne 0 ] && exit "$2"
105107
return 0
@@ -216,5 +218,7 @@ _ublk_test_top_dir()
216218

217219
UBLK_PROG=$(_ublk_test_top_dir)/kublk
218220
UBLK_TEST_QUIET=1
221+
UBLK_TEST_SHOW_RESULT=1
219222
export UBLK_PROG
220223
export UBLK_TEST_QUIET
224+
export UBLK_TEST_SHOW_RESULT

0 commit comments

Comments
 (0)