From patchwork Mon Mar 25 12:07:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sanjay Singh Rawat X-Patchwork-Id: 15592 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 12D8623DEE for ; Mon, 25 Mar 2013 12:09:03 +0000 (UTC) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com [209.85.215.51]) by fiordland.canonical.com (Postfix) with ESMTP id BF44EA192A3 for ; Mon, 25 Mar 2013 12:09:02 +0000 (UTC) Received: by mail-la0-f51.google.com with SMTP id fo13so11226803lab.38 for ; Mon, 25 Mar 2013 05:09:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=8H5PmbFoRs49TVGiVyhNfyOVlsSS1cMO3xQzp4oCKx0=; b=i/fgIXdD5jN1pLuW6aGaxWG/rsa65Z4/uDPxUNFjPPzZtbN/cgagcAroEeSjeINmYj mhDqKxxZzbmIzEzWV3e6RUUMg4CQQcIDmZe6KlpotWslpDtQ4npYQ3l16RP24HLtZ+sU 2/6jkQ5DD0Dcg5+uu/hmmpxPk3NZ4v1TLwl8wfrZuyCYsN5qWoplh5t8ekP9gbOj+D9e JOXdlbL2yNe8WffNG10xRmrsrTp0SENYhtXqnhVsC1wL908/cf0rMVBkn/aBpJs2FedK PSU9+HWmvYyGKHgArgb1ScgNt6EJVpHDA7sL/CrM8WOc1R8gVW7EB5WDTe4zv+JCaEDG 1y0A== X-Received: by 10.112.79.1 with SMTP id f1mr6063104lbx.114.1364213342069; Mon, 25 Mar 2013 05:09:02 -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.112.147.5 with SMTP id tg5csp44016lbb; Mon, 25 Mar 2013 05:09:00 -0700 (PDT) X-Received: by 10.68.27.164 with SMTP id u4mr17421168pbg.69.1364213340013; Mon, 25 Mar 2013 05:09:00 -0700 (PDT) Received: from mail-da0-x22b.google.com (mail-da0-x22b.google.com [2607:f8b0:400e:c00::22b]) by mx.google.com with ESMTPS id fd8si13565715pad.162.2013.03.25.05.08.59 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 05:09:00 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c00::22b is neither permitted nor denied by best guess record for domain of sanjay.rawat@linaro.org) client-ip=2607:f8b0:400e:c00::22b; Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400e:c00::22b is neither permitted nor denied by best guess record for domain of sanjay.rawat@linaro.org) smtp.mail=sanjay.rawat@linaro.org Received: by mail-da0-f43.google.com with SMTP id u36so3202339dak.30 for ; Mon, 25 Mar 2013 05:08:59 -0700 (PDT) X-Received: by 10.66.149.73 with SMTP id ty9mr17850520pab.66.1364213339124; Mon, 25 Mar 2013 05:08:59 -0700 (PDT) Received: from srawat-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPS id tm1sm13270809pbc.11.2013.03.25.05.08.55 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 05:08:58 -0700 (PDT) From: Sanjay Singh Rawat To: linaro-dev@lists.linaro.org Cc: Daniel Lezcano , Sanjay Singh Rawat Subject: [PATCH pmqa] pm-qa: add test for cpu topology attributes Date: Mon, 25 Mar 2013 17:37:51 +0530 Message-Id: <1364213271-9653-1-git-send-email-sanjay.rawat@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQlYuoFEhMTg7FSTP6yMOSo9mDCWUUmZembasBRFW/GAk6ZxRCAyYaoMnQkgpz2n8LLwzTEM From: Daniel Lezcano test checks for topology attributes of cpus Signed-off-by: Sanjay Singh Rawat --- cputopology/Android.mk | 18 ++++++++++++++++++ cputopology/Makefile | 25 +++++++++++++++++++++++++ cputopology/cputopology_01.sh | 38 ++++++++++++++++++++++++++++++++++++++ cputopology/cputopology_01.txt | 1 + cputopology/cputopology_02.sh | 33 +++++++++++++++++++++++++++++++++ cputopology/cputopology_02.txt | 1 + 6 files changed, 116 insertions(+) create mode 100644 cputopology/Android.mk create mode 100644 cputopology/Makefile create mode 100755 cputopology/cputopology_01.sh create mode 100644 cputopology/cputopology_01.txt create mode 100755 cputopology/cputopology_02.sh create mode 100644 cputopology/cputopology_02.txt diff --git a/cputopology/Android.mk b/cputopology/Android.mk new file mode 100644 index 0000000..7f2c1ef --- /dev/null +++ b/cputopology/Android.mk @@ -0,0 +1,18 @@ +include $(call all-subdir-makefiles) +LOCAL_PATH:= $(call my-dir) + +module_name = cputopology + +define $(module_name)_add_executable + include $(CLEAR_VARS) + LOCAL_MODULE_TAGS := optional + LOCAL_MODULE_CLASS := tests + LOCAL_MODULE := $1.sh + systemtarball: $1.sh + LOCAL_SRC_FILES := $1.sh + LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)/pm-qa/$(module_name) + include $(BUILD_PREBUILT) +endef + +test_num := 01 02 +$(foreach item,$(test_num),$(eval $(call $(module_name)_add_executable, $(module_name)_$(item)))) diff --git a/cputopology/Makefile b/cputopology/Makefile new file mode 100644 index 0000000..a90620c --- /dev/null +++ b/cputopology/Makefile @@ -0,0 +1,25 @@ +# +# 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 (IBM Corporation) +# - initial API and implementation +# + +include ../Test.mk \ No newline at end of file diff --git a/cputopology/cputopology_01.sh b/cputopology/cputopology_01.sh new file mode 100755 index 0000000..c7cbc26 --- /dev/null +++ b/cputopology/cputopology_01.sh @@ -0,0 +1,38 @@ +#!/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 (IBM Corporation) +# - initial API and implementation +# + +# URL : https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#sched_mc_02 + +source ../include/functions.sh + +check_physical_package_id() { + + local package_id=$CPU_PATH/$1/topology/physical_package_id + local val=$(cat $package_id) + + check "topology is enabled" "test \"$val\" != \"-1\"" +} + +for_each_cpu check_physical_package_id || exit 1 diff --git a/cputopology/cputopology_01.txt b/cputopology/cputopology_01.txt new file mode 100644 index 0000000..5493610 --- /dev/null +++ b/cputopology/cputopology_01.txt @@ -0,0 +1 @@ +test the topology is implemented in the kernel diff --git a/cputopology/cputopology_02.sh b/cputopology/cputopology_02.sh new file mode 100755 index 0000000..6520ce5 --- /dev/null +++ b/cputopology/cputopology_02.sh @@ -0,0 +1,33 @@ +#!/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 (IBM Corporation) +# - initial API and implementation +# + +# URL : https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#sched_mc_03 + +source ../include/functions.sh + +FILES="core_id core_siblings core_siblings_list physical_package_id \ +thread_siblings thread_siblings_list" + +for_each_cpu check_topology_files $FILES diff --git a/cputopology/cputopology_02.txt b/cputopology/cputopology_02.txt new file mode 100644 index 0000000..b9e8d6f --- /dev/null +++ b/cputopology/cputopology_02.txt @@ -0,0 +1 @@ +test the topology files are present