summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorJeffrin Jose T <jeffrin@rajagiritech.edu.in>2019-05-15 09:44:04 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-22 09:09:08 +0300
commit9141d4bfc8bb2ee2da9b5528d4e2c83d804bf77e (patch)
treef0ff8e5dacba7a93766a92721cc1638361ab2847 /tools/testing
parent1a9e8e2e591080d1f358fd4f481b715ddec83ccc (diff)
downloadlinux-9141d4bfc8bb2ee2da9b5528d4e2c83d804bf77e.tar.xz
selftests: netfilter: missing error check when setting up veth interface
[ Upstream commit 82ce6eb1dd13fd12e449b2ee2c2ec051e6f52c43 ] 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 <jeffrin@rajagiritech.edu.in> Acked-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/testing')
-rwxr-xr-xtools/testing/selftests/netfilter/nft_nat.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/testing/selftests/netfilter/nft_nat.sh b/tools/testing/selftests/netfilter/nft_nat.sh
index 3194007cf8d1..a59c5fd4e987 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