Received: by 10.192.165.148 with SMTP id m20csp1109320imm; Wed, 2 May 2018 14:20:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrbwbaTY4U5P+QetIQQo+M+If4WnT8GGEzL/cpVzWx6ZG3zofm1C1J3MeRM1UF0ynbHYAL6 X-Received: by 2002:a63:751a:: with SMTP id q26-v6mr17129564pgc.338.1525296046419; Wed, 02 May 2018 14:20:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525296046; cv=none; d=google.com; s=arc-20160816; b=n3YgMETmq5vQYq80Kxpzyd26YObQ9k2FzyHDVAeanOMZqOzxh8P6Fg4aKuNoasra+S chL9idD73n6ofwuIv7u3A+joyTZ1Byi0oW+h4T5z0dvuRSbFR1CGWhX/cN76zInbduzs ojxVt8CGHNjNvwKhT+ZV64TFH8mBX7xISD8iswYpZBTvQAecDKlvFfqQHKJAGL3/yibf RQ/+RiUcnOwhOIbH8ZJChR9izVf7HcB8EA7kVoMEj2tuJtsEBKTjfi8uNYf148qYM6Ph RUkZ7Z+yqAfL859cx/JYBs2FN1mfO3/l5bYfELVRsF1kZaBu+Ul8/HWtaMs333h4mKGi lt7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=rG7ZXSpc/W8bVlCBPfHJ610LHHxpsq3lNpUkSWP/2r8=; b=SNEtKHmQLnjokSmNVng6VTN1eu6sB6PW8ofAUjqro/xK+YiYp0ILSfkq9DnMvblezE uLoj4yo69J0vPUMv69bYjviPdcsIFTb79OoLNuLZPca7Xh2gbfNVZOMW4iXzPWndUUFM 4k7vXgpHeGoVhV2Lz2FmcjxlVHkQF/MTU5fgIWWhvySZ1gJqvDgbGNYnbcyNJoipEEQ5 4+/i3HLcIZsLKfUGuTdmDsvAqmK7Id+YNpViyKRr8t/dfoCnuw4oz3kjxw3FGHEptY12 VlLuFXe9LIW5l34UAf1jGvtGNNDb2qrJBkTZa4DMpUR/iovOw5WNc2ke6hN7Xf9SI8lT QLGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1-v6si12145024pld.510.2018.05.02.14.20.31; Wed, 02 May 2018 14:20:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751991AbeEBVTo (ORCPT + 99 others); Wed, 2 May 2018 17:19:44 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:53278 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751864AbeEBVTk (ORCPT ); Wed, 2 May 2018 17:19:40 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id AB38C41AF3; Wed, 2 May 2018 21:19:39 +0000 (UTC) Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo03-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nNv3xaPYxph2; Wed, 2 May 2018 21:19:39 +0000 (UTC) Received: from localhost.localdomain (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id BB65041CE2; Wed, 2 May 2018 21:19:35 +0000 (UTC) From: "Shuah Khan (Samsung OSG)" To: shuah@kernel.org Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH] selftests: mount: delete RUN_TESTS and EMIT_TESTS overrides Date: Wed, 2 May 2018 15:18:47 -0600 Message-Id: <20180502211848.22404-4-shuah@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180502211848.22404-1-shuah@kernel.org> References: <20180502211848.22404-1-shuah@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Delete RUN_TESTS and EMIT_TESTS overrides and use common defines in lib.mk. Add new run_tests.sh to do the dependency checks the custom RUN_TESTS did. Common defines work with the run_tests.sh set as the TEST_PROGS and defining unprivileged-remount-test in TEST_GEN_FILES. Kselftest framework builds and installs TEST_GEN_FILES and doesn't run them via RUN_TESTS and include it in EMIT_TESTS. With this change the new run_tests.sh runs the test after checking dependencies. This change also adds Skip handling to return kselftest skip code when test is skipped to clearly identify when the test is skipped instead of reporting it as failed. Output with this change: TAP version 13 selftests: mount: run_tests.sh ======================================== WARN: No /proc/self/uid_map exist, test skipped. not ok 1..1 selftests: mount: run_tests.sh [SKIP] Signed-off-by: Shuah Khan (Samsung OSG) --- tools/testing/selftests/mount/Makefile | 12 ++---------- tools/testing/selftests/mount/run_tests.sh | 12 ++++++++++++ 2 files changed, 14 insertions(+), 10 deletions(-) create mode 100755 tools/testing/selftests/mount/run_tests.sh diff --git a/tools/testing/selftests/mount/Makefile b/tools/testing/selftests/mount/Makefile index e094f71c6dbc..026890744215 100644 --- a/tools/testing/selftests/mount/Makefile +++ b/tools/testing/selftests/mount/Makefile @@ -3,15 +3,7 @@ CFLAGS = -Wall \ -O2 -TEST_GEN_PROGS := unprivileged-remount-test +TEST_PROGS := run_tests.sh +TEST_GEN_FILES := unprivileged-remount-test include ../lib.mk - -override RUN_TESTS := if [ -f /proc/self/uid_map ] ; \ - then \ - ./unprivileged-remount-test ; \ - else \ - echo "WARN: No /proc/self/uid_map exist, test skipped." ; \ - fi -override EMIT_TESTS := echo "$(RUN_TESTS)" - diff --git a/tools/testing/selftests/mount/run_tests.sh b/tools/testing/selftests/mount/run_tests.sh new file mode 100755 index 000000000000..4ab8f507dcba --- /dev/null +++ b/tools/testing/selftests/mount/run_tests.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 + +# Run mount selftests +if [ -f /proc/self/uid_map ] ; then + ./unprivileged-remount-test ; +else + echo "WARN: No /proc/self/uid_map exist, test skipped." ; + exit $ksft_skip +fi -- 2.14.1