From patchwork Mon Oct 3 08:18:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 4484 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B9DFD23F57 for ; Mon, 3 Oct 2011 08:20:48 +0000 (UTC) Received: from mail-ww0-f48.google.com (mail-ww0-f48.google.com [74.125.82.48]) by fiordland.canonical.com (Postfix) with ESMTP id B2C8BA18252 for ; Mon, 3 Oct 2011 08:20:48 +0000 (UTC) Received: by mail-ww0-f48.google.com with SMTP id 32so4234013wwe.17 for ; Mon, 03 Oct 2011 01:20:48 -0700 (PDT) Received: by 10.223.57.17 with SMTP id a17mr8853648fah.65.1317630048569; Mon, 03 Oct 2011 01:20:48 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.23.170 with SMTP id n10cs6257laf; Mon, 3 Oct 2011 01:20:48 -0700 (PDT) Received: by 10.216.221.79 with SMTP id q57mr7243358wep.22.1317630047790; Mon, 03 Oct 2011 01:20:47 -0700 (PDT) Received: from smtp.smtpout.orange.fr (smtp11.smtpout.orange.fr. [80.12.242.133]) by mx.google.com with ESMTP id u7si2446638wec.58.2011.10.03.01.20.47; Mon, 03 Oct 2011 01:20:47 -0700 (PDT) Received-SPF: neutral (google.com: 80.12.242.133 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=80.12.242.133; Authentication-Results: mx.google.com; spf=neutral (google.com: 80.12.242.133 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: from monster.dhcp.lxc ([90.60.119.82]) by mwinf5d34 with ME id g8Lj1h0021mlJK6038Lm44; Mon, 03 Oct 2011 10:20:47 +0200 X-ME-engine: default From: Daniel Lezcano To: linaro-dev@lists.linaro.org Subject: [pm-qa 07/10] check /proc/cpuinfo when unplugging a cpu Date: Mon, 3 Oct 2011 10:18:32 +0200 Message-Id: <1317629915-31767-7-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1317629915-31767-1-git-send-email-daniel.lezcano@linaro.org> References: <1317629915-31767-1-git-send-email-daniel.lezcano@linaro.org> Signed-off-by: Daniel Lezcano (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 diff --git a/cpuhotplug/cpuhotplug_05.txt b/cpuhotplug/cpuhotplug_05.txt new file mode 100644 index 0000000..9c4cfbf --- /dev/null +++ b/cpuhotplug/cpuhotplug_05.txt @@ -0,0 +1 @@ +test cpus are reflected on /proc/cpuinfo correctly