blob: 960150a7d7d23013f95b2261f497007b018c0b95 [file] [log] [blame]
Lisa Nguyenadf9df92015-01-25 18:16:45 -08001#!/bin/sh
Daniel Lezcano1c7c46b2011-10-03 11:07:37 +02002#
Daniel Lezcano35fb1722011-10-03 13:56:11 +02003# PM-QA validation test suite for the power management on Linux
Daniel Lezcano1c7c46b2011-10-03 11:07:37 +02004#
5# Copyright (C) 2011, Linaro Limited.
6#
7# This program is free software; you can redistribute it and/or
8# modify it under the terms of the GNU General Public License
9# as published by the Free Software Foundation; either version 2
10# of the License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20#
21# Contributors:
22# Daniel Lezcano <daniel.lezcano@linaro.org> (IBM Corporation)
23# - initial API and implementation
24#
25
Sanjay Singh Rawat912729b2013-08-21 20:18:40 +053026# URL : https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/PmQaSpecification#cpuhotplug_05
Daniel Lezcano1c7c46b2011-10-03 11:07:37 +020027
Lisa Nguyenadf9df92015-01-25 18:16:45 -080028. ../include/functions.sh
Daniel Lezcano1c7c46b2011-10-03 11:07:37 +020029
30check_procinfo() {
Lisa Nguyen4e0b59a2015-01-25 17:46:40 -080031 cpu=$1
Lisa Nguyen2c90cbb2015-01-26 17:05:04 -080032 cpuid=$(echo $cpu | awk '{print substr($0,4)}')
Daniel Lezcano1c7c46b2011-10-03 11:07:37 +020033
Lisa Nguyend1e0be92015-01-27 13:57:02 -080034 if [ "$cpu" = "cpu0" ]; then
Lisa Nguyene2323182014-07-04 10:24:30 +053035 is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
Daniel Lezcano1c7c46b2011-10-03 11:07:37 +020036 fi
37
38 set_offline $cpu
39
40 TAB=$(printf "\t"); grep "processor$TAB: $cpuid" /proc/cpuinfo
41 ret=$?
42
43 check "offline processor not found in cpuinfo" "test $ret -ne 0"
44
45 set_online $cpu
46}
47
48for_each_cpu check_procinfo
Sanjay Singh Rawat3bf61942013-04-10 14:06:14 +053049test_status_show