From patchwork Wed Jan 29 07:03:19 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: 23823 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f69.google.com (mail-vb0-f69.google.com [209.85.212.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 85751206A0 for ; Wed, 29 Jan 2014 07:03:40 +0000 (UTC) Received: by mail-vb0-f69.google.com with SMTP id m10sf3076335vbh.0 for ; Tue, 28 Jan 2014 23:03:39 -0800 (PST) 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=BegIbgNhE3Vm1yof/3UkpxCYysxerfYFaVPv0SNDuME=; b=MlX/O4fY8gXrZIdH+oeD+PZxZEelrWhYXzY9GG/i6fhg3kV4cGJYbPC3yxbdL/5Mx/ NurhzngR7/pMvZPFQW7h89QD1aaMEXOZ8hUyy2DvjrOBs5eaLob1mWmf0o71VYok9BrV rhvUSvehYucOvLwYsQ2jiPsBomrGTAeBg3npKQ+DhQYxqxH3XeLBO+JHEeSZhpVneGKL gMPIsqbqJgDDonx1lJnF7BrK6HMiISHeWve64BbIVZ/3eQq11FHshznliEJwhf4py/eR t+WyJgVfQGF9Sf4rENBnjC02rDLhXLScgsJ/xas4489Jd73b6PMFlfLStVnLcz1Ogai6 yBaw== X-Gm-Message-State: ALoCoQm2gwyxt3zgaLyDgJxglUoz2wRDhjvucUkD9decrBLRcaXX1IjDEoEDIMNHKujKoQ+Q6yEx X-Received: by 10.52.184.228 with SMTP id ex4mr1998386vdc.1.1390979019734; Tue, 28 Jan 2014 23:03:39 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.27.119 with SMTP id 110ls2302802qgw.28.gmail; Tue, 28 Jan 2014 23:03:39 -0800 (PST) X-Received: by 10.220.131.210 with SMTP id y18mr5239013vcs.12.1390979019625; Tue, 28 Jan 2014 23:03:39 -0800 (PST) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id kp12si488778vcb.91.2014.01.28.23.03.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 Jan 2014 23:03:39 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id jx11so932462veb.38 for ; Tue, 28 Jan 2014 23:03:39 -0800 (PST) X-Received: by 10.58.7.1 with SMTP id f1mr5067032vea.15.1390979019546; Tue, 28 Jan 2014 23:03:39 -0800 (PST) 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.174.196 with SMTP id u4csp90722vcz; Tue, 28 Jan 2014 23:03:39 -0800 (PST) X-Received: by 10.66.248.227 with SMTP id yp3mr6153626pac.116.1390979018504; Tue, 28 Jan 2014 23:03:38 -0800 (PST) Received: from mail-pb0-f45.google.com (mail-pb0-f45.google.com [209.85.160.45]) by mx.google.com with ESMTPS id k3si1375335pbb.294.2014.01.28.23.03.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 Jan 2014 23:03:38 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.45 is neither permitted nor denied by best guess record for domain of sanjay.rawat@linaro.org) client-ip=209.85.160.45; Received: by mail-pb0-f45.google.com with SMTP id un15so1401904pbc.32 for ; Tue, 28 Jan 2014 23:03:38 -0800 (PST) X-Received: by 10.68.163.196 with SMTP id yk4mr382296pbb.41.1390979018079; Tue, 28 Jan 2014 23:03:38 -0800 (PST) Received: from srawat-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id ei4sm3664536pbb.42.2014.01.28.23.03.33 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 Jan 2014 23:03:36 -0800 (PST) From: Sanjay Singh Rawat To: private-pmwg@linaro.org Cc: Sanjay Singh Rawat Subject: [PATCH pmqa] test feature supported before running suite Date: Wed, 29 Jan 2014 12:33:19 +0530 Message-Id: <1390978999-13618-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.128.179 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: , add a basic sanity file which will check for feature support and will proceed only if feature supported Signed-off-by: Sanjay Singh Rawat --- - sanity file will run first to check for feature support. - added entry for sanity file for android - this will need a change in the lava pm-qa trigger script for the tests, will make the change separately now. regards, sanjay --- cpufreq/Android.mk | 2 +- cpufreq/cpufreq_sanity.sh | 40 +++++++++++++++++++++++++++++++++ cpufreq/cpufreq_sanity.txt | 1 + cpuhotplug/Android.mk | 2 +- cpuhotplug/cpuhotplug_sanity.sh | 45 ++++++++++++++++++++++++++++++++++++++ cpuhotplug/cpuhotplug_sanity.txt | 1 + cpuidle/Android.mk | 2 +- cpuidle/cpuidle_sanity.sh | 8 +++++-- cpuidle/cpuidle_sanity.txt | 2 +- thermal/Android.mk | 2 +- thermal/thermal_sanity.sh | 7 +++++- 11 files changed, 104 insertions(+), 8 deletions(-) create mode 100755 cpufreq/cpufreq_sanity.sh create mode 100644 cpufreq/cpufreq_sanity.txt create mode 100755 cpuhotplug/cpuhotplug_sanity.sh create mode 100644 cpuhotplug/cpuhotplug_sanity.txt diff --git a/cpufreq/Android.mk b/cpufreq/Android.mk index 2da6056..bd07fae 100644 --- a/cpufreq/Android.mk +++ b/cpufreq/Android.mk @@ -14,5 +14,5 @@ define $(module_name)_add_executable include $(BUILD_PREBUILT) endef -test_num := 01 02 03 04 05 06 07 08 09 +test_num := sanity 01 02 03 04 05 06 07 08 09 $(foreach item,$(test_num),$(eval $(call $(module_name)_add_executable, $(module_name)_$(item)))) diff --git a/cpufreq/cpufreq_sanity.sh b/cpufreq/cpufreq_sanity.sh new file mode 100755 index 0000000..7eb2728 --- /dev/null +++ b/cpufreq/cpufreq_sanity.sh @@ -0,0 +1,40 @@ +#!/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 + +check_cpufreq_sysfs_entry() { + + local dirpath=$CPU_PATH/cpufreq + + test -d $dirpath + if [ $? -ne 0 ]; then + echo "cpufreq is not enabled. Skipping all cpufreq tests" + return 0 + fi + return 1 +} + +check_cpufreq_sysfs_entry diff --git a/cpufreq/cpufreq_sanity.txt b/cpufreq/cpufreq_sanity.txt new file mode 100644 index 0000000..6390898 --- /dev/null +++ b/cpufreq/cpufreq_sanity.txt @@ -0,0 +1 @@ +cpufreq is not supported. Skipping all cpufreq tests... diff --git a/cpuhotplug/Android.mk b/cpuhotplug/Android.mk index c0e5694..7095044 100644 --- a/cpuhotplug/Android.mk +++ b/cpuhotplug/Android.mk @@ -14,7 +14,7 @@ define $(module_name)_add_executable include $(BUILD_PREBUILT) endef -test_num := 01 02 03 04 05 06 07 08 +test_num := sanity 01 02 03 04 05 06 07 08 $(foreach item,$(test_num),$(eval $(call $(module_name)_add_executable, $(module_name)_$(item)))) define $(module_name)_etc_add_executable diff --git a/cpuhotplug/cpuhotplug_sanity.sh b/cpuhotplug/cpuhotplug_sanity.sh new file mode 100755 index 0000000..01ed591 --- /dev/null +++ b/cpuhotplug/cpuhotplug_sanity.sh @@ -0,0 +1,45 @@ +#!/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 + +check_cpuhotplug_sysfs_entry() { + + cpus=$(ls $CPU_PATH | grep "cpu[0-9].*") + + for cpu in $cpus; do + # assuming cpu0 can't be plugged out + if [ $cpu != "cpu0" ]; then + test -f $CPU_PATH/$cpu/online + if [ $? -ne 0 ]; then + echo "cpuhotplug is not enabled. Skipping all cpuhotplug tests" + return 0 + fi + fi + done + return 1 +} + +check_cpuhotplug_sysfs_entry diff --git a/cpuhotplug/cpuhotplug_sanity.txt b/cpuhotplug/cpuhotplug_sanity.txt new file mode 100644 index 0000000..96b6d29 --- /dev/null +++ b/cpuhotplug/cpuhotplug_sanity.txt @@ -0,0 +1 @@ +cpuhotplug is not supported. Skipping all cpuhotplug tests... diff --git a/cpuidle/Android.mk b/cpuidle/Android.mk index 2f302d7..07972de 100644 --- a/cpuidle/Android.mk +++ b/cpuidle/Android.mk @@ -14,7 +14,7 @@ define $(module_name)_add_executable include $(BUILD_PREBUILT) endef -test_num := 01 02 03 +test_num := sanity 01 02 03 $(foreach item,$(test_num),$(eval $(call $(module_name)_add_executable, $(module_name)_$(item)))) include $(CLEAR_VARS) diff --git a/cpuidle/cpuidle_sanity.sh b/cpuidle/cpuidle_sanity.sh index 568c129..e59bbd9 100755 --- a/cpuidle/cpuidle_sanity.sh +++ b/cpuidle/cpuidle_sanity.sh @@ -29,8 +29,12 @@ check_cpuidle_sysfs_entry() { local dirpath=$CPU_PATH/cpuidle - test -d $dirpath && return 1 || return 0 + test -d $dirpath + if [ $? -ne 0 ]; then + echo "cpuidle is not enabled. Skipping all cpuidle tests" + return 0 + fi + return 1 } check_cpuidle_sysfs_entry -test_status_show diff --git a/cpuidle/cpuidle_sanity.txt b/cpuidle/cpuidle_sanity.txt index 03d3f7c..4928c88 100644 --- a/cpuidle/cpuidle_sanity.txt +++ b/cpuidle/cpuidle_sanity.txt @@ -1 +1 @@ -cpuidle is not enabled. Skipping all cpudile tests... +cpuidle is not supported. Skipping all cpuidle tests... diff --git a/thermal/Android.mk b/thermal/Android.mk index d950a14..de4edbf 100644 --- a/thermal/Android.mk +++ b/thermal/Android.mk @@ -14,5 +14,5 @@ define $(module_name)_add_executable include $(BUILD_PREBUILT) endef -test_num := 01 02 03 04 05 06 +test_num := sanity 01 02 03 04 05 06 $(foreach item,$(test_num),$(eval $(call $(module_name)_add_executable, $(module_name)_$(item)))) diff --git a/thermal/thermal_sanity.sh b/thermal/thermal_sanity.sh index 25cbab9..d7181c0 100755 --- a/thermal/thermal_sanity.sh +++ b/thermal/thermal_sanity.sh @@ -28,7 +28,12 @@ source ../include/thermal_functions.sh check_thermal_zone() { - test -d $THERMAL_PATH && return 1 || return 0 + test -d $THERMAL_PATH + if [ $? -ne 0 ]; then + echo "thermal zone is not available. Skipping all tests" + return 0 + fi + return 1 } check_thermal_zone