]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
selftests: ublk: add variable for user to not show test result
authorMing Lei <ming.lei@redhat.com>
Thu, 20 Mar 2025 01:37:35 +0000 (09:37 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 20 Mar 2025 23:18:55 +0000 (17:18 -0600)
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>
tools/testing/selftests/ublk/test_common.sh

index c86363c5cc7ea7ff54f192f12dde9fec2f5b7444..48fca609e741a6b8ca1ba0a9d6286633ffa22d90 100755 (executable)
@@ -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