From patchwork Thu Aug 20 11:41:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Haslam X-Patchwork-Id: 52585 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id 7ABA820AF6 for ; Thu, 20 Aug 2015 11:41:44 +0000 (UTC) Received: by wilj18 with SMTP id j18sf11538557wil.0 for ; Thu, 20 Aug 2015 04:41:43 -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=JqX4nA1Q/iZ/9ABw6IA3q+YyvSjYp38g+86vwn3cTSc=; b=GpwwZ1O84bS12oRl5064H6BLVgIvc+3Rk6N0PT4zVIenXH81ogPVKeKyaaRj9UgDF+ hsEWu28gjXtmC5QV0ZBf0K1nEArE8UHJydpuTf4bkhKo2FpET1hYavfGnoP21qUfqE6B 6IFFki2OJPSJX0dfweRJh7U0Li1NC3iJarTkXmpfKbI2wu1Y617r+7rp9wN1s3dT+Kvc TJkCvpV+u76mWADTEOzYl8iQWhI67Bzjo5I52uyD29M+VJJSZbRay2vhNYpgMsXFGgoS mqNKckd/dDIKBSYTELUBTyrr7ZHzDVCyLotRGMQK5rZMHklqDF+jt6nUvw+7teP7IeG/ Lz2A== X-Gm-Message-State: ALoCoQnZ+c/qDRJgQjfo794NqphCh3pHCAQo21KcKyHyvNtYEH4lQ6b13uF1PtQOQm28kzwZXoUI X-Received: by 10.112.54.166 with SMTP id k6mr756949lbp.0.1440070903746; Thu, 20 Aug 2015 04:41:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.30.102 with SMTP id r6ls146971lah.100.gmail; Thu, 20 Aug 2015 04:41:43 -0700 (PDT) X-Received: by 10.112.234.165 with SMTP id uf5mr2440952lbc.91.1440070903430; Thu, 20 Aug 2015 04:41:43 -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 l15si3447826lab.70.2015.08.20.04.41.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Aug 2015 04:41:43 -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 lbbtg9 with SMTP id tg9so21982592lbb.1 for ; Thu, 20 Aug 2015 04:41:43 -0700 (PDT) X-Received: by 10.152.44.196 with SMTP id g4mr2559124lam.56.1440070902926; Thu, 20 Aug 2015 04:41:42 -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.162.200 with SMTP id yc8csp975409lbb; Thu, 20 Aug 2015 04:41:41 -0700 (PDT) X-Received: by 10.107.8.96 with SMTP id 93mr2647735ioi.152.1440070900833; Thu, 20 Aug 2015 04:41:40 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id w142si2882611iod.214.2015.08.20.04.41.39; Thu, 20 Aug 2015 04:41:40 -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 1412A61F6E; Thu, 20 Aug 2015 11:41:39 +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 A301A61EF2; Thu, 20 Aug 2015 11:41:35 +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 94F3261F16; Thu, 20 Aug 2015 11:41:33 +0000 (UTC) Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by lists.linaro.org (Postfix) with ESMTPS id 8AECE61D8D for ; Thu, 20 Aug 2015 11:41:32 +0000 (UTC) Received: by wicne3 with SMTP id ne3so13585770wic.1 for ; Thu, 20 Aug 2015 04:41:31 -0700 (PDT) X-Received: by 10.194.143.6 with SMTP id sa6mr4937021wjb.67.1440070891789; Thu, 20 Aug 2015 04:41:31 -0700 (PDT) Received: from e106441.emea.arm.com ([2001:41d0:a:3cb4::abcd]) by smtp.gmail.com with ESMTPSA id eu2sm5775524wic.8.2015.08.20.04.41.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Aug 2015 04:41:31 -0700 (PDT) From: Stuart Haslam To: lng-odp@lists.linaro.org Date: Thu, 20 Aug 2015 12:41:24 +0100 Message-Id: <1440070884-4820-1-git-send-email-stuart.haslam@linaro.org> X-Mailer: git-send-email 2.1.1 X-Topics: patch Subject: [lng-odp] [PATCHv2] 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.mailfrom=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. Fixes bug; https://bugs.linaro.org/show_bug.cgi?id=1735 Signed-off-by: Stuart Haslam --- Change in v2 - updated comment about default interfaces platform/linux-generic/test/pktio/pktio_run | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/platform/linux-generic/test/pktio/pktio_run b/platform/linux-generic/test/pktio/pktio_run index 76a8419..4860455 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; do unset ODP_PKTIO_DISABLE_SOCKET_${distype} done @@ -67,26 +66,34 @@ 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 default veth interfaces + # setup by the pktio_env script 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