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>
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 @@
     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 @@
     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 @@
     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 @@
 
 # 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 @@
     set_frequency $cpu $freq
 
     result=$($CPUCYCLE $cpu)
-    if [ $? != 0 ]; then
+    if [ $? -ne 0 ]; then
 	return 1
     fi
 
@@ -101,7 +101,7 @@
     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 @@
     # 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 @@
     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 @@
 
 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 @@
     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 @@
 
 save_governors
 
-if [ $(id -u) != 0 ]; then
+if [ $(id -u) -ne 0 ]; then
     log_skip "run as non-root"
     exit 0
 fi