My previous patchset[1] had too many types of patches (cleanups, bug fixes, additions, etc.), so it will be broken up much further to make it easy on the eyes :)
This particular set focuses on renaming existing sanity scripts, adding a new one to the cputopology test module, and if the changes look good, then update the Android makefiles to include the new test names. The PM-QA wiki[2] will be updated as well.
[1] http://lists.linaro.org/pipermail/linaro-dev/2015-February/017797.html
[2] https://wiki.linaro.org/WorkingGroups/PowerManagement/ Resources/TestSuite/PmQaSpecification
Lisa Nguyen (4): cpuhotplug: Rename 1_sanity_check files to cpuhotplug_00 files cpuhotplug: Rename z_sanity_check files to cpuhotplug_99 files cputopology: Add cputopology_sanity.sh Android: Update makefiles with new test numbers
cpuhotplug/1_sanity_check.sh | 40 ----------------------------- cpuhotplug/1_sanity_check.txt | 1 - cpuhotplug/Android.mk | 4 +-- cpuhotplug/cpuhotplug_00.sh | 40 +++++++++++++++++++++++++++++ cpuhotplug/cpuhotplug_00.txt | 1 + cpuhotplug/cpuhotplug_99.sh | 40 +++++++++++++++++++++++++++++ cpuhotplug/cpuhotplug_99.txt | 1 + cpuhotplug/z_sanity_check.sh | 40 ----------------------------- cpuhotplug/z_sanity_check.txt | 1 - cputopology/Android.mk | 2 +- cputopology/cputopology_sanity.sh | 49 ++++++++++++++++++++++++++++++++++++ cputopology/cputopology_sanity.txt | 1 + 12 files changed, 134 insertions(+), 86 deletions(-) delete mode 100755 cpuhotplug/1_sanity_check.sh delete mode 100644 cpuhotplug/1_sanity_check.txt create mode 100755 cpuhotplug/cpuhotplug_00.sh create mode 100644 cpuhotplug/cpuhotplug_00.txt create mode 100755 cpuhotplug/cpuhotplug_99.sh create mode 100644 cpuhotplug/cpuhotplug_99.txt delete mode 100755 cpuhotplug/z_sanity_check.sh delete mode 100644 cpuhotplug/z_sanity_check.txt create mode 100755 cputopology/cputopology_sanity.sh create mode 100644 cputopology/cputopology_sanity.txt
1_sanity_check.sh script didn't have a meaningful name. Rename it to cpuhotplug_00 as the first script to check if all cpus are online before the other cpuhotplug scripts begin.
Signed-off-by: Lisa Nguyen lisa.nguyen@linaro.org --- cpuhotplug/1_sanity_check.sh | 40 ---------------------------------------- cpuhotplug/1_sanity_check.txt | 1 - cpuhotplug/cpuhotplug_00.sh | 40 ++++++++++++++++++++++++++++++++++++++++ cpuhotplug/cpuhotplug_00.txt | 1 + 4 files changed, 41 insertions(+), 41 deletions(-) delete mode 100755 cpuhotplug/1_sanity_check.sh delete mode 100644 cpuhotplug/1_sanity_check.txt create mode 100755 cpuhotplug/cpuhotplug_00.sh create mode 100644 cpuhotplug/cpuhotplug_00.txt
diff --git a/cpuhotplug/1_sanity_check.sh b/cpuhotplug/1_sanity_check.sh deleted file mode 100755 index 634a736..0000000 --- a/cpuhotplug/1_sanity_check.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# PM-QA validation test suite for the power management on Linux -# -# 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 : - -. ../include/functions.sh - -sanity_check() { - ret=$(cat $CPU_PATH/offline) - if [ -z "$ret" ]; then - return 0 - else - return 1 - fi -} - -check "all cpu are online" "sanity_check" -test_status_show diff --git a/cpuhotplug/1_sanity_check.txt b/cpuhotplug/1_sanity_check.txt deleted file mode 100644 index 8930419..0000000 --- a/cpuhotplug/1_sanity_check.txt +++ /dev/null @@ -1 +0,0 @@ -ensure all the cpus are online before the tests diff --git a/cpuhotplug/cpuhotplug_00.sh b/cpuhotplug/cpuhotplug_00.sh new file mode 100755 index 0000000..634a736 --- /dev/null +++ b/cpuhotplug/cpuhotplug_00.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# +# PM-QA validation test suite for the power management on Linux +# +# 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 : + +. ../include/functions.sh + +sanity_check() { + ret=$(cat $CPU_PATH/offline) + if [ -z "$ret" ]; then + return 0 + else + return 1 + fi +} + +check "all cpu are online" "sanity_check" +test_status_show diff --git a/cpuhotplug/cpuhotplug_00.txt b/cpuhotplug/cpuhotplug_00.txt new file mode 100644 index 0000000..8930419 --- /dev/null +++ b/cpuhotplug/cpuhotplug_00.txt @@ -0,0 +1 @@ +ensure all the cpus are online before the tests
z_sanity_check.sh doesn't have a meaningful name. Rename it to cpuhotplug_99 as the last script to run to see if all cpus are back online after running previous cpuhotplug scripts.
Signed-off-by: Lisa Nguyen lisa.nguyen@linaro.org --- cpuhotplug/cpuhotplug_99.sh | 40 ++++++++++++++++++++++++++++++++++++++++ cpuhotplug/cpuhotplug_99.txt | 1 + cpuhotplug/z_sanity_check.sh | 40 ---------------------------------------- cpuhotplug/z_sanity_check.txt | 1 - 4 files changed, 41 insertions(+), 41 deletions(-) create mode 100755 cpuhotplug/cpuhotplug_99.sh create mode 100644 cpuhotplug/cpuhotplug_99.txt delete mode 100755 cpuhotplug/z_sanity_check.sh delete mode 100644 cpuhotplug/z_sanity_check.txt
diff --git a/cpuhotplug/cpuhotplug_99.sh b/cpuhotplug/cpuhotplug_99.sh new file mode 100755 index 0000000..5d5a425 --- /dev/null +++ b/cpuhotplug/cpuhotplug_99.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# +# PM-QA validation test suite for the power management on Linux +# +# 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 : + +. ../include/functions.sh + +sanity_check() { + ret=$(cat $CPU_PATH/offline) + if [ -z "$ret" ]; then + return 0 + else + return 1 + fi +} + +check "all cpu are back online" "sanity_check" +test_status_show diff --git a/cpuhotplug/cpuhotplug_99.txt b/cpuhotplug/cpuhotplug_99.txt new file mode 100644 index 0000000..2b6c2fa --- /dev/null +++ b/cpuhotplug/cpuhotplug_99.txt @@ -0,0 +1 @@ +ensure all the cpus are online when the tests are finished diff --git a/cpuhotplug/z_sanity_check.sh b/cpuhotplug/z_sanity_check.sh deleted file mode 100755 index 5d5a425..0000000 --- a/cpuhotplug/z_sanity_check.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# PM-QA validation test suite for the power management on Linux -# -# 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 : - -. ../include/functions.sh - -sanity_check() { - ret=$(cat $CPU_PATH/offline) - if [ -z "$ret" ]; then - return 0 - else - return 1 - fi -} - -check "all cpu are back online" "sanity_check" -test_status_show diff --git a/cpuhotplug/z_sanity_check.txt b/cpuhotplug/z_sanity_check.txt deleted file mode 100644 index 2b6c2fa..0000000 --- a/cpuhotplug/z_sanity_check.txt +++ /dev/null @@ -1 +0,0 @@ -ensure all the cpus are online when the tests are finished
Every test module has a sanity script. Add one for cputopology to check for topology entries for all cpus.
Signed-off-by: Lisa Nguyen lisa.nguyen@linaro.org --- cputopology/cputopology_sanity.sh | 49 ++++++++++++++++++++++++++++++++++++ cputopology/cputopology_sanity.txt | 1 + 2 files changed, 50 insertions(+) create mode 100755 cputopology/cputopology_sanity.sh create mode 100644 cputopology/cputopology_sanity.txt
diff --git a/cputopology/cputopology_sanity.sh b/cputopology/cputopology_sanity.sh new file mode 100755 index 0000000..698ceab --- /dev/null +++ b/cputopology/cputopology_sanity.sh @@ -0,0 +1,49 @@ +#!/bin/sh +# +# PM-QA validation test suite for the power management on Linux +# +# Copyright (C) 2015, 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: +# Lisa Nguyen lisa.nguyen@linaro.org +# - initial implementation +# + +. ../include/functions.sh + +is_root +if [ $? -ne 0 ]; then + log_skip "User is not root" + exit 0 +fi + +check_cputopology_sysfs_entry() { + for cpu in $cpus; do + cputopology_sysfs_dir="$CPU_PATH/$cpu/topology" + + test -d $cputopology_sysfs_dir + if [ $? -ne 0 ]; then + echo "cputopology entry not found. Skipping all cputopology tests" + skip_tests cputopology + return 0 + fi + done + + return 1 +} + +check_cputopology_sysfs_entry diff --git a/cputopology/cputopology_sanity.txt b/cputopology/cputopology_sanity.txt new file mode 100644 index 0000000..99f927c --- /dev/null +++ b/cputopology/cputopology_sanity.txt @@ -0,0 +1 @@ +Checking for topology dir in each cpu
Update the Android makefiles to include new test numbers to run cputopology_sanity.sh, cpuhotplug_00.sh (formerly 1_sanity_check.sh), and cpuhotplug_99.sh (formerly z_sanity_check.sh).
Signed-off-by: Lisa Nguyen lisa.nguyen@linaro.org --- cpuhotplug/Android.mk | 4 +--- cputopology/Android.mk | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/cpuhotplug/Android.mk b/cpuhotplug/Android.mk index fabb70a..ac0ff0b 100644 --- a/cpuhotplug/Android.mk +++ b/cpuhotplug/Android.mk @@ -14,7 +14,7 @@ define $(module_name)_add_executable include $(BUILD_PREBUILT) endef
-test_num := sanity 01 02 03 04 05 06 07 08 +test_num := sanity 00 01 02 03 04 05 06 07 08 99 $(foreach item,$(test_num),$(eval $(call $(module_name)_add_executable, $(module_name)_$(item))))
define $(module_name)_etc_add_executable @@ -28,5 +28,3 @@ define $(module_name)_etc_add_executable include $(BUILD_PREBUILT) endef
-test_names := 1_sanity_check z_sanity_check -$(foreach item,$(test_names),$(eval $(call $(module_name)_etc_add_executable, $(item)))) diff --git a/cputopology/Android.mk b/cputopology/Android.mk index d5b5480..3555496 100644 --- a/cputopology/Android.mk +++ b/cputopology/Android.mk @@ -14,5 +14,5 @@ define $(module_name)_add_executable include $(BUILD_PREBUILT) endef
-test_num := 01 02 +test_num := sanity 01 02 $(foreach item,$(test_num),$(eval $(call $(module_name)_add_executable, $(module_name)_$(item))))
On Tue, Feb 3, 2015 at 6:52 AM, Lisa Nguyen lisa.nguyen@linaro.org wrote:
My previous patchset[1] had too many types of patches (cleanups, bug fixes, additions, etc.), so it will be broken up much further to make it easy on the eyes :)
This particular set focuses on renaming existing sanity scripts, adding a new one to the cputopology test module, and if the changes look good, then update the Android makefiles to include the new test names. The PM-QA wiki[2] will be updated as well.
[1] http://lists.linaro.org/pipermail/linaro-dev/2015-February/017797.html
[2] https://wiki.linaro.org/WorkingGroups/PowerManagement/ Resources/TestSuite/PmQaSpecification
Ack for this series.
Lisa Nguyen (4): cpuhotplug: Rename 1_sanity_check files to cpuhotplug_00 files cpuhotplug: Rename z_sanity_check files to cpuhotplug_99 files cputopology: Add cputopology_sanity.sh Android: Update makefiles with new test numbers
cpuhotplug/1_sanity_check.sh | 40 ----------------------------- cpuhotplug/1_sanity_check.txt | 1 - cpuhotplug/Android.mk | 4 +-- cpuhotplug/cpuhotplug_00.sh | 40 +++++++++++++++++++++++++++++ cpuhotplug/cpuhotplug_00.txt | 1 + cpuhotplug/cpuhotplug_99.sh | 40 +++++++++++++++++++++++++++++ cpuhotplug/cpuhotplug_99.txt | 1 + cpuhotplug/z_sanity_check.sh | 40 ----------------------------- cpuhotplug/z_sanity_check.txt | 1 - cputopology/Android.mk | 2 +- cputopology/cputopology_sanity.sh | 49 ++++++++++++++++++++++++++++++++++++ cputopology/cputopology_sanity.txt | 1 + 12 files changed, 134 insertions(+), 86 deletions(-) delete mode 100755 cpuhotplug/1_sanity_check.sh delete mode 100644 cpuhotplug/1_sanity_check.txt create mode 100755 cpuhotplug/cpuhotplug_00.sh create mode 100644 cpuhotplug/cpuhotplug_00.txt create mode 100755 cpuhotplug/cpuhotplug_99.sh create mode 100644 cpuhotplug/cpuhotplug_99.txt delete mode 100755 cpuhotplug/z_sanity_check.sh delete mode 100644 cpuhotplug/z_sanity_check.txt create mode 100755 cputopology/cputopology_sanity.sh create mode 100644 cputopology/cputopology_sanity.txt
-- 1.7.9.5