aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLisa Nguyen <lisa.nguyen@linaro.org>2015-11-17 18:40:10 -0800
committerLisa Nguyen <lisa.nguyen@linaro.org>2015-11-19 17:34:09 -0800
commitd75a9830edd5be39a0b5030d1fd12e91dbd8a156 (patch)
treef6e09939d1a9ab28690461054d8b4ee1ec199b15
parent71eb7a9236ef1a2c0e5eaed4430ae06bd57e6d35 (diff)
thermal: Add checks to search for thermal zones first
There are instances where PM-QA might be running on systems that do not have thermal zones and might have cooling systems instead; therefore some subtests may instantly fail because of it. Add more checks to see if thermal zones exist before continuing the thermal subtests. Signed-off-by: Lisa Nguyen <lisa.nguyen@linaro.org>
-rwxr-xr-xthermal/thermal_01.sh23
-rwxr-xr-xthermal/thermal_03.sh6
-rwxr-xr-xthermal/thermal_06.sh6
3 files changed, 20 insertions, 15 deletions
diff --git a/thermal/thermal_01.sh b/thermal/thermal_01.sh
index 34e8f19..8335299 100755
--- a/thermal/thermal_01.sh
+++ b/thermal/thermal_01.sh
@@ -58,26 +58,23 @@ check_thermal_zone_mode() {
}
check_thermal_zone_trip_level() {
-
- thermal_zones=$(ls $THERMAL_PATH | grep "thermal_zone['$MAX_ZONE']")
for thermal_zone in $thermal_zones; do
- for_each_trip_point_of_zone $thermal_zone "validate_trip_level" || return 1
+ for_each_trip_point_of_zone $thermal_zone "validate_trip_level" || return 1
done
}
check_thermal_zone_bindings() {
-
- thermal_zones=$(ls $THERMAL_PATH | grep "thermal_zone['$MAX_ZONE']")
for thermal_zone in $thermal_zones; do
- for_each_binding_of_zone $thermal_zone "validate_trip_bindings" || return 1
+ for_each_binding_of_zone $thermal_zone "validate_trip_bindings" || return 1
done
}
-for_each_thermal_zone check_thermal_zone_attributes
-
-for_each_thermal_zone check_thermal_zone_mode
-
-check_thermal_zone_trip_level
-
-check_thermal_zone_bindings
+if [ -z "$thermal_zones"]; then
+ log_skip "No thermal zones found"
+else
+ for_each_thermal_zone check_thermal_zone_attributes
+ for_each_thermal_zone check_thermal_zone_mode
+ check_thermal_zone_trip_level
+ check_thermal_zone_bindings
+fi
test_status_show
diff --git a/thermal/thermal_03.sh b/thermal/thermal_03.sh
index 2883174..665d851 100755
--- a/thermal/thermal_03.sh
+++ b/thermal/thermal_03.sh
@@ -59,5 +59,9 @@ check_temperature_change() {
trap "heater_kill; sigtrap" HUP INT TERM
-for_each_thermal_zone check_temperature_change
+if [ -z "$thermal_zones"]; then
+ log_skip "No thermal zones found"
+else
+ for_each_thermal_zone check_temperature_change
+fi
test_status_show
diff --git a/thermal/thermal_06.sh b/thermal/thermal_06.sh
index 9c744f1..5774977 100755
--- a/thermal/thermal_06.sh
+++ b/thermal/thermal_06.sh
@@ -109,5 +109,9 @@ check_trip_point_change() {
trap "heater_kill; sigtrap" HUP INT TERM
-for_each_thermal_zone check_trip_point_change
+if [ -z "$thermal_zones"]; then
+ log_skip "No thermal zones found"
+else
+ for_each_thermal_zone check_trip_point_change
+fi
test_status_show