Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp230340yba; Tue, 14 May 2019 23:46:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyecE+0DUGwKyjZp5C2hDk1RsPV+RVUudR8yCgKH6to7+vVVaWztBiARYgw6QtYiKICDZYe X-Received: by 2002:a63:5720:: with SMTP id l32mr43751746pgb.438.1557902764025; Tue, 14 May 2019 23:46:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557902764; cv=none; d=google.com; s=arc-20160816; b=qwyZU6gLtwu//6zRzc2Xco076bfR2xcnprE5+wEtynOGtMwF9INWymt3+IRvouL+VQ tZdPMWp0lpOCnB5y6mOarbiVHRJamwc6z7h6GxL4QvqFlQ2lLFvTL97Ft7KCUkk6NSUU XT/oYjoNL9dMTCJpavYNr1XGJtWAGGKysI1QvVBHr/kXAf6eRD59YXaVbL9JnLPyMSfz zQaektooS+XFG0fcJTUXq/NHdSItIRX27Yx3cOFwLPW7mc6QexN/wrpbvlOy0Lrv6oOb hR4MADWW1BCRgszVzIudj8JHR/Ut6upR0vAO/Z40XlitMv1XUA4pCt9i9Ou2xi4QWHsG EnkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ZdohzeVgbbKHEv1a2YghmfxHtlO8ojKInm2nc2fqSSY=; b=jHiwmzqPRfGAEf1Sdg9PFHMSdVvWApstNuStIj6E3gCfFnPU0Arb7MaFNq1HYv7Qsf vArl0hKp9PvCIiNUmG8f/sU3k2seTdd0fS4yhbgJ9kEf4NCqDhpHTZsNkZ9Ge5ha8o7Y MmxI7qHFE2zYe6pjE9/Fn7Y4BmFlhI2MGd0Vumc5KcgJUK3/9KLjdRfanGYLdhS4kUC9 Epk5nfM+y9ihikJqi6zpvlVVpldbbsCbXY9iZSGozCIash67M6cljEZdbfV/Spfrl2T8 rvV+2Cr4I7UC2BqF/n34HZoe/BNhHQ6n5RwNQxGgXf5FDZVFMYtAmK8wk2D3ebh7HuoM oLfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rajagiritech-edu-in.20150623.gappssmtp.com header.s=20150623 header.b=ZQsLpqrp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c13si991349plo.175.2019.05.14.23.45.49; Tue, 14 May 2019 23:46:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@rajagiritech-edu-in.20150623.gappssmtp.com header.s=20150623 header.b=ZQsLpqrp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726254AbfEOGoW (ORCPT + 99 others); Wed, 15 May 2019 02:44:22 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:40821 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725929AbfEOGoV (ORCPT ); Wed, 15 May 2019 02:44:21 -0400 Received: by mail-pl1-f195.google.com with SMTP id g69so834703plb.7 for ; Tue, 14 May 2019 23:44:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rajagiritech-edu-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZdohzeVgbbKHEv1a2YghmfxHtlO8ojKInm2nc2fqSSY=; b=ZQsLpqrplJtjoMLOoc0l17JwFYvv6aqTNTRukNM+fypvmCZkF7YCRm+bsiagitQLHA CaWoiXAW6FE1bQMzrymKfJUMvD4zDDes6Dh8re/iQMFRFE8Tali/B56G6iDrZ2ys3EIY +PBIj46HwlRtQEZFEnjitSNPAWgwmpQ95i7mcpzxt1sNnKtlRdNBZoNWXAd0lmOhjezi 1Hxu6myv4rMJePJRz/6TDuqZl7y0uJxunvxbaTYxWu+S/CxQhBvO5xnL7C60lSMom6SB hpZ2uwt5izTpha4XnTXlf11FA0ceAHldst6/3vsYQuvQxpFveDJRuFGrtQuPnvdF2Wwd z+aQ== 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:mime-version :content-transfer-encoding; bh=ZdohzeVgbbKHEv1a2YghmfxHtlO8ojKInm2nc2fqSSY=; b=V95qMNd5Zggly6PEHSk4x7ibRmloNDg4TVzhMWXVCZH/D7V4mHM201MSq2AmYGT1Bw uwA5/qggICctssjaNbYKOYcY0toywYw5L3UhB0gua1oTWyDtCGjIYiqGreKS5hwZ0X6G cyshPoy1awprAe4r1F9Gn8vOTfQBx17VgUesZ7geKcWm1RcOvPSqeh0F827j1KLwG2Y9 0gTMoieFmAYP0w4ZAYszPgtQYPyci733iTuZQy7jCArz1fbVPDyKdbri/PdljBt7klFO wwSXHJZ4LYdaQo0xucD2KITBU5Zg91rJD4JUdgSXjMTRUIiND6K5fK5zMzgZCMJPkjWv M2Ww== X-Gm-Message-State: APjAAAVI+rS+Mn0pVrKkxpL4UO52eteJaXZqRoVJaTwFbov2K5yO8kJA weUrEB/pNdFV4485Wuu6nB1Blg== X-Received: by 2002:a17:902:2884:: with SMTP id f4mr14396889plb.230.1557902661254; Tue, 14 May 2019 23:44:21 -0700 (PDT) Received: from localhost.localdomain ([122.174.240.7]) by smtp.gmail.com with ESMTPSA id e5sm2180868pgh.35.2019.05.14.23.44.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 May 2019 23:44:20 -0700 (PDT) From: Jeffrin Jose T To: pablo@netfilter.org Cc: fw@strlen.de, shuah@kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org, Jeffrin Jose T Subject: [PATCH v2] selftests: netfilter: missing error check when setting up veth interface Date: Wed, 15 May 2019 12:14:04 +0530 Message-Id: <20190515064405.3981-1-jeffrin@rajagiritech.edu.in> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A test for the basic NAT functionality uses ip command which needs veth device.There is a condition where the kernel support for veth is not compiled into the kernel and the test script breaks.This patch contains code for reasonable error display and correct code exit. Signed-off-by: Jeffrin Jose T --- tools/testing/selftests/netfilter/nft_nat.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/netfilter/nft_nat.sh b/tools/testing/selftests/netfilter/nft_nat.sh index 8ec76681605c..f25f72a75cf3 100755 --- a/tools/testing/selftests/netfilter/nft_nat.sh +++ b/tools/testing/selftests/netfilter/nft_nat.sh @@ -23,7 +23,11 @@ ip netns add ns0 ip netns add ns1 ip netns add ns2 -ip link add veth0 netns ns0 type veth peer name eth0 netns ns1 +ip link add veth0 netns ns0 type veth peer name eth0 netns ns1 > /dev/null 2>&1 +if [ $? -ne 0 ];then + echo "SKIP: No virtual ethernet pair device support in kernel" + exit $ksft_skip +fi ip link add veth1 netns ns0 type veth peer name eth0 netns ns2 ip -net ns0 link set lo up -- 2.20.1