From patchwork Wed Jul 13 07:30:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Forrest Shi X-Patchwork-Id: 71904 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp867683qga; Wed, 13 Jul 2016 00:45:12 -0700 (PDT) X-Received: by 10.107.132.217 with SMTP id o86mr7417340ioi.18.1468395912350; Wed, 13 Jul 2016 00:45:12 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id z124si5961088itg.116.2016.07.13.00.45.12; Wed, 13 Jul 2016 00:45:12 -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 dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id CD0136864F; Wed, 13 Jul 2016 07:45:11 +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=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, 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 DCCF16179E; Wed, 13 Jul 2016 07:45:06 +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 434B46175E; Wed, 13 Jul 2016 07:44:55 +0000 (UTC) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0085.outbound.protection.outlook.com [104.47.33.85]) by lists.linaro.org (Postfix) with ESMTPS id 3846F6863F for ; Wed, 13 Jul 2016 07:41:43 +0000 (UTC) Received: from BY2PR03CA055.namprd03.prod.outlook.com (10.141.249.28) by DM5PR03MB2507.namprd03.prod.outlook.com (10.168.233.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12; Wed, 13 Jul 2016 07:41:42 +0000 Received: from BN1AFFO11FD022.protection.gbl (2a01:111:f400:7c10::132) by BY2PR03CA055.outlook.office365.com (2a01:111:e400:2c5d::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.534.14 via Frontend Transport; Wed, 13 Jul 2016 07:41:42 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 192.88.168.50 as permitted sender) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD022.mail.protection.outlook.com (10.58.52.82) with Microsoft SMTP Server (TLS) id 15.1.534.7 via Frontend Transport; Wed, 13 Jul 2016 07:41:40 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u6D7faWq017072; Wed, 13 Jul 2016 00:41:38 -0700 From: To: Date: Wed, 13 Jul 2016 15:30:48 +0800 Message-ID: <1468395048-5024-1-git-send-email-forrest.shi@linaro.org> X-Mailer: git-send-email 2.1.0.27.g96db324 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131128693013696822; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(189002)(199003)(97736004)(6806005)(104016004)(47776003)(19580395003)(19580405001)(2351001)(86362001)(106466001)(92566002)(77096005)(189998001)(110136002)(105596002)(86152002)(50986999)(8676002)(81156014)(15975445007)(81166006)(48376002)(356003)(229853001)(7846002)(50466002)(586003)(5003940100001)(2876002)(2906002)(11100500001)(305945005)(87936001)(50226002)(8936002)(4326007)(33646002)(68736007)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2507; H:tx30smr01.am.freescale.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD022; 1:aEeQOqUaWPbFZvrI13BdBug675TUEqqD6Xih1iFuXd1/tsxvfECrOVpkMDU8U6l19r4V4t2nsjklmK7a0s9nfbxriv1FeH7rAQYCW6gKkQz6sc3ShkPP2sMxIR/Osd8RVykAIFEZtcKFFQrF2L1BNba6cX8VB26FZQkOiN1UNeQLqDha8bcNvx2eF7TWPS9ApHIufVnKmmk56/kw8rD4Rrds3ui+VrIkrOKVEU7cTLbUhE8hpS44pqS6J6vb6RJTjMERV0KO0UHxzV+V2pTptoHhGdas8Hoc+pogFeyInXsdtJq/HjMoB4GDD5gYOzgBvhFPhRo2em0F96c3IU16pT1cPThuBE8goytOIZELFx+Uv1f0Mjk9GCNzQsBtGaAttuwDwFET3T/Eoy/okzCf+K1e8G5yxF61CXPQVXkp9BEjRy87hNbf1IdbezWrMwemfsO278kbLpdVaTXK2UKOjuy76T/W2+2xtO0fzeaYBVOvrEPzx9lz+PEnYxNqJVD8EZgLHwJHS4adGhBZ2X9AlzjEx3TcQSAMfzBco/NjI3egcr8v2+YxN6K8BkB5PXjMYSGK4hCh5znM+zYv8tMdDZV89zdjqPIQ98qHag7oYeA= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: f14b2109-b68c-4500-a78f-08d3aaf12157 X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2507; 2:qxCAhoHm4i479Y4URVTq8l+L4OPxNfSqbVxYzjVotTTmZzSjdzruxMz0NiiT6ZUGtFCBn77G3mwU/91yDVp3X8pI/6XG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mqLg4IDJo0FBbyhgM/MWmHIFeR8bkGE+pnZv8ZGqatF5OjmhaKnTQIfJSbibJ60H6TKkqNbXXS6EOLgMmhHM/q7F2PSrs9JJde4ot+cE0iE0Iv0f/RHCGYB0go95T5DVCrQ0Q1QnKcz+ZFm5lmSW/ZQN5ee3U= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(13023025)(13017025)(13024025)(13015025)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:DM5PR03MB2507; BCL:0; PCL:0; RULEID:(400006); SRVR:DM5PR03MB2507; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2507; 4:YwslDBGnLXUCoKHIdbzTV30xe3vo+tWMrSOIa3pCCz3Mv1gWbKdUvxP4yuS+Je9ArBYi7I7WeELkoy6xgBfRvSZhPR0KNZ6zewfFmyNapFbZhwybksrDvUql5jiB+YwJ3vSW+bDdMcqixUCXliMAcbAI172sOyLSL8NvKc32RO/hbOoX7u0w0C0cHRz+1ew+g72YYG90JEfyqMTKseSTwFKu3fGQXKBxUwu367Jyq2ynXjTS7cGo4BrDE3f8SR/4TVcN6NLPsXeyRkqnZqG/T7fmcyQQDoA99t3VnfffDlJPKt1GdyrqAwE55p0bCwQQ5lcExZTLjwgLKWL/OU4C7ZAhOTekzznJ1bA2jAp7WctnUsWsKuUK1I9OmC9A7cm8MOZEXPUrAt+tbNsE5KxE0bWB2I4M/QykHbRdsUankKdlQK+WlmN1z3Tv+gJF01xDoeilzwUOlVYVyAQcVs+KgK/aRK0KLbdjC1OXEf+vLkk= X-Forefront-PRVS: 000227DA0C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2507; 23:u2fDxYWvfo5i5CjQlr1994EVAO9S2oB86aoQG/7aO?= =?us-ascii?Q?Ug5mNWfjDg41QtGOc8q98cPAiNQ9dXVdExIKSi3CDU9VH4r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osticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2016 07:41:40.9640 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2507 X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCH 2/2] example/l3fwd: add test script 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" From: Xuelin Shi Signed-off-by: Xuelin Shi --- example/l3fwd/odp_l3fwd_run.sh | 97 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 example/l3fwd/odp_l3fwd_run.sh -- 2.1.0.27.g96db324 diff --git a/example/l3fwd/odp_l3fwd_run.sh b/example/l3fwd/odp_l3fwd_run.sh new file mode 100644 index 0000000..db9a838 --- /dev/null +++ b/example/l3fwd/odp_l3fwd_run.sh @@ -0,0 +1,97 @@ +#!/bin/sh +# +# Copyright (c) 2016, Linaro Limited +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# + +# The script assumes that the user is in the directory where odp_l3fwd exists. +# If that's not true, then the user has to specify the path to it and run: +#TEST_DIR=$builddir $ODP/example/l3fwd/ + +# directory where test binaries have been built +TEST_DIR="${TEST_DIR:-$PWD}" +# directory where test sources are, including scripts +TEST_SRC_DIR=$(dirname $0) + +PATH=$TEST_DIR:$TEST_DIR/../../example/generator:$PATH + +# exit codes expected by automake for skipped tests +TEST_SKIPPED=77 + +# Use installed pktio env or for make check take it from platform directory +if [ -f "./pktio_env" ]; then + . ./pktio_env +elif [ "$ODP_PLATFORM" = "" ]; then + echo "$0: error: ODP_PLATFORM must be defined" + # not skipped as this should never happen via "make check" + exit 1 +elif [ -f ${TEST_SRC_DIR}/../../platform/$ODP_PLATFORM/test/pktio/pktio_env ]; then + . ${TEST_SRC_DIR}/../../platform/$ODP_PLATFORM/test/pktio/pktio_env +else + echo "BUG: unable to find pktio_env!" + echo "pktio_env has to be in current directory or in platform/\$ODP_PLATFORM/test." + echo "ODP_PLATFORM=\"$ODP_PLATFORM\"" + exit 1 +fi + +run_l3fwd() +{ + setup_pktio_env clean # install trap to call cleanup_pktio_env + + if [ $? -ne 0 ]; then + echo "setup_pktio_env error $?" + exit $TEST_SKIPPED + fi + + type odp_generator > /dev/null + if [ $? -ne 0 ]; then + echo "odp_generator not installed. Aborting." + cleanup_pktio_env + exit 1 + fi + + #@todo: limit odp_generator to cores + #https://bugs.linaro.org/show_bug.cgi?id=1398 + (odp_generator${EXEEXT} -I $IF0 \ + --srcip 1.1.1.1 --dstip 2.1.1.1 -m u 2>&1 > /dev/null) \ + 2>&1 > /dev/null & + GEN_PID=$! + + # 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 + STDBUF="stdbuf -o 0" + else + STDBUF= + fi + LOG=odp_l3fwd_tmp.log + $STDBUF odp_l3fwd${EXEEXT} -i $IF1,$IF2 -r "1.1.1.0/24:$IF1" -r "2.1.1.0/24:$IF2" -d 50 | tee $LOG + ret=$? + + kill ${GEN_PID} + + if [ ! -f $LOG ]; then + echo "FAIL: $LOG not found" + ret=1 + elif [ $ret -eq 0 ]; then + PASS_PPS=1000 + 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 + fi + + rm -f $LOG + cleanup_pktio_env + + exit $ret +} + +case "$1" in + setup) setup_pktio_env ;; + cleanup) cleanup_pktio_env ;; + *) run_l3fwd ;; +esac