@@ -30,6 +30,12 @@ source ../include/functions.sh
STATES="desc latency name power time usage"
FILES="current_driver current_governor_ro"
+cpuidle_enabled
+if [ $? -ne 0 ]; then
+ log_skip "cpuidle not supported"
+ exit 0
+fi
+
check_cpuidle_state_files() {
local dirpath=$CPU_PATH/$1/cpuidle
@@ -29,6 +29,12 @@ source ../include/functions.sh
CPUIDLE_KILLER=./cpuidle_killer
+cpuidle_enabled
+if [ $? -ne 0 ]; then
+ log_skip "cpuidle not supported"
+ exit 0
+fi
+
is_root
if [ $? -ne 0 ]; then
log_skip "user is not root"
@@ -29,6 +29,12 @@ source ../include/functions.sh
CPUIDLE_KILLER=./cpuidle_killer
+cpuidle_enabled
+if [ $? -ne 0 ]; then
+ log_skip "cpuidle not supported"
+ exit 0
+fi
+
is_root
if [ $? -ne 0 ]; then
log_skip "user is not root"
old mode 100644
new mode 100755
@@ -27,6 +27,12 @@ source ../include/functions.sh
CPUIDLE_STATS=./cpuidle_stats
+cpuidle_enabled
+if [ $? -ne 0 ]; then
+ log_skip "cpuidle not supported"
+ exit 0
+fi
+
is_root
if [ $? -ne 0 ]; then
log_skip "user is not root"
@@ -349,6 +349,10 @@ cpufreq_enabled() {
test -d /sys/devices/system/cpu/cpufreq
}
+cpuidle_enabled() {
+ test -d /sys/devices/system/cpu/cpuidle
+}
+
# currently we support ubuntu and android
get_os() {
lsb_release -a 2>&1 | grep -i ubuntu > /dev/null
Signed-off-by: Sanjay Singh Rawat <sanjay.rawat@linaro.org> --- As ubuntu and android have their own way of invoking the tests. Better to have a function call in each script, to check for the feature state. regards, sanjay --- cpuidle/cpuidle_01.sh | 6 ++++++ cpuidle/cpuidle_02.sh | 6 ++++++ cpuidle/cpuidle_03.sh | 6 ++++++ cpuidle/cpuidle_04.sh | 6 ++++++ include/functions.sh | 4 ++++ 5 files changed, 28 insertions(+) mode change 100644 => 100755 cpuidle/cpuidle_04.sh