From 9b608d07ba3729bc7913619c1c0c2de70ec56cb5 Mon Sep 17 00:00:00 2001 From: Steve Muckle Date: Tue, 7 Nov 2017 16:01:53 -0800 Subject: [PATCH 16/20] selftests/futex: report success/failure to environment Report whether or not any tests failed to the caller of the run.sh script. Skip tests when required syscall is not present. (cherry picked from commit 5c9ad29f58246b95fd5f1940e6b03ac485cc5168) Bug: 31590178 Bug: 189333904 Test: run vts-kernel -m VtsKernelLinuxKselftestStaging Signed-off-by: Steve Muckle Signed-off-by: Edward Liaw --- .../testing/selftests/futex/functional/run.sh | 70 +++++++++++-------- 1 file changed, 41 insertions(+), 29 deletions(-) diff --git a/tools/testing/selftests/futex/functional/run.sh b/tools/testing/selftests/futex/functional/run.sh index 5ccd599da6c3..942dab5b5879 100755 --- a/tools/testing/selftests/futex/functional/run.sh +++ b/tools/testing/selftests/futex/functional/run.sh @@ -18,6 +18,16 @@ # ############################################################################### +run_test() +{ + $@ + ret=$? + if [ $ret -ne 0 ] && [ $ret -ne 4 ]; then # KSFT_SKIP=4 + echo "Failed with $ret" + rc=1 + fi +} + # Test for a color capable console if [ -z "$USE_COLOR" ]; then tput setf 7 || tput setaf 7 @@ -34,51 +44,53 @@ fi echo # requeue pi testing # without timeouts -./futex_requeue_pi $COLOR -./futex_requeue_pi $COLOR -b -./futex_requeue_pi $COLOR -b -l -./futex_requeue_pi $COLOR -b -o -./futex_requeue_pi $COLOR -l -./futex_requeue_pi $COLOR -o +run_test ./futex_requeue_pi $COLOR +run_test ./futex_requeue_pi $COLOR -b +run_test ./futex_requeue_pi $COLOR -b -l +run_test ./futex_requeue_pi $COLOR -b -o +run_test ./futex_requeue_pi $COLOR -l +run_test ./futex_requeue_pi $COLOR -o # with timeouts -./futex_requeue_pi $COLOR -b -l -t 5000 -./futex_requeue_pi $COLOR -l -t 5000 -./futex_requeue_pi $COLOR -b -l -t 500000 -./futex_requeue_pi $COLOR -l -t 500000 -./futex_requeue_pi $COLOR -b -t 5000 -./futex_requeue_pi $COLOR -t 5000 -./futex_requeue_pi $COLOR -b -t 500000 -./futex_requeue_pi $COLOR -t 500000 -./futex_requeue_pi $COLOR -b -o -t 5000 -./futex_requeue_pi $COLOR -l -t 5000 -./futex_requeue_pi $COLOR -b -o -t 500000 -./futex_requeue_pi $COLOR -l -t 500000 +run_test ./futex_requeue_pi $COLOR -b -l -t 5000 +run_test ./futex_requeue_pi $COLOR -l -t 5000 +run_test ./futex_requeue_pi $COLOR -b -l -t 500000 +run_test ./futex_requeue_pi $COLOR -l -t 500000 +run_test ./futex_requeue_pi $COLOR -b -t 5000 +run_test ./futex_requeue_pi $COLOR -t 5000 +run_test ./futex_requeue_pi $COLOR -b -t 500000 +run_test ./futex_requeue_pi $COLOR -t 500000 +run_test ./futex_requeue_pi $COLOR -b -o -t 5000 +run_test ./futex_requeue_pi $COLOR -l -t 5000 +run_test ./futex_requeue_pi $COLOR -b -o -t 500000 +run_test ./futex_requeue_pi $COLOR -l -t 500000 # with long timeout -./futex_requeue_pi $COLOR -b -l -t 2000000000 -./futex_requeue_pi $COLOR -l -t 2000000000 +run_test ./futex_requeue_pi $COLOR -b -l -t 2000000000 +run_test ./futex_requeue_pi $COLOR -l -t 2000000000 echo -./futex_requeue_pi_mismatched_ops $COLOR +run_test ./futex_requeue_pi_mismatched_ops $COLOR echo -./futex_requeue_pi_signal_restart $COLOR +run_test ./futex_requeue_pi_signal_restart $COLOR echo -./futex_wait_timeout $COLOR +run_test ./futex_wait_timeout $COLOR echo -./futex_wait_wouldblock $COLOR +run_test ./futex_wait_wouldblock $COLOR echo -./futex_wait_uninitialized_heap $COLOR -./futex_wait_private_mapped_file $COLOR +run_test ./futex_wait_uninitialized_heap $COLOR +run_test ./futex_wait_private_mapped_file $COLOR echo -./futex_wait $COLOR +run_test ./futex_wait $COLOR echo -./futex_requeue $COLOR +run_test ./futex_requeue $COLOR echo -./futex_waitv $COLOR +run_test ./futex_waitv $COLOR + +exit $rc -- 2.42.0.609.gbb76f46606-goog