From patchwork Thu Mar 30 16:20:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 96322 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp316068qgd; Thu, 30 Mar 2017 09:21:31 -0700 (PDT) X-Received: by 10.200.53.209 with SMTP id l17mr539263qtb.281.1490890891293; Thu, 30 Mar 2017 09:21:31 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id l63si2207275qke.10.2017.03.30.09.21.30; Thu, 30 Mar 2017 09:21:31 -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 B192062D8E; Thu, 30 Mar 2017 16:21:30 +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 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 AB5B360F57; Thu, 30 Mar 2017 16:21:26 +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 E09B86170C; Thu, 30 Mar 2017 16:21:23 +0000 (UTC) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com [209.85.215.53]) by lists.linaro.org (Postfix) with ESMTPS id 2079F60F4C for ; Thu, 30 Mar 2017 16:21:22 +0000 (UTC) Received: by mail-lf0-f53.google.com with SMTP id j90so30934007lfk.2 for ; Thu, 30 Mar 2017 09:21:22 -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=bjFdIhpl9m13T5OHVJzLTpqpdmglwhSY+UFJkpq1x08=; b=opcbjmp5+zw2oXmMZIMRk6/NqzdcVkMldjV1t3vJDRCUjXVAfEa8ZG6NwjWT87EahB hiwoxmWt5RvhyZiG3Yj25AIbqjbQWRTLljEeJku/MtKw5js6pdH48eIBBg5hNQpmpuAB Z+67CTevkL88tNDgxqFCcRq1LQUyR9/EN0sxci52RJLp+MDZEartmqukwkMeWPvDbCtt W2rL66w1poCCjRRNX5LCZU9eDChZgwSPiohJKJCHjSIfm+bHGdlvUbE5Ck5eUQsH0gYX JF5mgmqW2J+MMclObENBExklh4nfgwcwI5E3rr9BbqU1h7qYY3MLWHoq9JgcrpQEd2R5 Y3jw== X-Gm-Message-State: AFeK/H0D+CVEOGGrtW1rGbBmYrc510oFAlWLg+9ybLzyKvAeeKwvzGMFaIxbIfikwA3KCgjaPwQ= X-Received: by 10.46.14.10 with SMTP id 10mr213969ljo.22.1490890880947; Thu, 30 Mar 2017 09:21:20 -0700 (PDT) Received: from localhost.localdomain (ppp95-165-131-83.pppoe.spdop.ru. [95.165.131.83]) by smtp.gmail.com with ESMTPSA id i1sm453951ljd.47.2017.03.30.09.21.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Mar 2017 09:21:20 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 30 Mar 2017 19:20:57 +0300 Message-Id: <20170330162057.30366-1-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.11.0.295.gd7dffce Subject: [lng-odp] [PATCHv2] 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 --- v2: after repairing test logic make distcheck failed due to missing targets. Added what was needed. test/common_plat/performance/Makefile.am | 2 ++ .../performance/odp_pktio_ordered_run.sh | 36 ++++++++++++++++------ 2 files changed, 28 insertions(+), 10 deletions(-) -- 2.11.0.295.gd7dffce Reviewed-by: Bill Fischofer diff --git a/test/common_plat/performance/Makefile.am b/test/common_plat/performance/Makefile.am index 9111c0c2..3299f03f 100644 --- a/test/common_plat/performance/Makefile.am +++ b/test/common_plat/performance/Makefile.am @@ -51,3 +51,5 @@ dist_odp_scheduling_SOURCES = odp_scheduling.c dist_odp_pktio_perf_SOURCES = odp_pktio_perf.c EXTRA_DIST = $(TESTSCRIPTS) + +dist_check_SCRIPTS = udp64.pcap diff --git a/test/common_plat/performance/odp_pktio_ordered_run.sh b/test/common_plat/performance/odp_pktio_ordered_run.sh index d91211c0..d6c2be52 100755 --- a/test/common_plat/performance/odp_pktio_ordered_run.sh +++ b/test/common_plat/performance/odp_pktio_ordered_run.sh @@ -5,14 +5,21 @@ # # SPDX-License-Identifier: BSD-3-Clause # +TEST_SRC_DIR=$(dirname $0) +TEST_DIR="${TEST_DIR:-$(dirname $0)}" DURATION=5 LOG=odp_pktio_ordered.log LOOPS=100000000 PASS_PPS=5000 -PCAP_IN=`find . ${TEST_DIR} $(dirname $0) -name udp64.pcap -print -quit` +PCAP_IN=`find . ${TEST_SRC_DIR} $(dirname $0) -name udp64.pcap -print -quit` PCAP_OUT=/dev/null +if [ ! -f ${PCAP_IN} ]; then + echo "FAIL: no udp64.pcap" + exit 1 +fi + # This just turns off output buffering so that you still get periodic # output while piping to tee, as long as stdbuf is available. if [ "$(which stdbuf)" != "" ]; then @@ -21,20 +28,29 @@ else STDBUF= fi -$STDBUF ./odp_pktio_ordered${EXEEXT} -i pcap:in=${PCAP_IN}:loops=$LOOPS,\ -pcap:out=${PCAP_OUT} -t $DURATION | tee $LOG +$STDBUF ${TEST_DIR}/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