From patchwork Fri Sep 16 20:50:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 4149 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 8C25523EFD for ; Fri, 16 Sep 2011 20:50:59 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 6CC52A18B44 for ; Fri, 16 Sep 2011 20:50:59 +0000 (UTC) Received: by fxe23 with SMTP id 23so2976533fxe.11 for ; Fri, 16 Sep 2011 13:50:59 -0700 (PDT) Received: by 10.223.34.143 with SMTP id l15mr460156fad.46.1316206259264; Fri, 16 Sep 2011 13:50:59 -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.11.8 with SMTP id m8cs140498lab; Fri, 16 Sep 2011 13:50:58 -0700 (PDT) Received: by 10.216.140.165 with SMTP id e37mr1176509wej.71.1316206258438; Fri, 16 Sep 2011 13:50:58 -0700 (PDT) Received: from mtagate1.uk.ibm.com (mtagate1.uk.ibm.com [194.196.100.161]) by mx.google.com with ESMTPS id x32si12314681weq.119.2011.09.16.13.50.58 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 16 Sep 2011 13:50:58 -0700 (PDT) Received-SPF: neutral (google.com: 194.196.100.161 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=194.196.100.161; Authentication-Results: mx.google.com; spf=neutral (google.com: 194.196.100.161 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate1.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p8GKovNt015727; Fri, 16 Sep 2011 20:50:57 GMT Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p8GKov1R2584580; Fri, 16 Sep 2011 21:50:57 +0100 Received: from d06av03.portsmouth.uk.ibm.com (localhost.localdomain [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8GKoviW013078; Fri, 16 Sep 2011 14:50:57 -0600 Received: from smtp.lab.toulouse-stg.fr.ibm.com (syslog.lab.toulouse-stg.fr.ibm.com [9.101.4.104]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p8GKouOZ013075; Fri, 16 Sep 2011 14:50:57 -0600 Received: from localhost.localdomain (sig-9-146-237-162.de.ibm.com [9.146.237.162]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id 33440211020; Fri, 16 Sep 2011 22:50:56 +0200 (CEST) From: Daniel Lezcano To: linaro-dev@lists.linaro.org Cc: paul.larson@linaro.org Subject: [pm-qa 1/2] fix error in script Date: Fri, 16 Sep 2011 22:50:55 +0200 Message-Id: <1316206256-11052-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.4.1 Prevent a syntax error when running the test which leads to an exception in the script and exiting wildely the loop. The cpuburn stays running in background. Signed-off-by: Daniel Lezcano --- include/functions.sh | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/functions.sh b/include/functions.sh index 2cc44b3..f003414 100644 --- a/include/functions.sh +++ b/include/functions.sh @@ -109,8 +109,18 @@ get_governor() { wait_latency() { local cpu=$1 local dirpath=$CPU_PATH/$cpu/cpufreq - local latency=$(cat $dirpath/cpuinfo_transition_latency) - local nrfreq=$(cat $dirpath/scaling_available_frequencies | wc -w) + local latency= + local nrfreq= + + latency=$(cat $dirpath/cpuinfo_transition_latency) + if [ $? != 0 ]; then + return $? + fi + + nrfreq=$(cat $dirpath/scaling_available_frequencies | wc -w) + if [ $? != 0 ]; then + return $? + fi nrfreq=$((nrfreq + 1)) ../utils/nanosleep $(($nrfreq * $latency))