Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3609397imm; Tue, 29 May 2018 10:06:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpvMW05eqwq+U+U7vGTC0Nj7S1+MxssVXcUBCaq7E3DSJHjMLXVufUVSDt7qeH/UIjL9T4u X-Received: by 2002:a62:9f15:: with SMTP id g21-v6mr17793893pfe.207.1527613615062; Tue, 29 May 2018 10:06:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527613615; cv=none; d=google.com; s=arc-20160816; b=FgmoFUhYB85rjwGoJcccnGhgEPuXVZqIZWnWsv53COwjDT8sGOHEodRch2BNRAbJIm LkC/BEIankUlpSeyVT7bZZg8PducCLs+2B/bsm4upZ4NSYeNsO2UDZkwbCkZxmxaTSEV ULo0nu5Yl/KY7B2k3GK6MRsfa9LTs7PV+SGIh5UtxRX7YgtYiyK6yjzlqR6zUvz3eRSE IWzIouxji6Nvn513ob4I7i8KSqsAsmOYnyhVD4rqoZBc2wBDwXqvMCeY3EdFG33DHhLI n76VGZZ7IhjlE25HINfYF6bRdPGnwOWjtLixs//nSMkIE65sOxiXxpOdprrIti46g9UY MZpA== 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=ZCE7d5drxLQZ6CE2pW03n7jGEnsdvBiAjlWAVzTCwPI=; b=YcKuT3GKwObwMwID4yuJKVkozDOvdNFU0aK+ZEP5NNc1mNrXLz4DDGVWztayCaY0lq kITCPzTf1/NU9YrLKIwqTXL5xGJysdQ4XvKvwcPSlWb28HrBPTQBHmrRit0HKOEKA05/ x6i1s6V8J1Gze84wqeYlqXszzoJHhutjhwiE9uvnxGKuCSphJ/gM1RnWAnLTVesztInv V52KcW7dqzeSZOnEuTLm85CE6hRnzVKRU1+Ay1V/zFmHhU2qP3W4JDJcoe24qYwhPX8d 4su/BiMhX29S5Dh51V4GRb8MldvVb7KfSRXYwJER1h6WqF0t3RHmN/GjTIg/AQ4ddcUv wRtw== 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 s7-v6si25335479pgr.670.2018.05.29.10.06.40; Tue, 29 May 2018 10:06:55 -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 S965311AbeE2RGD (ORCPT + 99 others); Tue, 29 May 2018 13:06:03 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:39906 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965154AbeE2RGA (ORCPT ); Tue, 29 May 2018 13:06:00 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id A9AB441808; Tue, 29 May 2018 17:05:59 +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 pvhd40ywnVcI; Tue, 29 May 2018 17:05:59 +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 5C67040D72; Tue, 29 May 2018 17:05:47 +0000 (UTC) Subject: Re: [PATCH] selftests: intel_pstate: notification about privilege required to run intel_pstate testing script To: Jeffrin Jose T , kstewart@linuxfoundation.org, daniel.diaz@linaro.org, pombredanne@nexb.com, thomas@m3y3r.de, gregkh@linuxfoundation.org Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <20180526170135.3340-1-ahiliation@gmail.com> From: Shuah Khan Message-ID: <80da5a3b-fb1b-a9e5-5c4b-38b485fde688@kernel.org> Date: Tue, 29 May 2018 11:05:47 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180526170135.3340-1-ahiliation@gmail.com> 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/26/2018 11:01 AM, Jeffrin Jose T wrote: > The intel_pstate related testing script need root level privileges > when trying to access certain file for the successful execution of > the script.But this is not the case always like when using evaluation > only mode, which only require user level privilege. > > This patch is to notify the user about the privilege the script > demands for the successful execution of the test. > > Signed-off-by: Jeffrin Jose T (Rajagiri SET) > --- > tools/testing/selftests/intel_pstate/run.sh | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh > index 6ded61670f6d..4ddd389c2cb9 100755 > --- a/tools/testing/selftests/intel_pstate/run.sh > +++ b/tools/testing/selftests/intel_pstate/run.sh > @@ -33,6 +33,12 @@ EVALUATE_ONLY=0 > # Kselftest framework requirement - SKIP code is 4. > ksft_skip=4 > > +msg="skip all tests:" > +if [ $UID != 0 ] && [ $EVALUATE_ONLY == 0 ]; then > + echo $msg please run this as root >&2 > + exit $ksft_skip > +fi > + > if ! uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ | grep -q x86; then > echo "$0 # Skipped: Test can only run on x86 architectures." > exit $ksft_skip > Why not do the arch check first and then do the root check? The order of arch followed by root on non-x86 arch definitely better than root first check. thanks, -- Shuah