Currently, the powertop test module is disabled by default, but make the powertop scripts POSIX-compliant to be consistent with other scripts.
Signed-off-by: Lisa Nguyen lisa.nguyen@linaro.org --- powertop/powertop_01.sh | 19 +++++++++---------- powertop/powertop_sanity.sh | 8 +++----- 2 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/powertop/powertop_01.sh b/powertop/powertop_01.sh index c66b725..4e9ff71 100755 --- a/powertop/powertop_01.sh +++ b/powertop/powertop_01.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # PM-QA validation test suite for the power management on Linux # @@ -25,15 +25,14 @@
# URL : https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#powerto...
-source ../include/functions.sh +. ../include/functions.sh
run_powertop() { - - local bin_path=`command -v powertop` - local report=csv - local seconds=10 - local iterations=2 - local report_name=PowerTOP*.csv + bin_path=`command -v powertop` + report=csv + seconds=10 + iterations=2 + report_name=PowerTOP*.csv
# remove old reports if exists rm -f $report_name @@ -44,8 +43,8 @@ run_powertop() { end_time=`date +%s`
# check if powertop run for desired time - let expected_time="$iterations * $seconds" - let actual_time="$end_time - $start_time" + expected_time="$iterations * $seconds" + actual_time="$end_time - $start_time"
check "if powertop run for $expected_time sec" "test $actual_time -ge $expected_time"
diff --git a/powertop/powertop_sanity.sh b/powertop/powertop_sanity.sh index 3ae3065..cb76b64 100755 --- a/powertop/powertop_sanity.sh +++ b/powertop/powertop_sanity.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # PM-QA validation test suite for the power management on Linux # @@ -23,12 +23,10 @@ # - initial API and implementation #
-source ../include/functions.sh +. ../include/functions.sh
check_powertop() { - - local bin_name=powertop - + bin_name=powertop command -v $bin_name >/dev/null 2>&1 && return 1 || return 0 }