blob: 12df3c42bb682ed6166385244326992153cf440c [file] [log] [blame]
Daniel Lezcano1c7c46b2011-10-03 11:07:37 +02001#!/bin/bash
2#
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
26# URL : https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#cpuhotplug_05
27
28source ../include/functions.sh
29
30check_procinfo() {
31 local cpu=$1
32 local cpuid=${cpu:3}
33 local ret=
34
35 if [ "$cpu" == "cpu0" ]; then
36 return 0
37 fi
38
39 set_offline $cpu
40
41 TAB=$(printf "\t"); grep "processor$TAB: $cpuid" /proc/cpuinfo
42 ret=$?
43
44 check "offline processor not found in cpuinfo" "test $ret -ne 0"
45
46 set_online $cpu
47}
48
49for_each_cpu check_procinfo