Commit beb31982 authored by Ming Lei's avatar Ming Lei Committed by Jens Axboe
Browse files

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: default avatarMing Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250320013743.4167489-4-ming.lei@redhat.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent fe2230d9
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ _remove_test_files()

_show_result()
{
	if [ "$UBLK_TEST_SHOW_RESULT" -ne 0 ]; then
		if [ "$2" -eq 0 ]; then
			echo "$1 : [PASS]"
		elif [ "$2" -eq 4 ]; then
@@ -101,6 +102,7 @@ _show_result()
		else
			echo "$1 : [FAIL]"
		fi
	fi
	[ "$2" -ne 0 ] && exit "$2"
	return 0
}
@@ -216,5 +218,7 @@ _ublk_test_top_dir()

UBLK_PROG=$(_ublk_test_top_dir)/kublk
UBLK_TEST_QUIET=1
UBLK_TEST_SHOW_RESULT=1
export UBLK_PROG
export UBLK_TEST_QUIET
export UBLK_TEST_SHOW_RESULT