diff options
author | Sanjay Singh Rawat <sanjay.rawat@linaro.org> | 2014-01-29 12:15:02 +0530 |
---|---|---|
committer | Sanjay Singh Rawat <sanjay.rawat@linaro.org> | 2014-02-20 11:41:06 +0530 |
commit | 736aef65e8b9200a4974ed8df8bedeb0adf62217 (patch) | |
tree | 4059c8ca941e130eaa6f51e1ea6f59f8e82a8942 /cpuidle | |
parent | d5963e55e84ba19740993e177b463a31e2dd8859 (diff) |
test feature supported before running suite
add a basic sanity file which will check for feature support and
will proceed only if feature supported
Signed-off-by: Sanjay Singh Rawat <sanjay.rawat@linaro.org>
Diffstat (limited to 'cpuidle')
-rw-r--r-- | cpuidle/Android.mk | 2 | ||||
-rwxr-xr-x | cpuidle/cpuidle_02.sh | 6 | ||||
-rwxr-xr-x | cpuidle/cpuidle_03.sh | 6 | ||||
-rw-r--r-- | cpuidle/cpuidle_04.sh | 6 | ||||
-rwxr-xr-x | cpuidle/cpuidle_sanity.sh | 14 | ||||
-rw-r--r-- | cpuidle/cpuidle_sanity.txt | 2 |
6 files changed, 14 insertions, 22 deletions
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_02.sh b/cpuidle/cpuidle_02.sh index 77261c4..0056382 100755 --- a/cpuidle/cpuidle_02.sh +++ b/cpuidle/cpuidle_02.sh @@ -29,11 +29,5 @@ source ../include/functions.sh CPUIDLE_KILLER=./cpuidle_killer -is_root -if [ $? -ne 0 ]; then - log_skip "user is not root" - exit 0 -fi - check "cpuidle program runs successfully (120 secs)" "./$CPUIDLE_KILLER" test_status_show diff --git a/cpuidle/cpuidle_03.sh b/cpuidle/cpuidle_03.sh index 1138207..663d385 100755 --- a/cpuidle/cpuidle_03.sh +++ b/cpuidle/cpuidle_03.sh @@ -49,12 +49,6 @@ check_cpuidle_kill() { check "cpuidle program runs successfully (120 secs)" "./$CPUIDLE_KILLER" } -is_root -if [ $? -ne 0 ]; then - log_skip "user is not root" - exit 0 -fi - trap "restore_cpus; sigtrap" SIGHUP SIGINT SIGTERM for_each_cpu check_cpuidle_kill diff --git a/cpuidle/cpuidle_04.sh b/cpuidle/cpuidle_04.sh index 028b3ee..b9dd1ce 100644 --- a/cpuidle/cpuidle_04.sh +++ b/cpuidle/cpuidle_04.sh @@ -27,12 +27,6 @@ source ../include/functions.sh CPUIDLE_STATS=./cpuidle_stats -is_root -if [ $? -ne 0 ]; then - log_skip "user is not root" - exit 0 -fi - check_cpuidle_stats() { trace-cmd record -e cpu_idle trace-cmd report trace.dat > trace-cpuidle.dat diff --git a/cpuidle/cpuidle_sanity.sh b/cpuidle/cpuidle_sanity.sh index 568c129..99f05b3 100755 --- a/cpuidle/cpuidle_sanity.sh +++ b/cpuidle/cpuidle_sanity.sh @@ -25,12 +25,22 @@ source ../include/functions.sh +is_root +if [ $? -ne 0 ]; then + log_skip "user is not root" + exit 0 +fi + 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 supported. 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..42d1a5e 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 or not the root user. Skipping all cpuidle tests... |