From patchwork Thu Aug 6 09:55:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Haslam X-Patchwork-Id: 51996 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id 0DF8622A15 for ; Thu, 6 Aug 2015 09:55:24 +0000 (UTC) Received: by wilj18 with SMTP id j18sf4043288wil.0 for ; Thu, 06 Aug 2015 02:55:23 -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: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:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=nYRm02CrTMeSc77x44UWKb3RaY9dx1Di0YpOPwW1Xjc=; b=nMdstw9Rf8iaoNPz8eR3ZFEtLVmDPgP8Q1dCHMnbOgL4N2ZgGiBbhwa3yNRDXEJ7Fw DRpDvmX49TRGiwjJleg8vxI3I5EEfxXTXjIagkdU3tAnHCKqzI7jjpHf8QruA2IREYmP 3EiRSqafW9ZXdzh6qDVCYTwlxHxWu02gOzImtAm8jM9cUzyKqyG6VOkSn/Dw0vhQHZrI AT42ETcxGHF7HjCEUAErmZ7PnMfruQKz+9tYwsLsxK5orIHEd847DlZ3vM3qL6uNCxB0 m0bI+Sh7F89r5JrvNOJjOFPOEF+cgGBQ9tfxj6D59a2CEO1DD/4c10Er+0XzCJcGYxVv q1kA== X-Gm-Message-State: ALoCoQkbcwJfgeuHpsSjhUWM3If0Ev2YePkrzFPwUdvP9IHsM8+00cDJOy7LD/CVZGkv8UCJ94b3 X-Received: by 10.112.160.39 with SMTP id xh7mr253100lbb.22.1438854923271; Thu, 06 Aug 2015 02:55:23 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.185.67 with SMTP id fa3ls286474lac.76.gmail; Thu, 06 Aug 2015 02:55:23 -0700 (PDT) X-Received: by 10.152.27.197 with SMTP id v5mr744762lag.64.1438854922992; Thu, 06 Aug 2015 02:55:22 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id j10si4366940lbp.23.2015.08.06.02.55.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Aug 2015 02:55:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbbpu9 with SMTP id pu9so12264209lbb.3 for ; Thu, 06 Aug 2015 02:55:22 -0700 (PDT) X-Received: by 10.152.203.134 with SMTP id kq6mr730751lac.106.1438854922535; Thu, 06 Aug 2015 02:55:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp842986lba; Thu, 6 Aug 2015 02:55:21 -0700 (PDT) X-Received: by 10.107.16.139 with SMTP id 11mr962454ioq.122.1438854920843; Thu, 06 Aug 2015 02:55:20 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id z20si1233513igq.11.2015.08.06.02.55.19; Thu, 06 Aug 2015 02:55:20 -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; Received: by lists.linaro.org (Postfix, from userid 109) id 770F4620BF; Thu, 6 Aug 2015 09:55:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 800FC61CC7; Thu, 6 Aug 2015 09:55:15 +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 2BDE861D08; Thu, 6 Aug 2015 09:55:14 +0000 (UTC) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by lists.linaro.org (Postfix) with ESMTPS id 13F3461B4D for ; Thu, 6 Aug 2015 09:55:12 +0000 (UTC) Received: by wibhh20 with SMTP id hh20so16548710wib.0 for ; Thu, 06 Aug 2015 02:55:11 -0700 (PDT) X-Received: by 10.180.98.134 with SMTP id ei6mr4420318wib.49.1438854911342; Thu, 06 Aug 2015 02:55:11 -0700 (PDT) Received: from e106441.cambridge.arm.com ([2001:41d0:a:3cb4::abcd]) by smtp.gmail.com with ESMTPSA id y13sm8598136wjq.26.2015.08.06.02.55.10 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Aug 2015 02:55:10 -0700 (PDT) From: Stuart Haslam To: lng-odp@lists.linaro.org Date: Thu, 6 Aug 2015 10:55:02 +0100 Message-Id: <1438854902-15050-1-git-send-email-stuart.haslam@linaro.org> X-Mailer: git-send-email 2.1.1 X-Topics: patch Subject: [lng-odp] [PATCH] linux-generic: pktio: always test loop interface X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stuart.haslam@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.173 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 Test using the loop interface even when running as root. https://bugs.linaro.org/show_bug.cgi?id=1735 Signed-off-by: Stuart Haslam --- platform/linux-generic/test/pktio/pktio_run | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/platform/linux-generic/test/pktio/pktio_run b/platform/linux-generic/test/pktio/pktio_run index 9a70ac4..9144c97 100755 --- a/platform/linux-generic/test/pktio/pktio_run +++ b/platform/linux-generic/test/pktio/pktio_run @@ -46,9 +46,8 @@ run_test() { local ret=0 - # the linux-generic implementation uses environment variables to - # control which socket method is used, so try each combination to - # ensure decent coverage. + # environment variables are used to control which socket method is + # used, so try each combination to ensure decent coverage. for distype in MMAP MMSG BASIC; do unset ODP_PKTIO_DISABLE_SOCKET_${distype} done @@ -67,26 +66,33 @@ run_test() echo "!!! FAILED !!!" fi - exit $ret + return $ret } run() { - #need to be root to set the interface: if not, run with default loopback. + echo "pktio: using 'loop' device" + pktio_main${EXEEXT} + loop_ret=$? + + # need to be root to run tests with real interfaces if [ "$(id -u)" != "0" ]; then - echo "pktio: using 'loop' device" - pktio_main${EXEEXT} - exit $? + exit $ret fi if [ "$ODP_PKTIO_IF0" = "" ]; then - # no interfaces specified on linux-generic, use defaults + # no interfaces specified, use defaults setup_pktio_env clean export ODP_PKTIO_IF0=$IF0 export ODP_PKTIO_IF1=$IF1 fi run_test + ret=$? + + [ $ret = 0 ] && ret=$loop_ret + + exit $ret } case "$1" in