It is inconvenient for user to edit these seperated switches, so move them into one central file.
Signed-off-by: Hongbo Zhang hongbo.zhang@linaro.org --- Switches | 11 +++++++++++ include/functions.sh | 2 ++ suspend/suspend_01.sh | 5 +---- suspend/suspend_02.sh | 5 +---- suspend/suspend_03.sh | 5 +---- suspend/suspend_04.sh | 5 +---- suspend/suspend_05.sh | 4 +--- thermal/thermal_06.sh | 4 +--- 8 files changed, 19 insertions(+), 22 deletions(-) create mode 100644 Switches
diff --git a/Switches b/Switches new file mode 100644 index 0000000..3a46ffe --- /dev/null +++ b/Switches @@ -0,0 +1,11 @@ +# These are switches to enable/disable some tests. + +# Thermal tests +thermal_try_max=0 + +# Suspend tests +suspend_dbus=0 +suspend_pmsuspend=1 +suspend_mem=1 +suspend_ac=0 +suspend_power=0 diff --git a/include/functions.sh b/include/functions.sh index c39b6b7..7ee809b 100644 --- a/include/functions.sh +++ b/include/functions.sh @@ -23,6 +23,8 @@ # - initial API and implementation #
+source ../Switches + CPU_PATH="/sys/devices/system/cpu" TEST_NAME=$(basename ${0%.sh}) PREFIX=$TEST_NAME diff --git a/suspend/suspend_01.sh b/suspend/suspend_01.sh index d67a66b..e591dc9 100755 --- a/suspend/suspend_01.sh +++ b/suspend/suspend_01.sh @@ -29,10 +29,7 @@ source ../include/functions.sh source ../include/suspend_functions.sh
-# test_dbus: switch on/off this test -test_dbus=1 - -if [ "$test_dbus" -eq 0 ]; then +if [ "$suspend_dbus" -eq 0 ]; then log_skip "dbus message suspend test not enabled" exit 0 fi diff --git a/suspend/suspend_02.sh b/suspend/suspend_02.sh index 7e33624..5e41d08 100755 --- a/suspend/suspend_02.sh +++ b/suspend/suspend_02.sh @@ -29,10 +29,7 @@ source ../include/functions.sh source ../include/suspend_functions.sh
-# test_pmsuspend: switch on/off this test -test_pmsuspend=1 - -if [ "$test_pmsuspend" -eq 0 ]; then +if [ "$suspend_pmsuspend" -eq 0 ]; then log_skip "pm-suspend test not enabled" exit 0 fi diff --git a/suspend/suspend_03.sh b/suspend/suspend_03.sh index 64f2fa1..b71966c 100755 --- a/suspend/suspend_03.sh +++ b/suspend/suspend_03.sh @@ -29,10 +29,7 @@ source ../include/functions.sh source ../include/suspend_functions.sh
-# test_mem: switch on/off this test -test_mem=1 - -if [ "$test_mem" -eq 0 ]; then +if [ "$suspend_mem" -eq 0 ]; then log_skip "suspend to ram via sysfs not enabled" exit 0 fi diff --git a/suspend/suspend_04.sh b/suspend/suspend_04.sh index 9f85400..8947afd 100755 --- a/suspend/suspend_04.sh +++ b/suspend/suspend_04.sh @@ -29,10 +29,7 @@ source ../include/functions.sh source ../include/suspend_functions.sh
-# test_ac: switch on/off this test -test_ac=0 - -if [ "$test_ac" -eq 0 ]; then +if [ "$suspend_ac" -eq 0 ]; then log_skip "suspend test involving ac power remove" exit 0 fi diff --git a/suspend/suspend_05.sh b/suspend/suspend_05.sh index 8604331..a87490c 100755 --- a/suspend/suspend_05.sh +++ b/suspend/suspend_05.sh @@ -29,11 +29,9 @@ source ../include/functions.sh source ../include/suspend_functions.sh
-# test_power: switch on/off this test -test_power=0 args_power_sleep=60
-if [ "$test_power" -eq 0 ]; then +if [ "$suspend_power" -eq 0 ]; then log_skip "battery consumption test while suspend" exit 0 fi diff --git a/thermal/thermal_06.sh b/thermal/thermal_06.sh index 28fdaec..0084281 100755 --- a/thermal/thermal_06.sh +++ b/thermal/thermal_06.sh @@ -28,9 +28,7 @@ source ../include/functions.sh source ../include/thermal_functions.sh
-# test_switch: switch on/off this test -test_switch=0 -if [ "$test_switch" -eq 0 ]; then +if [ "$thermal_try_max" -eq 0 ]; then log_skip "test of trip points being crossed" exit 0 fi
If the heater program for heating CPU cannot be launched for some reason, the tests should return right now, it is wasting time to execute all the rest parts without heater program.
Signed-off-by: Hongbo Zhang hongbo.zhang@linaro.org --- thermal/thermal_03.sh | 1 + thermal/thermal_04.sh | 1 + thermal/thermal_06.sh | 1 + 3 files changed, 3 insertions(+)
diff --git a/thermal/thermal_03.sh b/thermal/thermal_03.sh index ff8ca33..f2cfb81 100755 --- a/thermal/thermal_03.sh +++ b/thermal/thermal_03.sh @@ -48,6 +48,7 @@ check_temperature_change() { cpu_pid=$(ps | grep heat_cpu| awk '{print $1}') test -z $cpu_pid && cpu_pid=0 check "start cpu heat binary" "test $cpu_pid -ne 0" + test $cpu_pid -eq 0 && return
start_glmark2
diff --git a/thermal/thermal_04.sh b/thermal/thermal_04.sh index 8f0dee7..7fe53e2 100755 --- a/thermal/thermal_04.sh +++ b/thermal/thermal_04.sh @@ -58,6 +58,7 @@ verify_cooling_device_temp_change() { local cool_temp=0 ./$HEAT_CPU_MODERATE moderate & pid=$! + test $pid -eq 0 && return
while (test $count -le $max_state); do echo 0 > $dirpath/cur_state diff --git a/thermal/thermal_06.sh b/thermal/thermal_06.sh index 0084281..b0a9442 100755 --- a/thermal/thermal_06.sh +++ b/thermal/thermal_06.sh @@ -60,6 +60,7 @@ check_trip_point_change() { cpu_pid=$(ps | grep heat_cpu| awk '{print $1}') test -z $cpu_pid && cpu_pid=0 check "start cpu heat binary" "test $cpu_pid -ne 0" + test $cpu_pid -eq 0 && return
start_glmark2