From patchwork Wed Apr 8 11:44:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chase.qi@linaro.org X-Patchwork-Id: 46877 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BBF9221416 for ; Wed, 8 Apr 2015 12:10:31 +0000 (UTC) Received: by wgiv13 with SMTP id v13sf18876423wgi.3 for ; Wed, 08 Apr 2015 05:10:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=9riJeSgD2X795HxrHsK4aRbF/T0kro1lCzzeVoZybQE=; b=NioLP1jaOE0JRq2PSOHmggCAzGBS6UTH3w3gKufa42AIGKfGp9wW2xiVVtqnXXAQ4p VvO4NU86ExtmXq/05uBniUotMDAFLUPjge0eOz3PqP6FsnT9j9XaOTFscoXr8TCVFzIu GegK9spaoTq3yn382jmrNf0bDsOUGoF2SD/Rx2oTgRSan2imPR9d4MmsP/HM0ynKXgac tRnlmFzy7Eu33crS0/NQauFBXvNMG5aeSOQzVN73FzKkjVJqGa1lXOQfdwZRfzDbgN/s H1BSV/4q9KkzGQQMDnfEhLQt28HnJ//iBlrHQTgMMpOSItRonHt+n0OxWktzWCs+6soS ICNQ== X-Gm-Message-State: ALoCoQlPb8nDSWCg3zP9PWJfa0ZD4PxcAyWz5IFrsPq5EPvFcxPWnNDSsa0bpSLwDCBaVaJgshqH X-Received: by 10.180.106.136 with SMTP id gu8mr1301111wib.6.1428495031101; Wed, 08 Apr 2015 05:10:31 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.184.8 with SMTP id eq8ls191989lac.91.gmail; Wed, 08 Apr 2015 05:10:30 -0700 (PDT) X-Received: by 10.112.17.68 with SMTP id m4mr22686801lbd.50.1428495030847; Wed, 08 Apr 2015 05:10:30 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id l9si8613571lam.73.2015.04.08.05.10.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Apr 2015 05:10:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbbzk7 with SMTP id zk7so65224690lbb.0 for ; Wed, 08 Apr 2015 05:10:30 -0700 (PDT) X-Received: by 10.152.197.34 with SMTP id ir2mr22810866lac.36.1428495030673; Wed, 08 Apr 2015 05:10:30 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.67.65 with SMTP id l1csp1016342lbt; Wed, 8 Apr 2015 05:10:29 -0700 (PDT) X-Received: by 10.42.44.132 with SMTP id b4mr31703768icf.73.1428495029113; Wed, 08 Apr 2015 05:10:29 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id g7si9352765ioj.58.2015.04.08.05.10.28 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 08 Apr 2015 05:10:29 -0700 (PDT) Received-SPF: pass (google.com: domain of ltp-list-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YfooB-0002LK-JW; Wed, 08 Apr 2015 12:10:15 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YfooA-0002L7-CR for ltp-list@lists.sourceforge.net; Wed, 08 Apr 2015 12:10:14 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.192.172 as permitted sender) client-ip=209.85.192.172; envelope-from=chase.qi@linaro.org; helo=mail-pd0-f172.google.com; Received: from mail-pd0-f172.google.com ([209.85.192.172]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1Yfoo9-0002Ao-0E for ltp-list@lists.sourceforge.net; Wed, 08 Apr 2015 12:10:14 +0000 Received: by pdea3 with SMTP id a3so113508637pde.3 for ; Wed, 08 Apr 2015 05:10:07 -0700 (PDT) X-Received: by 10.66.90.168 with SMTP id bx8mr45894196pab.53.1428493459546; Wed, 08 Apr 2015 04:44:19 -0700 (PDT) Received: from localhost.localdomain ([180.150.157.40]) by mx.google.com with ESMTPSA id mt11sm10835421pbc.20.2015.04.08.04.44.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Apr 2015 04:44:18 -0700 (PDT) From: Chase Qi To: ltp-list@lists.sourceforge.net, milosz.wasilewski@linaro.org, naresh.kamboju@linaro.org Date: Wed, 8 Apr 2015 19:44:09 +0800 Message-Id: <1428493449-9784-1-git-send-email-chase.qi@linaro.org> X-Mailer: git-send-email 1.9.1 X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1Yfoo9-0002Ao-0E Subject: [LTP] [PATCH] cpuhotplug05.sh: fix invalid usage of sar X-BeenThere: ltp-list@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-list-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: chase.qi@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Use 24-hour time to unify time format. Fix invalid usage of sar. Increase the sleep time after online_cpu to adapt embedded hardware. Signed-off-by: Chase Qi --- .../kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh index bb0e896..f088d25 100755 --- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh @@ -5,6 +5,7 @@ export TCID="cpuhotplug05" export TST_TOTAL=1 +export LC_TIME="POSIX" # Includes: . test.sh @@ -80,11 +81,11 @@ TST_CLEANUP=do_clean until [ $LOOP_COUNT -gt $HOTPLUG05_LOOPS ]; do # Start up SAR and give it a couple cycles to run - sar 1 0 &>/dev/null & + sar 1 &>/dev/null & sleep 2 if ps -C sar &>/dev/null; then pkill sar - sar -P ALL 1 0 > $TMP/log_$$ & + sar -P ALL 1 > $TMP/log_$$ & else sar -P ALL 1 > $TMP/log_$$ & fi @@ -92,14 +93,14 @@ until [ $LOOP_COUNT -gt $HOTPLUG05_LOOPS ]; do SAR_PID=$! # Verify that SAR has correctly listed the missing CPU - while ! awk '{print $9}' $TMP/log_$$ | grep -i "^0.00"; do + while ! awk '{print $8}' $TMP/log_$$ | grep -i "^0.00"; do tst_brkm TBROK "CPU${CPU_TO_TEST} Not Found on SAR!" done time=`date +%X` sleep .5 # Verify that at least some of the CPUs are offline - NUMBER_CPU_OFF=$(grep "$time" $TMP/log_$$ | awk '{print $9}' \ + NUMBER_CPU_OFF=$(grep "$time" $TMP/log_$$ | awk '{print $8}' \ |grep -i "^0.00" | wc -l) if [ ${NUMBER_CPU_OFF} -eq 0 ]; then tst_brkm TBROK "no CPUs found offline" @@ -110,12 +111,12 @@ until [ $LOOP_COUNT -gt $HOTPLUG05_LOOPS ]; do tst_brkm TBROK "CPU${CPU_TO_TEST} cannot be onlined line" fi - sleep 1 + sleep 2 time=$(date +%T) sleep .5 # Check that SAR registered the change in CPU online/offline states - NEW_NUMBER_CPU_OFF=$(grep "$time" $TMP/log_$$|awk '{print $9}' \ + NEW_NUMBER_CPU_OFF=$(grep "$time" $TMP/log_$$|awk '{print $8}' \ | grep -i "^0.00"| wc -l) NUMBER_CPU_OFF=$((NUMBER_CPU_OFF-1)) if [ "$NUMBER_CPU_OFF" != "$NEW_NUMBER_CPU_OFF" ]; then