From patchwork Sat May 26 17:01:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeffrin Jose T X-Patchwork-Id: 10429055 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4868B60225 for ; Sat, 26 May 2018 17:02:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D04629352 for ; Sat, 26 May 2018 17:02:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 208712947B; Sat, 26 May 2018 17:02:06 +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=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 98CCB29352 for ; Sat, 26 May 2018 17:02:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032115AbeEZRCF (ORCPT ); Sat, 26 May 2018 13:02:05 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:44134 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031950AbeEZRCE (ORCPT ); Sat, 26 May 2018 13:02:04 -0400 Received: by mail-pg0-f67.google.com with SMTP id p21-v6so3554817pgd.11; Sat, 26 May 2018 10:02:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=kAPvJEJkinz0dicyhdvIO/1avu9lwIcFnAEhhEZUitM=; b=cq6/Lror0wMpdkDk2FAmdwy3mIyL+n7INiwD6ypG0os3ME/yyhVrJqCRgK+OojruH2 4rZ2/4LcEbbTKUZm2K+FXdIQl5Irlo+CYe6WntZCdNwGwrS9P5RbOSigcdAsIPGe5Qis lmL6e+h5UGqMhBIwO/UrnHrX3QYP/2PHh46EvwQ1v7nad/iiYmUZR0Q+j6EM+ib6Kvs9 39BX3M/++kFVviWvhSad7BasSmUfrcRSIWTwf53rOjHDPp6u12C5Ie55QLFsmwrHDZIz FXFNC91/VJ6N2L7bP8i8cllpwEvSrouJw4AZgTZ2zBtSeRMmhAjAdDbQm+D7JoQ/VcT2 /Wsg== 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; bh=kAPvJEJkinz0dicyhdvIO/1avu9lwIcFnAEhhEZUitM=; b=Wc1/XKp8tTr2AA/m+Oh6GPTp5wioBlrB6CTxu9nwrSWg6XsupT4VRZkcJowLIPwvxc 3uJnyG0uOo39j6o+0a7PLz0gSXVTlUaQIS95upoep9mH2dYvzx0eaeddOCrfoE4YrKxl QYs/wK1OEVD+AQ4BmXds3rB2Qxgu5d0cJHiT4AnMmW82YCJ0vlOOtBhS4KgFEHhfiZxk 5ztxx7SHApPwdUP3RBYE4nm3Mxdm7xxsqZsHAK2BbituBHKxxzHtAH4bDxv90n1wKOXp EbffWlqCyd/gbNshsOUm+WibyLxxVr9zLa493gIreEjLJCZw1rzwfVaf5huKQ/zpc917 b4cA== X-Gm-Message-State: ALKqPwen19Fcyt+w7jO/yZw/oi4okfKeyptWJ0HUnBEjKhOrBDhoQBoa mZKPiMZ29Nh2LXE4zDSIRMQ= X-Google-Smtp-Source: AB8JxZq2WeQ7kUv0I78aHHCQA/nR0QLxV3BhOkCQDjsC6AkDYmpVSGYPasGYk+pMUX5yPXv9Z+08SA== X-Received: by 2002:a63:31d4:: with SMTP id x203-v6mr5352574pgx.389.1527354123825; Sat, 26 May 2018 10:02:03 -0700 (PDT) Received: from localhost.localdomain ([122.164.36.47]) by smtp.gmail.com with ESMTPSA id t24-v6sm53579572pfj.75.2018.05.26.10.02.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 26 May 2018 10:02:03 -0700 (PDT) From: Jeffrin Jose T To: shuah@kernel.org, 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, Jeffrin Jose T Subject: [PATCH] selftests: intel_pstate: notification about privilege required to run intel_pstate testing script Date: Sat, 26 May 2018 22:31:35 +0530 Message-Id: <20180526170135.3340-1-ahiliation@gmail.com> X-Mailer: git-send-email 2.17.0 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 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