Error messages have to go to the log file
Signed-off-by: Daniel Lezcano daniel.lezcano@linaro.org --- cpufreq/Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cpufreq/Makefile b/cpufreq/Makefile index 5dfc00d..f52a1f4 100644 --- a/cpufreq/Makefile +++ b/cpufreq/Makefile @@ -25,10 +25,10 @@ TST=$(wildcard *.sh) LOG=$(TST:.sh=.log)
-check: $(LOG) +check: uncheck $(LOG)
%.log: %.sh - @./$< + @./$< 2> $@
clean: rm -f $(LOG)
Signed-off-by: Daniel Lezcano daniel.lezcano@linaro.org --- Makefile | 3 +++ include/functions.sh | 11 +++++++++++ sched_mc/Makefile | 38 ++++++++++++++++++++++++++++++++++++++ sched_mc/test_01.sh | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 0 deletions(-) create mode 100644 sched_mc/Makefile create mode 100644 sched_mc/test_01.sh
diff --git a/Makefile b/Makefile index be9df5d..abc866b 100644 --- a/Makefile +++ b/Makefile @@ -29,8 +29,11 @@ all: check: @(cd utils; $(MAKE) check) @(cd cpufreq; $(MAKE) check) + @(cd sched_mc; $(MAKE) check) + uncheck: @(cd cpufreq; $(MAKE) uncheck) + @(cd sched_mc; $(MAKE) uncheck)
recheck: uncheck check
diff --git a/include/functions.sh b/include/functions.sh index 67c356a..e01d0dc 100644 --- a/include/functions.sh +++ b/include/functions.sh @@ -197,6 +197,17 @@ check_cpufreq_files() { return 0 }
+check_sched_mc_files() { + + local dirpath=$CPU_PATH + + for i in $@; do + check "$i exists" "test -f" $dirpath/$i || return 1 + done + + return 0 +} + save_governors() {
governors_backup= diff --git a/sched_mc/Makefile b/sched_mc/Makefile new file mode 100644 index 0000000..f52a1f4 --- /dev/null +++ b/sched_mc/Makefile @@ -0,0 +1,38 @@ +# +# PM-QA validation test suite for the power management on ARM +# +# Copyright (C) 2011, Linaro Limited. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Contributors: +# Daniel Lezcano daniel.lezcano@linaro.org (IBM Corporation) +# - initial API and implementation +# + +TST=$(wildcard *.sh) +LOG=$(TST:.sh=.log) + +check: uncheck $(LOG) + +%.log: %.sh + @./$< 2> $@ + +clean: + rm -f $(LOG) + +uncheck: clean + +recheck: uncheck check diff --git a/sched_mc/test_01.sh b/sched_mc/test_01.sh new file mode 100644 index 0000000..e0fd9aa --- /dev/null +++ b/sched_mc/test_01.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# +# PM-QA validation test suite for the power management on ARM +# +# Copyright (C) 2011, Linaro Limited. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Contributors: +# Daniel Lezcano daniel.lezcano@linaro.org (IBM Corporation) +# - initial API and implementation +# + +# URL : https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#sched_m... + +source ../include/functions.sh + +FILES="sched_mc_power_savings" + +check_sched_mc_files $FILES
Signed-off-by: Daniel Lezcano daniel.lezcano@linaro.org --- include/functions.sh | 12 ++++++++++++ sched_mc/test_02.sh | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 0 deletions(-) create mode 100644 sched_mc/test_02.sh
diff --git a/include/functions.sh b/include/functions.sh index e01d0dc..094d877 100644 --- a/include/functions.sh +++ b/include/functions.sh @@ -208,6 +208,18 @@ check_sched_mc_files() { return 0 }
+check_topology_files() { + + local dirpath=$CPU_PATH/$1/topology + shift 1 + + for i in $@; do + check "$i exists" "test -f" $dirpath/$i || return 1 + done + + return 0 +} + save_governors() {
governors_backup= diff --git a/sched_mc/test_02.sh b/sched_mc/test_02.sh new file mode 100644 index 0000000..36730a4 --- /dev/null +++ b/sched_mc/test_02.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +# PM-QA validation test suite for the power management on ARM +# +# Copyright (C) 2011, Linaro Limited. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Contributors: +# Daniel Lezcano daniel.lezcano@linaro.org (IBM Corporation) +# - initial API and implementation +# + +# URL : https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#sched_m... + +source ../include/functions.sh + +check_physical_package_id() { + + local package_id=$CPU_PATH/$1/topology/physical_package_id + local val=$(cat $package_id) + + check "topology is enabled" "test "$val" != "-1"" +} + +for_each_cpu check_physical_package_id || exit 1
Signed-off-by: Daniel Lezcano daniel.lezcano@linaro.org --- sched_mc/test_03.sh | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) create mode 100644 sched_mc/test_03.sh
diff --git a/sched_mc/test_03.sh b/sched_mc/test_03.sh new file mode 100644 index 0000000..b5a9c49 --- /dev/null +++ b/sched_mc/test_03.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# +# PM-QA validation test suite for the power management on ARM +# +# Copyright (C) 2011, Linaro Limited. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Contributors: +# Daniel Lezcano daniel.lezcano@linaro.org (IBM Corporation) +# - initial API and implementation +# + +# URL : https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#sched_m... + +source ../include/functions.sh + +FILES="core_id core_siblings core_siblings_list physical_package_id \ +thread_siblings thread_siblings_list" + +for_each_cpu check_topology_files $FILES
Signed-off-by: Daniel Lezcano daniel.lezcano@linaro.org --- sched_mc/test_04.sh | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 70 insertions(+), 0 deletions(-) create mode 100644 sched_mc/test_04.sh
diff --git a/sched_mc/test_04.sh b/sched_mc/test_04.sh new file mode 100644 index 0000000..4d7cfc1 --- /dev/null +++ b/sched_mc/test_04.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# +# PM-QA validation test suite for the power management on ARM +# +# Copyright (C) 2011, Linaro Limited. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Contributors: +# Daniel Lezcano daniel.lezcano@linaro.org (IBM Corporation) +# - initial API and implementation +# + +# URL : https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#sched_m... + +source ../include/functions.sh + +check_change() { + local val=$1 + local path=$2 + + echo $val > $path +} + +check_invalid_change() { + + local val=$1 + local path=$2 + + echo $val > $path + if [ "$?" != "0" ]; then + return 0 + fi + + return 1 +} + +check_sched_mc_change() { + + local path=$CPU_PATH/sched_mc_power_savings + local oldval=$(cat $path) + + check "setting value to 0" check_change 0 $path + check "setting value to 1" check_change 1 $path + check "setting value to 2" check_change 2 $path + check "setting invalid value to 3" check_invalid_change 3 $path + check "setting invalid value to -1" check_invalid_change -1 $path + + echo $oldval > $path +} + +if [ $(id -u) != 0 ]; then + log_skip "run as non-root" + exit 0 +fi + +# check_sched_mc_files sched_mc_power_savings || exit 1 +check_sched_mc_change
Daniel,
This looks ok. Ack.
/Amit
On Fri, Aug 5, 2011 at 4:03 PM, Daniel Lezcano daniel.lezcano@linaro.org wrote:
Error messages have to go to the log file
Signed-off-by: Daniel Lezcano daniel.lezcano@linaro.org
cpufreq/Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cpufreq/Makefile b/cpufreq/Makefile index 5dfc00d..f52a1f4 100644 --- a/cpufreq/Makefile +++ b/cpufreq/Makefile @@ -25,10 +25,10 @@ TST=$(wildcard *.sh) LOG=$(TST:.sh=.log)
-check: $(LOG) +check: uncheck $(LOG)
%.log: %.sh
- @./$<
- @./$< 2> $@
clean: rm -f $(LOG) -- 1.7.4.1
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 08/08/2011 10:29 PM, Amit Kucheria wrote:
Daniel,
This looks ok. Ack.
Applied.
- -- http://www.linaro.org/ Linaro.org ? Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro Facebook | http://twitter.com/#!/linaroorg Twitter | http://www.linaro.org/linaro-blog/ Blog