From: Kees Cook Date: Wed, 24 Apr 2019 23:12:34 +0000 (-0700) Subject: selftests: Distinguish between missing and non-executable X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=fd63b2eae5f6ff91ab60819ef083136aebb0e88b;p=linux.git selftests: Distinguish between missing and non-executable If a test was missing (e.g. wrong architecture, etc), the test runner would incorrectly claim the test was non-executable. This adds an existence check to report correctly. Signed-off-by: Kees Cook Signed-off-by: Shuah Khan --- diff --git a/tools/testing/selftests/kselftest/runner.sh b/tools/testing/selftests/kselftest/runner.sh index e0621974e01e5..a66fb64e61e9e 100644 --- a/tools/testing/selftests/kselftest/runner.sh +++ b/tools/testing/selftests/kselftest/runner.sh @@ -19,7 +19,12 @@ run_one() echo "$TEST_HDR_MSG" echo "========================================" if [ ! -x "$TEST" ]; then - echo "$TEST_HDR_MSG: Warning: file $TEST is not executable, correct this." + echo -n "$TEST_HDR_MSG: Warning: file $TEST is " + if [ ! -e "$TEST" ]; then + echo "missing!" + else + echo "not executable, correct this." + fi echo "not ok $test_num $TEST_HDR_MSG" else cd `dirname $TEST` > /dev/null