diff options
Diffstat (limited to 'common/scripts/pm-qa/cpuhotplug')
-rwxr-xr-x | common/scripts/pm-qa/cpuhotplug/1_sanity_check.sh | 40 | ||||
-rwxr-xr-x | common/scripts/pm-qa/cpuhotplug/cpuhotplug_01.sh | 37 | ||||
-rwxr-xr-x | common/scripts/pm-qa/cpuhotplug/cpuhotplug_02.sh | 61 | ||||
-rwxr-xr-x | common/scripts/pm-qa/cpuhotplug/cpuhotplug_03.sh | 52 | ||||
-rwxr-xr-x | common/scripts/pm-qa/cpuhotplug/cpuhotplug_04.sh | 72 | ||||
-rwxr-xr-x | common/scripts/pm-qa/cpuhotplug/cpuhotplug_05.sh | 50 | ||||
-rwxr-xr-x | common/scripts/pm-qa/cpuhotplug/cpuhotplug_06.sh | 50 | ||||
-rwxr-xr-x | common/scripts/pm-qa/cpuhotplug/cpuhotplug_07.sh | 67 | ||||
-rwxr-xr-x | common/scripts/pm-qa/cpuhotplug/cpuhotplug_08.sh | 50 | ||||
-rwxr-xr-x | common/scripts/pm-qa/cpuhotplug/z_sanity_check.sh | 40 |
10 files changed, 0 insertions, 519 deletions
diff --git a/common/scripts/pm-qa/cpuhotplug/1_sanity_check.sh b/common/scripts/pm-qa/cpuhotplug/1_sanity_check.sh deleted file mode 100755 index e091879..0000000 --- a/common/scripts/pm-qa/cpuhotplug/1_sanity_check.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# -# 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 : - -source ../include/functions.sh - -sanity_check() { - local 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/common/scripts/pm-qa/cpuhotplug/cpuhotplug_01.sh b/common/scripts/pm-qa/cpuhotplug/cpuhotplug_01.sh deleted file mode 100755 index a1dfe93..0000000 --- a/common/scripts/pm-qa/cpuhotplug/cpuhotplug_01.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# -# 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 : https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#cpuhotplug_01 - -source ../include/functions.sh - -FILES="online offline possible present" - -for i in $FILES; do - check_file $i $CPU_PATH || return 1 -done - -for_each_cpu check_cpuhotplug_files online -test_status_show diff --git a/common/scripts/pm-qa/cpuhotplug/cpuhotplug_02.sh b/common/scripts/pm-qa/cpuhotplug/cpuhotplug_02.sh deleted file mode 100755 index 2c582cf..0000000 --- a/common/scripts/pm-qa/cpuhotplug/cpuhotplug_02.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# -# 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 : https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#cpuhotplug_02 - -source ../include/functions.sh - -check_state() { - local cpu=$1 - local dirpath=$CPU_PATH/$1 - local state= - shift 1 - - if [ "$cpu" == "cpu0" ]; then - return 0 - fi - - set_offline $cpu - state=$(get_online $cpu) - - check "cpu is offline" "test $state -eq 0" - if [ $? -ne 0 ]; then - set_online $cpu - return 1 - fi - - set_online $cpu - state=$(get_online $cpu) - - check "cpu is online" "test $state -eq 1" - if [ $? -ne 0 ]; then - return 1 - fi - - return 0 -} - -for_each_cpu check_state -test_status_show diff --git a/common/scripts/pm-qa/cpuhotplug/cpuhotplug_03.sh b/common/scripts/pm-qa/cpuhotplug/cpuhotplug_03.sh deleted file mode 100755 index d4816ca..0000000 --- a/common/scripts/pm-qa/cpuhotplug/cpuhotplug_03.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# -# 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 : https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#cpuhotplug_03 - -source ../include/functions.sh - -check_affinity_fails() { - local cpu=$1 - local cpuid=${cpu:3} - local dirpath=$CPU_PATH/$1 - local ret= - - if [ "$cpu" == "cpu0" ]; then - return 0 - fi - - set_offline $cpu - - taskset -c $cpuid /bin/true - ret=$? - check "setting affinity on cpu fails" "test $ret -ne 0" - - set_online $cpu - - return 0 -} - -for_each_cpu check_affinity_fails -test_status_show diff --git a/common/scripts/pm-qa/cpuhotplug/cpuhotplug_04.sh b/common/scripts/pm-qa/cpuhotplug/cpuhotplug_04.sh deleted file mode 100755 index 67098e1..0000000 --- a/common/scripts/pm-qa/cpuhotplug/cpuhotplug_04.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash -# -# 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 : https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#cpuhotplug_04 - -CPUBURN=../utils/cpuburn -source ../include/functions.sh - -check_task_migrate() { - local cpu=$1 - local cpuid=${cpu:3} - local cpumask=$((1 << cpuid)) - local dirpath=$CPU_PATH/$1 - local pid= - local ret= - - if [ "$cpu" == "cpu0" ]; then - return 0 - fi - - taskset -c 0x$cpumask $CPUBURN $cpu & - pid=$! - sleep 1 # let taskset to do setaffinity before checking - - ret=$(taskset -p $pid | cut -d ':' -f 2) - ret=$(echo $ret) # remove trailing whitespace - ret=$(printf "%d" 0x$ret) - check "affinity is set" "test $cpumask -eq $ret" - - sleep 1 - set_offline $cpu - ret=$? - - check "offlining a cpu with affinity succeed" "test $ret -eq 0" - - ret=$(taskset -p $pid | cut -d ':' -f 2) - ret=$(echo $ret) - ret=$(printf "%d" 0x$ret) - check "affinity changed" "test $cpumask -ne $ret" - - kill $pid - - # in any case we set the cpu online in case of the test fails - set_online $cpu - - return 0 -} - -for_each_cpu check_task_migrate -test_status_show diff --git a/common/scripts/pm-qa/cpuhotplug/cpuhotplug_05.sh b/common/scripts/pm-qa/cpuhotplug/cpuhotplug_05.sh deleted file mode 100755 index 98371d4..0000000 --- a/common/scripts/pm-qa/cpuhotplug/cpuhotplug_05.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# -# 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 : https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#cpuhotplug_05 - -source ../include/functions.sh - -check_procinfo() { - local cpu=$1 - local cpuid=${cpu:3} - local ret= - - if [ "$cpu" == "cpu0" ]; then - return 0 - fi - - set_offline $cpu - - TAB=$(printf "\t"); grep "processor$TAB: $cpuid" /proc/cpuinfo - ret=$? - - check "offline processor not found in cpuinfo" "test $ret -ne 0" - - set_online $cpu -} - -for_each_cpu check_procinfo -test_status_show diff --git a/common/scripts/pm-qa/cpuhotplug/cpuhotplug_06.sh b/common/scripts/pm-qa/cpuhotplug/cpuhotplug_06.sh deleted file mode 100755 index 1f2641d..0000000 --- a/common/scripts/pm-qa/cpuhotplug/cpuhotplug_06.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# -# 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 : https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#cpuhotplug_06 - -source ../include/functions.sh - -check_procinfo() { - local cpu=$1 - local cpuid=${cpu:3} - local ret= - - if [ "$cpu" == "cpu0" ]; then - return 0 - fi - - set_offline $cpu - - grep "CPU$cpuid" /proc/interrupts - ret=$? - - check "offline processor not found in interrupts" "test $ret -ne 0" - - set_online $cpu -} - -for_each_cpu check_procinfo -test_status_show diff --git a/common/scripts/pm-qa/cpuhotplug/cpuhotplug_07.sh b/common/scripts/pm-qa/cpuhotplug/cpuhotplug_07.sh deleted file mode 100755 index 6486dd7..0000000 --- a/common/scripts/pm-qa/cpuhotplug/cpuhotplug_07.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# -# 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 : https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#cpuhotplug_07 - -source ../include/functions.sh -TMPFILE=cpuhotplug_07.tmp - -check_notification() { - local cpu=$1 - local cpuid=${cpu:3} - local pid= - local ret= - - if [ "$cpu" == "cpu0" ]; then - return 0 - fi - - # damn ! udevadm is buffering the output, we have to use a temp file - # to retrieve the output - rm -f $TMPFILE - udevadm monitor --kernel --subsystem-match=cpu > $TMPFILE & - pid=$! - - set_offline $cpu - set_online $cpu - - # let the time the notification to reach userspace - # and buffered in the file - sleep 1 - kill $pid - - grep "offline" $TMPFILE | grep -q "/devices/system/cpu/$cpu" - ret=$? - check "offline event was received" "test $ret -eq 0" - - grep "online" $TMPFILE | grep -q "/devices/system/cpu/$cpu" - ret=$? - check "online event was received" "test $ret -eq 0" - - rm -f $TMPFILE -} - -for_each_cpu check_notification -test_status_show diff --git a/common/scripts/pm-qa/cpuhotplug/cpuhotplug_08.sh b/common/scripts/pm-qa/cpuhotplug/cpuhotplug_08.sh deleted file mode 100755 index d413595..0000000 --- a/common/scripts/pm-qa/cpuhotplug/cpuhotplug_08.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# -# 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 : https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#cpuhotplug_08 - -source ../include/functions.sh - -function randomize() { - echo $[ ( $RANDOM % $1 ) + 1 ] -} - -random_stress() { - local cpu_present=$(cat /sys/devices/system/cpu/present | cut -d '-' -f 2) - local cpurand=$(randomize $cpu_present) - local ret= - - # randomize will in range "1-$cpu_present) so cpu0 is ignored - set_offline cpu$cpurand - ret=$? - check "cpu$cpurand is offline" "test $ret -eq 0" - - set_online cpu$cpurand - ret=$? - check "cpu$cpurand is online" "test $ret -eq 0" -} - -for i in $(seq 1 50); do random_stress || break; done -test_status_show diff --git a/common/scripts/pm-qa/cpuhotplug/z_sanity_check.sh b/common/scripts/pm-qa/cpuhotplug/z_sanity_check.sh deleted file mode 100755 index c39413e..0000000 --- a/common/scripts/pm-qa/cpuhotplug/z_sanity_check.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# -# 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 : - -source ../include/functions.sh - -sanity_check() { - local 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 |