[PATCH 3/3] selftests: ublk: add variable for user to not show test result

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 tools/testing/selftests/ublk/test_common.sh | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/ublk/test_common.sh b/tools/testing/selftests/ublk/test_common.sh
index c86363c5cc7e..48fca609e741 100755
--- a/tools/testing/selftests/ublk/test_common.sh
+++ b/tools/testing/selftests/ublk/test_common.sh
@@ -94,12 +94,14 @@ _remove_test_files()
 
 _show_result()
 {
-	if [ "$2" -eq 0 ]; then
-		echo "$1 : [PASS]"
-	elif [ "$2" -eq 4 ]; then
-		echo "$1 : [SKIP]"
-	else
-		echo "$1 : [FAIL]"
+	if [ "$UBLK_TEST_SHOW_RESULT" -ne 0 ]; then
+		if [ "$2" -eq 0 ]; then
+			echo "$1 : [PASS]"
+		elif [ "$2" -eq 4 ]; then
+			echo "$1 : [SKIP]"
+		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
-- 
2.47.0





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux