From patchwork Tue Mar 21 16:50:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 95664 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1554544qgd; Tue, 21 Mar 2017 10:35:07 -0700 (PDT) X-Received: by 10.36.14.77 with SMTP id 74mr3817598ite.115.1490117706918; Tue, 21 Mar 2017 10:35:06 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i8si21804756ioe.150.2017.03.21.10.35.05; Tue, 21 Mar 2017 10:35:06 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id EF0F463DAC; Tue, 21 Mar 2017 17:35:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id C5D626406C; Tue, 21 Mar 2017 17:25:11 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 6502B6066C; Tue, 21 Mar 2017 16:51:11 +0000 (UTC) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) by lists.linaro.org (Postfix) with ESMTPS id 5FF8460650 for ; Tue, 21 Mar 2017 16:51:10 +0000 (UTC) Received: by mail-lf0-f47.google.com with SMTP id j90so69520587lfk.2 for ; Tue, 21 Mar 2017 09:51:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5DpJ/xHPLIfLJxE/0YDGD6LRPSgzQ4eSbVf3/NpB7ZA=; b=UP0C073njTb9cPnCFZbVQyJW2WYNCPwQ6nPPQNwUG9NPPJ/SdktYIsGJrDW/xlfCFg wXkz71DuzcaASDcgARomneIuIq4RWmNJn6ECfpSGI/YdVlnl834aQ4trin5eEW+fNZ08 Uk0sDbJkl8/W1Ay4X39IkjxDk5LOO/OhwmNHm6TdgGX1HJIJZdSxOq6VwmwftOMr6O3v ffLE4HEGkiO3dOzemDDE2gtwFhgbwUejxjb4CyPEslL8x5hmun9fOXubrDm/JFRq2a/F 8aj1x98YyWnJ5JnetacIKvK8jVheK/t3OyMOqTWZIkZJGadprRwHKY1TuwH1k94+8TP5 bwqg== X-Gm-Message-State: AFeK/H3TEEsrM/dHKWZpp9kC3Os/sWOs5QO960tGMiEhjYWh9ptW9S9LcyOH8LO+lU3JKuiKngw= X-Received: by 10.46.5.2 with SMTP id 2mr12091322ljf.34.1490115069118; Tue, 21 Mar 2017 09:51:09 -0700 (PDT) Received: from localhost.localdomain (ppp95-165-131-83.pppoe.spdop.ru. [95.165.131.83]) by smtp.gmail.com with ESMTPSA id h24sm3785092ljb.46.2017.03.21.09.51.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Mar 2017 09:51:08 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Tue, 21 Mar 2017 19:50:58 +0300 Message-Id: <20170321165058.31753-1-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.11.0.295.gd7dffce Subject: [lng-odp] [PATCH] test: perf: fix bash syntax in odp_pktio_ordered_run.sh X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" bash -lt syntax expects 2 integer values, not strings. Also return code of piped command needs to be get in a little bit different way. https://bugs.linaro.org/show_bug.cgi?id=2872 Signed-off-by: Maxim Uvarov --- .../performance/odp_pktio_ordered_run.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) -- 2.11.0.295.gd7dffce Reviewed-by: Bill Fischofer diff --git a/test/common_plat/performance/odp_pktio_ordered_run.sh b/test/common_plat/performance/odp_pktio_ordered_run.sh index d91211c0..8b20cd59 100755 --- a/test/common_plat/performance/odp_pktio_ordered_run.sh +++ b/test/common_plat/performance/odp_pktio_ordered_run.sh @@ -24,17 +24,25 @@ fi $STDBUF ./odp_pktio_ordered${EXEEXT} -i pcap:in=${PCAP_IN}:loops=$LOOPS,\ pcap:out=${PCAP_OUT} -t $DURATION | tee $LOG -ret=$? +ret=${PIPESTATUS[0]} + +if [ $ret -ne 0 ]; then + echo "FAIL: no odp_pktio_ordered${EXEEXT}" + rm -f $LOG + exit $ret +fi if [ ! -f $LOG ]; then echo "FAIL: $LOG not found" ret=1 -elif [ $ret -eq 0 ]; then - MAX_PPS=$(awk '/TEST RESULT/ {print $3}' $LOG) - if [ "$MAX_PPS" -lt "$PASS_PPS" ]; then - echo "FAIL: pps below threshold $MAX_PPS < $PASS_PPS" - ret=1 - fi + exit $ret +fi + +MAX_PPS=$(awk '/TEST RESULT/ {print $3}' $LOG) +echo "MAX_PPS=$MAX_PPS" +if [ $MAX_PPS -lt $PASS_PPS ]; then + echo "FAIL: pps below threshold $MAX_PPS < $PASS_PPS" + ret=1 fi rm -f $LOG