]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
selftests: Distinguish between missing and non-executable
authorKees Cook <keescook@chromium.org>
Wed, 24 Apr 2019 23:12:34 +0000 (16:12 -0700)
committerShuah Khan <skhan@linuxfoundation.org>
Thu, 25 Apr 2019 19:15:10 +0000 (13:15 -0600)
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 <keescook@chromium.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/kselftest/runner.sh

index e0621974e01e50ff22792d4fe2140e2a0438afbe..a66fb64e61e9e966f62bc4f063a14f7d84808888 100644 (file)
@@ -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