From patchwork Wed Jul 18 07:33:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 945529 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cn.fujitsu.com Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41VpK00L1Cz9s3R for ; Wed, 18 Jul 2018 17:13:23 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 41ADD3E76C6 for ; Wed, 18 Jul 2018 09:13:21 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [217.194.8.3]) by picard.linux.it (Postfix) with ESMTP id AB1CF3E76AC for ; Wed, 18 Jul 2018 09:13:19 +0200 (CEST) Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by in-3.smtp.seeweb.it (Postfix) with ESMTP id AF8891A013A6 for ; Wed, 18 Jul 2018 09:13:17 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="42363758" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 18 Jul 2018 15:13:16 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id EE8484B5CD80 for ; Wed, 18 Jul 2018 15:13:16 +0800 (CST) Received: from RHEL7U5Alpha_SERVER.g08.fujitsu.local (10.167.220.156) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.399.0; Wed, 18 Jul 2018 15:13:16 +0800 From: Xiao Yang To: Date: Wed, 18 Jul 2018 15:33:37 +0800 Message-ID: <1531899217-27690-1-git-send-email-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.167.220.156] X-yoursite-MailScanner-ID: EE8484B5CD80.AE10C X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@cn.fujitsu.com X-Spam-Status: No, score=0.0 required=7.0 tests=none autolearn=disabled version=3.4.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH] hotplug/cpu_hotplug05.sh: Fix obsolete output of offline CPU X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" With sysstat-11.7.1, running cpu_hotplug05.sh got the following error: --------------------------------------------------------------------- cpuhotplug05 1 TBROK: Field 3 is '%user', '0.00' expected --------------------------------------------------------------------- According to commit 970cae1 and 1f71a6f, sar/sadf didn't display offline CPU since sysstat-11.7.1. It is reasonable for offline CPU to get nothing. Signed-off-by: Xiao Yang --- .../hotplug/cpu_hotplug/functional/cpuhotplug05.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh index 59c8324..ab81684 100755 --- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh @@ -108,12 +108,18 @@ until [ $LOOP_COUNT -gt $HOTPLUG05_LOOPS ]; do tst_brkm TBROK "SAR output file is empty" fi - for i in $(seq 3 8); do - field=$(get_field "$offline_status" "$i") - if [ "$field" != "0.00" ]; then - tst_brkm TBROK "Field $i is '$field', '0.00' expected" - fi - done + cpu_field=$(get_field "$offline_status" "2") + if [ "${cpu_field}" = "CPU" ]; then + # Since sysstat-11.7.1, sar/sadf didn't display offline CPU + tst_resm TINFO "SAR didn't display offline CPU" + else + for i in $(seq 3 8); do + field=$(get_field "$offline_status" "$i") + if [ "$field" != "0.00" ]; then + tst_brkm TBROK "Field $i is '$field', '0.00' expected" + fi + done + fi # Online the CPU if ! online_cpu ${CPU_TO_TEST}; then