From patchwork Wed Mar 19 05:33:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sanjay Singh Rawat X-Patchwork-Id: 26541 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7BD74203C3 for ; Wed, 19 Mar 2014 05:35:12 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id il7sf19836277vcb.1 for ; Tue, 18 Mar 2014 22:35:12 -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: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=te5QvgBdttzDvL4hG4vTQO3Ah8ypEpLHs0Zr/dYV/Pk=; b=UgudEcROJMU7EicwO8PBAYxWaUuKTIWb5Isn8MXkLid5d38QNhyIYKn9XtECP7cfj8 bK25PaEW2YNSvBBIH19m7gss8b2BJdo7+j9xXk870OjnW9EJLv4To5cYocyAVA0j9+yP r9jKGHWg6iVuefjr9192sJC7C7kTjqYRvsXkwtdcyVcregEGwuWAQzJHW43kPfi738F0 V72MuW/ElyTpu69a4aMl2lqRZQPBefKn15OhCtiJbP+XTlJvgxmZko+tpALnwbVp3xWG 4oLEW+J59qhTJFXWcV/L4BE7Ji4frU6or6873FMABl4Ir+eY02Zw6z8U6u/+VD7VKn4l qXsA== X-Gm-Message-State: ALoCoQm+BOvRVG5XNq9IqHLQ/Gx7d/5n+3wzgdOSJtwDgL/3dlHGvdHpEjuq6zqccB7GdXiFhvv4 X-Received: by 10.58.171.135 with SMTP id au7mr4443917vec.22.1395207312282; Tue, 18 Mar 2014 22:35:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.16.73 with SMTP id 67ls576072qga.18.gmail; Tue, 18 Mar 2014 22:35:12 -0700 (PDT) X-Received: by 10.58.96.36 with SMTP id dp4mr7890522veb.21.1395207312157; Tue, 18 Mar 2014 22:35:12 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id e11si1218074vco.137.2014.03.18.22.35.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Mar 2014 22:35:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id la4so8646637vcb.3 for ; Tue, 18 Mar 2014 22:35:12 -0700 (PDT) X-Received: by 10.58.162.168 with SMTP id yb8mr7798798veb.9.1395207312082; Tue, 18 Mar 2014 22:35:12 -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.220.78.9 with SMTP id i9csp270914vck; Tue, 18 Mar 2014 22:35:11 -0700 (PDT) X-Received: by 10.68.7.66 with SMTP id h2mr37119265pba.91.1395207311037; Tue, 18 Mar 2014 22:35:11 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id a8si12473059pbs.207.2014.03.18.22.35.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Mar 2014 22:35:10 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of sanjay.rawat@linaro.org) client-ip=209.85.160.50; Received: by mail-pb0-f50.google.com with SMTP id md12so8364823pbc.23 for ; Tue, 18 Mar 2014 22:35:10 -0700 (PDT) X-Received: by 10.66.141.197 with SMTP id rq5mr38174306pab.64.1395207310556; Tue, 18 Mar 2014 22:35:10 -0700 (PDT) Received: from srawat-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id pe3sm58382161pbc.23.2014.03.18.22.35.07 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Mar 2014 22:35:09 -0700 (PDT) From: Sanjay Singh Rawat To: sanjay.rawat@linaro.org Subject: [PATCH PMQA] suspend: add suspend sanity test Date: Wed, 19 Mar 2014 11:03:27 +0530 Message-Id: <1395207207-5191-1-git-send-email-sanjay.rawat@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sanjay.rawat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: , check for suspend support in the system Signed-off-by: Sanjay Singh Rawat --- suspend/suspend_sanity.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 suspend/suspend_sanity.sh diff --git a/suspend/suspend_sanity.sh b/suspend/suspend_sanity.sh new file mode 100755 index 0000000..a86fddb --- /dev/null +++ b/suspend/suspend_sanity.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# +# PM-QA validation test suite for the power management on Linux +# +# Copyright (C) 2014, Linaro Limited. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Contributors: +# Sanjay Singh Rawat +# - initial API and implementation +# + +source ../include/functions.sh + +is_root +if [ $? -ne 0 ]; then + log_skip "user is not root" + exit 0 +fi + +check_suspend() { + cat /sys/power/suspend | grep 'mem\|standby\|disk' + if [ $? -ne 0 ]; then + echo "suspend is not supported. Skipping all suspend tests" + return 0 + fi + return 1 +} + +check_utils