From patchwork Tue Apr 9 23:55:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10892877 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 732861800 for ; Tue, 9 Apr 2019 23:56:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C4F528387 for ; Tue, 9 Apr 2019 23:56:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50E3628727; Tue, 9 Apr 2019 23:56:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0134328387 for ; Tue, 9 Apr 2019 23:56:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726748AbfDIX4K (ORCPT ); Tue, 9 Apr 2019 19:56:10 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:37010 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726741AbfDIX4K (ORCPT ); Tue, 9 Apr 2019 19:56:10 -0400 Received: by mail-pl1-f195.google.com with SMTP id w23so200465ply.4 for ; Tue, 09 Apr 2019 16:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Y/RpihLB9WB13L/MPSV54cuBFONpGo1gl+FackKYf7M=; b=fMjZ62MyDP6Fqd1QMdlAhjj5DZJ424E2zEmOfhTxRBPMJRHLoG8qiu/+J1RNQDYG1f BYpJMxiy15aHzUcTTG72jnvosXPIKOmv23sXSMQxRyAcZw3Ar4Bv3c6h4GLYRq3DNifX VkNGnPkj4aSx/nCdLaur0vbIhdBQqEt/lOpoQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Y/RpihLB9WB13L/MPSV54cuBFONpGo1gl+FackKYf7M=; b=b1WT4Na4fmeKiApMAZJZ+Ip7aTE6ERmNpl7JMpHV5QcTjHWcruPfnkuM5GiZ+TWpwc Ic4VQpnij+rxMVQ5qd9UUuLTORzo0HNPF4UdZHeuuZmX0ZWupUK3NiMzsCAvZPjgatcy oSsmUe9EbSByKijyvsXD7qA1/KvxGFrMpIPxe0QwkjUyemWx0MyJxR6TryUDZWfeUwbH Ef/KncBORoqsnlB1M8W6SPKpHcRDjs5fTTiLehISpNbMliElzufAhJ5kJiF0wErYDujl Ls3D39Ow4BOHCzy3DzPR25xjAMYIWyIBxkwxHTMRyOqAvKYxGe+etr+N+9Zx+Y+Oswgw mDFQ== X-Gm-Message-State: APjAAAWx2FAfiCMApnttdTvMTF+8mQueJpNRpRxSk1h5CyQbzCLW18IN SI7N7h3HzXRS+eMopsG8dDqInA== X-Google-Smtp-Source: APXvYqzDsGOxH0rTx1Jjqe62/jhM+aRczFBXPlyL8O/qW6JjWw+PeBJc1NGnh77e6tt5aNhh8FNXDg== X-Received: by 2002:a17:902:599d:: with SMTP id p29mr14340476pli.156.1554854169891; Tue, 09 Apr 2019 16:56:09 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id d3sm50075110pfn.113.2019.04.09.16.56.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2019 16:56:09 -0700 (PDT) From: Kees Cook To: Shuah Khan Cc: Kees Cook , linux-kselftest@vger.kernel.org Subject: [PATCH 5/6] selftests/runner: Distinguish between missing and non-executable Date: Tue, 9 Apr 2019 16:55:55 -0700 Message-Id: <20190409235556.3967-6-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190409235556.3967-1-keescook@chromium.org> References: <20190409235556.3967-1-keescook@chromium.org> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- tools/testing/selftests/kselftest/runner.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kselftest/runner.sh b/tools/testing/selftests/kselftest/runner.sh index 7f8d6b127693..5793660dbe3f 100644 --- a/tools/testing/selftests/kselftest/runner.sh +++ b/tools/testing/selftests/kselftest/runner.sh @@ -17,7 +17,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