Received: by 10.192.165.148 with SMTP id m20csp3546150imm; Mon, 7 May 2018 14:17:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpKJqQQQJxX5X5cHL/+C/GfrCW/QPpGkK2yHEWhsw7KmdVqsdDs67L8fwU431lKAVtjM09a X-Received: by 2002:a17:902:5a88:: with SMTP id r8-v6mr39017001pli.78.1525727850794; Mon, 07 May 2018 14:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525727850; cv=none; d=google.com; s=arc-20160816; b=SNAHjCJTbuTOXmq8Ti22uvKnDuj4NwYhLgfKFLsH0IxYsFTj8P8N0UIeRwHxPgW+zH bNnHR3CO/cbWFvaPGGG8fC8Jq8DgmGbPcxk46dciFvOmXopBkegvjaemM3f6ZGAP7a1w JJFOnggKrsjb42HLp/qO0yYYEPvybuRJfka3j4guSwfbOqsSNPVAyeKhRt31ZmAxwECu JlUhEukJoPbS2OTPtY8W7AZlwdT5X3PV9y2TU0To1vH+bThtIZ+5a10us4tVHMDxCcqK yO/GL7fJqhq4PHZZSc1WZjXrLmWG4v2CyXuXEemUQtbNfD2bQ16J1EUCUE3QlK+mIu0q 6AbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=SqSTNo5uDna9zE5+BuekYNc8amt6O8JhTy4HCM3Q+cE=; b=ER3vSUISl/GHqHjQmECjcp28jikMtMXzrHH6prp6MDloxtkAPKJqDIBMXcaml6e4C7 bO9Zprmrg6G6KryfiTMhC23aIp6SDaGbOTfzD2rcvqxQQpvWPBzFhm8fxw8Z3qIxUibu nVz3OPILJaGAnfHWJaPxNAfuZMC+u3XFvJVaypsRKccMv0BsD+tVWz88khqSxJ7ztp4o 9nbhU23tkjhekBgir89G5HB8rJl7p+e6/3MMSpVo5DbBUrR2hzLJA2ErlxIDMcGMt3xD Af7eMjd6zCBmZ6bjCcyn9oALFxFAorn0vEM+DjR64kzGG6tu05ugMlnY5byXT7d1S/It l+mw== 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=NONE sp=NONE 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 t5-v6si1123015ply.598.2018.05.07.14.17.16; Mon, 07 May 2018 14:17:30 -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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753361AbeEGVQ3 (ORCPT + 99 others); Mon, 7 May 2018 17:16:29 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:45853 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752524AbeEGVQ2 (ORCPT ); Mon, 7 May 2018 17:16:28 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id E5777C14B4; Mon, 7 May 2018 21:16:27 +0000 (UTC) Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo01-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SZCJMNlUnRd0; Mon, 7 May 2018 21:16:27 +0000 (UTC) Received: from [192.168.1.87] (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 67F44C0623; Mon, 7 May 2018 21:16:16 +0000 (UTC) Subject: Re: [PATCH 21/24] selftests: memfd: return Kselftest Skip code for skipped tests To: Mike Kravetz , akpm@linux-foundation.org, marcandre.lureau@redhat.com, lizhijian@cn.fujitsu.com Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <20180505011328.32078-1-shuah@kernel.org> <20180505011328.32078-21-shuah@kernel.org> From: Shuah Khan Message-ID: <72a499bc-5c32-b553-88c6-a56704c398fc@kernel.org> Date: Mon, 7 May 2018 15:16:16 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/07/2018 12:45 PM, Shuah Khan wrote: > On 05/04/2018 07:52 PM, Mike Kravetz wrote: >> On 05/04/2018 06:13 PM, Shuah Khan (Samsung OSG) wrote: >>> When memfd test is skipped because of unmet dependencies and/or unsupported >>> configuration, it returns non-zero value which is treated as a fail by the >>> Kselftest framework. This leads to false negative result even when the test >>> could not be run. >>> >>> Change it to return kselftest skip code when a test gets skipped to >>> clearly report that the test could not be run. >>> >>> Added an explicit check for root user and return skip code. >>> >>> Kselftest framework SKIP code is 4 and the framework prints appropriate >>> messages to indicate that the test is skipped. >>> >>> Signed-off-by: Shuah Khan (Samsung OSG) >>> --- >>> tools/testing/selftests/memfd/run_tests.sh | 10 +++++++++- >>> 1 file changed, 9 insertions(+), 1 deletion(-) >>> >>> diff --git a/tools/testing/selftests/memfd/run_tests.sh b/tools/testing/selftests/memfd/run_tests.sh >>> index c2d41ed81b24..88dc206a69b7 100755 >>> --- a/tools/testing/selftests/memfd/run_tests.sh >>> +++ b/tools/testing/selftests/memfd/run_tests.sh >>> @@ -1,6 +1,14 @@ >>> #!/bin/bash >>> # please run as root >>> >>> +# Kselftest framework requirement - SKIP code is 4. >>> +ksft_skip=4 >>> + >>> +if [ $UID != 0 ]; then >>> + echo "Please run this test as root" >>> + exit $ksft_skip >>> +fi >>> + Moving root check this far up messes the test up and requires root access for run_fuse_test.sh and memfd_test which is incorrect. I will re-do the patch thanks, -- Shuah