diff options
author | Sanjay Singh Rawat <sanjay.rawat@linaro.org> | 2013-12-15 13:30:37 +0530 |
---|---|---|
committer | Sanjay Singh Rawat <sanjay.rawat@linaro.org> | 2013-12-15 15:43:26 +0530 |
commit | c7af87bdbce4a0105663f19b21b2560fc2cadec7 (patch) | |
tree | aacf2ab593ce3af3e8cdc4d2da466e48d04cbe9d | |
parent | 7c440a6fda2c02f4d6a3598c2a2c202ca1afd227 (diff) |
change options for numerical comparision
use directory test option for cpufreq test and add warning message
for hotplug 07 test
Signed-off-by: Carlos Hernandez <ceh@ti.com>
Signed-off-by: Sanjay Singh Rawat <sanjay.rawat@linaro.org>
-rwxr-xr-x | cpufreq/cpufreq_03.sh | 2 | ||||
-rwxr-xr-x | cpufreq/cpufreq_04.sh | 2 | ||||
-rwxr-xr-x | cpufreq/cpufreq_05.sh | 6 | ||||
-rwxr-xr-x | cpufreq/cpufreq_06.sh | 4 | ||||
-rwxr-xr-x | cpufreq/cpufreq_07.sh | 4 | ||||
-rwxr-xr-x | cpufreq/cpufreq_08.sh | 2 | ||||
-rwxr-xr-x | cpufreq/cpufreq_09.sh | 4 | ||||
-rwxr-xr-x | cpuhotplug/cpuhotplug_07.sh | 2 | ||||
-rwxr-xr-x | cpuidle/cpuidle_02.sh | 2 | ||||
-rwxr-xr-x | cpuidle/cpuidle_03.sh | 4 | ||||
-rw-r--r-- | cpuidle/cpuidle_04.sh | 2 | ||||
-rw-r--r-- | include/functions.sh | 6 | ||||
-rw-r--r-- | include/suspend_functions.sh | 2 | ||||
-rw-r--r-- | include/thermal_functions.sh | 4 | ||||
-rwxr-xr-x | thermal/thermal_03.sh | 2 | ||||
-rwxr-xr-x | thermal/thermal_04.sh | 2 | ||||
-rwxr-xr-x | thermal/thermal_06.sh | 2 |
17 files changed, 27 insertions, 25 deletions
diff --git a/cpufreq/cpufreq_03.sh b/cpufreq/cpufreq_03.sh index d41a979..0c59ce8 100755 --- a/cpufreq/cpufreq_03.sh +++ b/cpufreq/cpufreq_03.sh @@ -43,7 +43,7 @@ check_governor() { set_governor $cpu $oldgov } -if [ $(id -u) != 0 ]; then +if [ $(id -u) -ne 0 ]; then log_skip "run as non-root" exit 0 fi diff --git a/cpufreq/cpufreq_04.sh b/cpufreq/cpufreq_04.sh index 6092535..530366a 100755 --- a/cpufreq/cpufreq_04.sh +++ b/cpufreq/cpufreq_04.sh @@ -46,7 +46,7 @@ check_frequency() { set_governor $cpu $oldgov } -if [ $(id -u) != 0 ]; then +if [ $(id -u) -ne 0 ]; then log_skip "run as non-root" exit 0 fi diff --git a/cpufreq/cpufreq_05.sh b/cpufreq/cpufreq_05.sh index 72ca554..7830118 100755 --- a/cpufreq/cpufreq_05.sh +++ b/cpufreq/cpufreq_05.sh @@ -27,7 +27,7 @@ source ../include/functions.sh -if [ $(id -u) != 0 ]; then +if [ $(id -u) -ne 0 ]; then log_skip "run as non-root" exit 0 fi @@ -55,7 +55,7 @@ check_governor() { local cpu=$1 local gov=$2 - if [ -e $CPU_PATH/$cpu/cpufreq/$gov ]; then + if [ -d $CPU_PATH/$cpu/cpufreq/$gov ]; then GOV_PATH=$CPU_PATH/$cpu/cpufreq/$gov else GOV_PATH=$CPU_PATH/cpufreq/$gov @@ -97,7 +97,7 @@ fi # if more than one cpu, combine governors nrcpus=$(ls $CPU_PATH | grep "cpu[0-9].*" | wc -l) -if [ $nrcpus > 1 ]; then +if [ $nrcpus -gt 1 ]; then affected=$(cat $CPU_PATH/cpu0/cpufreq/affected_cpus | grep 1) if [ -z $affected ]; then switch_ondemand cpu0 diff --git a/cpufreq/cpufreq_06.sh b/cpufreq/cpufreq_06.sh index bfd38c9..25c473e 100755 --- a/cpufreq/cpufreq_06.sh +++ b/cpufreq/cpufreq_06.sh @@ -37,7 +37,7 @@ compute_freq_ratio() { set_frequency $cpu $freq result=$($CPUCYCLE $cpu) - if [ $? != 0 ]; then + if [ $? -ne 0 ]; then return 1 fi @@ -101,7 +101,7 @@ check_deviation() { for_each_frequency $cpu check_freq_deviation } -if [ $(id -u) != 0 ]; then +if [ $(id -u) -ne 0 ]; then log_skip "run as non-root" exit 0 fi diff --git a/cpufreq/cpufreq_07.sh b/cpufreq/cpufreq_07.sh index 1e6bdbe..abfad7f 100755 --- a/cpufreq/cpufreq_07.sh +++ b/cpufreq/cpufreq_07.sh @@ -42,7 +42,7 @@ check_ondemand() { # wait for a quescient point for i in $(seq 1 10); do - if [ "$minfreq" == "$(get_frequency $cpu)" ]; then + if [ "$minfreq" -eq "$(get_frequency $cpu)" ]; then $CPUBURN $cpu & pid=$! @@ -77,7 +77,7 @@ check_ondemand() { return 1 } -if [ $(id -u) != 0 ]; then +if [ $(id -u) -ne 0 ]; then log_skip "run as non-root" exit 0 fi diff --git a/cpufreq/cpufreq_08.sh b/cpufreq/cpufreq_08.sh index a2f395b..79008f0 100755 --- a/cpufreq/cpufreq_08.sh +++ b/cpufreq/cpufreq_08.sh @@ -66,7 +66,7 @@ check_userspace() { save_governors -if [ $(id -u) != 0 ]; then +if [ $(id -u) -ne 0 ]; then log_skip "run as non-root" exit 0 fi diff --git a/cpufreq/cpufreq_09.sh b/cpufreq/cpufreq_09.sh index 1381efc..a0c1171 100755 --- a/cpufreq/cpufreq_09.sh +++ b/cpufreq/cpufreq_09.sh @@ -53,7 +53,7 @@ check_powersave() { kill $pid check "'powersave' frequency $(frequnit $minfreq) is fixed" "test \"$curfreq\" == \"$minfreq\"" - if [ "$?" != "0" ]; then + if [ "$?" -ne "0" ]; then return 1 fi @@ -62,7 +62,7 @@ check_powersave() { save_governors -if [ $(id -u) != 0 ]; then +if [ $(id -u) -ne 0 ]; then log_skip "run as non-root" exit 0 fi diff --git a/cpuhotplug/cpuhotplug_07.sh b/cpuhotplug/cpuhotplug_07.sh index 0ec67fc..d3674d2 100755 --- a/cpuhotplug/cpuhotplug_07.sh +++ b/cpuhotplug/cpuhotplug_07.sh @@ -34,7 +34,9 @@ waitfor_udevadm() { if [ $? -eq 0 ]; then return 0 fi + log_skip "warning: udev monitor not running" done + return 1 } check_notification() { diff --git a/cpuidle/cpuidle_02.sh b/cpuidle/cpuidle_02.sh index 8d4b476..e604a8b 100755 --- a/cpuidle/cpuidle_02.sh +++ b/cpuidle/cpuidle_02.sh @@ -29,7 +29,7 @@ source ../include/functions.sh CPUIDLE_KILLER=./cpuidle_killer -if [ $(id -u) != 0 ]; then +if [ $(id -u) -ne 0 ]; then log_skip "run as non-root" exit 0 fi diff --git a/cpuidle/cpuidle_03.sh b/cpuidle/cpuidle_03.sh index 251ee3e..b07bc89 100755 --- a/cpuidle/cpuidle_03.sh +++ b/cpuidle/cpuidle_03.sh @@ -29,7 +29,7 @@ source ../include/functions.sh CPUIDLE_KILLER=./cpuidle_killer -if [ $(id -u) != 0 ]; then +if [ $(id -u) -ne 0 ]; then log_skip "run as non-root" exit 0 fi @@ -49,7 +49,7 @@ check_cpuidle_kill() { check "cpuidle program runs successfully (120 secs)" "./$CPUIDLE_KILLER" } -if [ $(id -u) != 0 ]; then +if [ $(id -u) -ne 0 ]; then log_skip "run as non-root" exit 0 fi diff --git a/cpuidle/cpuidle_04.sh b/cpuidle/cpuidle_04.sh index 7ec12d3..1688873 100644 --- a/cpuidle/cpuidle_04.sh +++ b/cpuidle/cpuidle_04.sh @@ -27,7 +27,7 @@ source ../include/functions.sh CPUIDLE_STATS=./cpuidle_stats -if [ $(id -u) != 0 ]; then +if [ $(id -u) -ne 0 ]; then log_skip "run as non-root" exit 0 fi diff --git a/include/functions.sh b/include/functions.sh index 874d2d2..7009fa3 100644 --- a/include/functions.sh +++ b/include/functions.sh @@ -126,12 +126,12 @@ wait_latency() { local nrfreq= latency=$(cat $dirpath/cpuinfo_transition_latency) - if [ $? != 0 ]; then + if [ $? -ne 0 ]; then return 1 fi nrfreq=$(cat $dirpath/scaling_available_frequencies | wc -w) - if [ $? != 0 ]; then + if [ $? -ne 0 ]; then return 1 fi @@ -226,7 +226,7 @@ check() { log_begin "checking $descr" $func $@ - if [ $? != 0 ]; then + if [ $? -ne 0 ]; then log_end "Err" fail_count=$(($fail_count + 1)) return 1 diff --git a/include/suspend_functions.sh b/include/suspend_functions.sh index f06689f..1e8a793 100644 --- a/include/suspend_functions.sh +++ b/include/suspend_functions.sh @@ -44,7 +44,7 @@ pm_trace=1 timer_sleep=20 # root is needed to fiddle with the clock and use the rtc wakeups. -if [ $(id -u) != 0 ]; then +if [ $(id -u) -ne 0 ]; then log_skip "run as non-root" exit 0 fi diff --git a/include/thermal_functions.sh b/include/thermal_functions.sh index 8a4d627..1f1991f 100644 --- a/include/thermal_functions.sh +++ b/include/thermal_functions.sh @@ -181,7 +181,7 @@ check_scaling_freq() { local flag=0 for cpu in $(ls $CPU_PATH | grep "cpu[0-9].*"); do - if [ $before_freq_list[$index] != $afterf_req_list[$index] ] ; then + if [ $before_freq_list[$index] -ne $afterf_req_list[$index] ] ; then flag=1 fi index=$((index + 1)) @@ -275,7 +275,7 @@ kill_glmark2() { return fi - if [ "$gpu_pid" != 0 ]; then + if [ "$gpu_pid" -ne 0 ]; then kill -9 $gpu_pid fi } diff --git a/thermal/thermal_03.sh b/thermal/thermal_03.sh index ff3ac12..cf53a1a 100755 --- a/thermal/thermal_03.sh +++ b/thermal/thermal_03.sh @@ -32,7 +32,7 @@ CPU_HEAT_BIN=../utils/heat_cpu cpu_pid=0 heater_kill() { - if [ $cpu_pid != 0 ]; then + if [ $cpu_pid -ne 0 ]; then kill -9 $cpu_pid fi kill_glmark2 diff --git a/thermal/thermal_04.sh b/thermal/thermal_04.sh index 9275dcf..99a3430 100755 --- a/thermal/thermal_04.sh +++ b/thermal/thermal_04.sh @@ -31,7 +31,7 @@ HEAT_CPU_MODERATE=../utils/heat_cpu pid=0 heater_kill() { - if [ $pid != 0 ]; then + if [ $pid -ne 0 ]; then kill -9 $pid fi } diff --git a/thermal/thermal_06.sh b/thermal/thermal_06.sh index 2cb263f..92c987a 100755 --- a/thermal/thermal_06.sh +++ b/thermal/thermal_06.sh @@ -38,7 +38,7 @@ CPU_HEAT_BIN=../utils/heat_cpu cpu_pid=0 heater_kill() { - if [ $cpu_pid != 0 ]; then + if [ $cpu_pid -ne 0 ]; then kill -9 $cpu_pid fi kill_glmark2 |