From patchwork Thu Apr 2 03:43:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 46698 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8B2EF216D1 for ; Thu, 2 Apr 2015 03:43:50 +0000 (UTC) Received: by wgiv13 with SMTP id v13sf2405827wgi.3 for ; Wed, 01 Apr 2015 20:43:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=BPCCTvbj93ZB2dyOhBjd04LRiiwwiFR09Ln6JuAUnlA=; b=kcvqBetw5BCde7hIPZU85/nHVISzupSNxkqB8y/EVfysnh5g7sYJ+7SkiXr3Nwf/QU F8a62/iEsJxXvoKKIbQXo7n546gibC92gkaMGaVDhLVse0Eaxe/AXnl3A8FBX/iyLl3l keaycwJ3NTj2whE9Zor1+hhiQP01YCjvATMxuE6FmIAqYfzPD16HvaphbeU9GoD3ZEM3 Y5bNWec83CGBdGi3t5RKZuhrNnBy0m2jM5rwKdqUeSnE+F07xJuXsZb0cbTiWe4EKwOl WMbs70R+v4REkaMMjx/2bs+YrUr/wXuTIMx6sJ6Dv9rTX1VbNweLwkANaRfgYlBBGCLx kOPQ== X-Gm-Message-State: ALoCoQkzMVPMYo0zkuOu/oyAjYFczQ1CuYCXO1keLYxvP+JxWOqWDx3HWhn1bGj5s5H0DveP153W X-Received: by 10.112.67.74 with SMTP id l10mr3098294lbt.23.1427946229822; Wed, 01 Apr 2015 20:43:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.198.232 with SMTP id jf8ls158012lac.83.gmail; Wed, 01 Apr 2015 20:43:49 -0700 (PDT) X-Received: by 10.152.87.162 with SMTP id az2mr22473073lab.58.1427946229684; Wed, 01 Apr 2015 20:43:49 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id l14si3150313lbh.59.2015.04.01.20.43.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Apr 2015 20:43:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbbzk7 with SMTP id zk7so34305926lbb.0 for ; Wed, 01 Apr 2015 20:43:49 -0700 (PDT) X-Received: by 10.152.197.34 with SMTP id ir2mr12061040lac.36.1427946229570; Wed, 01 Apr 2015 20:43:49 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.57.201 with SMTP id k9csp1066249lbq; Wed, 1 Apr 2015 20:43:48 -0700 (PDT) X-Received: by 10.70.2.98 with SMTP id 2mr81963448pdt.91.1427946226580; Wed, 01 Apr 2015 20:43:46 -0700 (PDT) Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com. [209.85.192.171]) by mx.google.com with ESMTPS id qf2si5579119pdb.137.2015.04.01.20.43.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Apr 2015 20:43:46 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.192.171 as permitted sender) client-ip=209.85.192.171; Received: by pdbni2 with SMTP id ni2so75826457pdb.1 for ; Wed, 01 Apr 2015 20:43:45 -0700 (PDT) X-Received: by 10.66.66.196 with SMTP id h4mr82079290pat.127.1427946224932; Wed, 01 Apr 2015 20:43:44 -0700 (PDT) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id bz3sm3599156pab.2.2015.04.01.20.43.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Apr 2015 20:43:43 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Shuah Khan , Prarit Bhargava , Thomas Gleixner , Richard Cochran Subject: [PATCH v2] kselftests: timers: Make set-timer-lat fail more gracefully for !CAP_WAKE_ALARM Date: Wed, 1 Apr 2015 20:43:39 -0700 Message-Id: <1427946219-31113-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The set-timer-lat test fails when testing CLOCK_BOOTTIME_ALARM or CLOCK_REALTIME_ALARM when the user isn't running as root or with CAP_WAKE_ALARM. So this patch improves the error checking so we report the issue more clearly and continue rather then reporting a failure. Cc: Shuah Khan Cc: Prarit Bhargava Cc: Thomas Gleixner Cc: Richard Cochran Signed-off-by: John Stultz --- v2: Fix a few checkpatch warnings. tools/testing/selftests/timers/set-timer-lat.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/testing/selftests/timers/set-timer-lat.c b/tools/testing/selftests/timers/set-timer-lat.c index 2ed3267..4fc98c5 100644 --- a/tools/testing/selftests/timers/set-timer-lat.c +++ b/tools/testing/selftests/timers/set-timer-lat.c @@ -139,6 +139,13 @@ int do_timer(int clock_id, int flags) err = timer_create(clock_id, &se, &tm1); if (err) { + if ((clock_id == CLOCK_REALTIME_ALARM) || + (clock_id == CLOCK_BOOTTIME_ALARM)) { + printf("%-22s %s missing CAP_WAKE_ALARM? : [UNSUPPORTED]\n", + clockstring(clock_id), + flags ? "ABSTIME":"RELTIME"); + return 0; + } printf("%s - timer_create() failed\n", clockstring(clock_id)); return -1; }