Received: by 10.192.165.148 with SMTP id m20csp5331444imm; Wed, 9 May 2018 03:20:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpGRizOXLAxcODCiChemwRHrme9/AhcR9RNehsierNWoUqe+tR63D1iud7xLegzpITsYYhZ X-Received: by 2002:a65:61c8:: with SMTP id j8-v6mr26132833pgv.370.1525861242231; Wed, 09 May 2018 03:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525861242; cv=none; d=google.com; s=arc-20160816; b=rwEcJLOf23DyqsDK3NdX/PZs75/p61LhlkfsuErTQKZzx4XyKlNb3fSR5vfiWBJ8Em WrMVfhd+BSfbhrPTY61x6mFq4rVHuWYswf0jMCWVvpTkIRSUuo/C4/gTw9aD7iVCkr8u WW03BDKO9l+6yMhnMh3SiNPpGnIFscJnitKMUcpjIzIa1lFUZaW9k2pIOFYsOQxraxLW ipt04xoCTOEna7ThZYnHZAZHJ1h0MWGP7A/aunplaeSdEyJSMwZOnUTMWqoYTLnP9eXu VvpoES87iGBcVSPTWM4UOEzxmHsAcwR5y7lSv4GH0K0GoYEI+JiqB+QnZRmn59ALNfaF jzgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=7QHzkjIxc/KAyr7jv3RVTACL54t9EctDFNLJiIsJWmU=; b=QKxs0CyRUl7bP1mD7bhOZYLiDL45g2wEmdnliNaoJbMwQD310eyXdbiKkJ/rDGEaod DrVqXHfnBzb0rkxaF3KQvNXOoLoZDK5xuX8B/1xPozSoAQRBcyLgjpUDCWoGL1H94HkR 3BLq1uqWgL6wv97BH6Se3ItfW2NpYcT/tVhCl3I2mvFZtqLTzSLtI3EfX/YcrRNaFsIn EnmBRgkFN+5kIMIY++uf/5AzXkpK4u201TqMbfCAeRRp0EiL39UX9BTimlglRwNR27/U wrd2MQ3l7r5ywDNhQb9f10Uw5vjoY4Yik2sxK/eYQV4mIa7VsQPZWU25gN2OwBDqmZzt +/1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jp5eun12; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p11-v6si16772952plk.294.2018.05.09.03.20.27; Wed, 09 May 2018 03:20:42 -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; dkim=pass header.i=@linaro.org header.s=google header.b=Jp5eun12; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934038AbeEIKTK (ORCPT + 99 others); Wed, 9 May 2018 06:19:10 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:37368 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932215AbeEIKTJ (ORCPT ); Wed, 9 May 2018 06:19:09 -0400 Received: by mail-lf0-f65.google.com with SMTP id r2-v6so14030022lff.4 for ; Wed, 09 May 2018 03:19:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7QHzkjIxc/KAyr7jv3RVTACL54t9EctDFNLJiIsJWmU=; b=Jp5eun12GsnX1YrQn2eaK6EGPJdTfaKHy6Wxah/V9DvXPQyEoC9gRqoa4IW5rZpGDG ErIqkKWM/pr9qtwk3kVCzB0L6L540pc3bk72+/7FfeaZJNxjJ6ner9cVqLH0LB9oK4Mt 4AdYGrUl5aZJrKWf2fTpXUYVIE7opkJEqNX/g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7QHzkjIxc/KAyr7jv3RVTACL54t9EctDFNLJiIsJWmU=; b=eMrGY0bAxi+9qMCHASTEa8et2v17Wh5CTK7z6Mv+tRaWXQUndvKp8bkSWidSGsAbc8 tGJtP8ZRy8MX34sQulVaic8gVoqru+yH3Q6ETtpDaDeWZ0eXj9FSDNxuCzvJV4ZGebTX H7hv8qUYKp+zeKlNKD7SzJDrZtHuBgPGQLByIATnS0wdvYOKjggv9ItLXTAz8h/qZw4X fDAY+rflAZ8QGWpznnTxzIA9toUr76aBX5hRUGwGGfjk5GokU+vtMLan4+XqIw0zbfPh KEnPd3cQKvJ7vkB9wndWEaeSpRqzogjmXNdCLdlliMYJOFCokdaE2SqjZosLE8MQTZKX UFiw== X-Gm-Message-State: ALKqPwdvxH5MciQ8wpK/iztPb/DoXkFDfi9Rk3GKJU+TZpEr1Yxr0Br1 AVY5ctVd/yr4dazvJciPRgdhI2+1Zqs= X-Received: by 2002:a19:8214:: with SMTP id e20-v6mr3486258lfd.44.1525861147999; Wed, 09 May 2018 03:19:07 -0700 (PDT) Received: from localhost.localdomain (c-2c3d70d5.07-21-73746f28.cust.bredbandsbolaget.se. [213.112.61.44]) by smtp.gmail.com with ESMTPSA id r8-v6sm5141749ljc.8.2018.05.09.03.19.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 May 2018 03:19:07 -0700 (PDT) Date: Wed, 9 May 2018 11:49:00 +0200 From: Anders Roxell To: "Shuah Khan (Samsung OSG)" Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH] selftests: mount: delete RUN_TESTS and EMIT_TESTS overrides Message-ID: <20180509094900.GC10043@localhost.localdomain> References: <20180502211848.22404-1-shuah@kernel.org> <20180502211848.22404-4-shuah@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180502211848.22404-4-shuah@kernel.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-05-02 15:18, Shuah Khan (Samsung OSG) wrote: > 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) Reviewed-by: Anders Roxell > --- > 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 >