From patchwork Fri Aug 14 18:55:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 262536 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1AD8C433DF for ; Fri, 14 Aug 2020 18:56:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9720820771 for ; Fri, 14 Aug 2020 18:56:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727817AbgHNS4L (ORCPT ); Fri, 14 Aug 2020 14:56:11 -0400 Received: from mailrelay112.isp.belgacom.be ([195.238.20.139]:13761 "EHLO mailrelay112.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726285AbgHNS4L (ORCPT ); Fri, 14 Aug 2020 14:56:11 -0400 IronPort-SDR: 9TuJwu26yOeK04zBZN2TX7Uvmgr2RDvJZfpHIzdm4x3qIonySFcZfyokTKJHAzt0m2Xyej8aRH psFGO0CB6UHpfPZj/HD6pSN0fIOe/xd4MgqHyYggqEeU2nHDZJSHbcdtYHjMA2wnUlsUfJEir5 1+EdlJQWg5HJUdYMiL7id9uK43N4D3seenVHRjsBXM8CiVYP2XXRMaOkLYjBRfgFeZ4lTWnQVc wrW5l5IhoEys3fzsW7L4dO1lXXV1vI7KKUMCrQEyJUgMljMXXgiFYH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Received: from 16.165-182-91.adsl-dyn.isp.belgacom.be (HELO localhost.localdomain) ([91.182.165.16]) by relay.skynet.be with ESMTP; 14 Aug 2020 20:56:01 +0200 From: Fabian Frederick To: pablo@netfilter.org, kadlec@netfilter.org, fw@strlen.de Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, Fabian Frederick Subject: [PATCH 2/2 nf] selftests: netfilter: exit on invalid parameters Date: Fri, 14 Aug 2020 20:55:44 +0200 Message-Id: <20200814185544.8732-1-fabf@skynet.be> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org exit script with comments when parameters are wrong during address addition. No need for a message when trying to change MTU with lower values: output is self-explanatory Signed-off-by: Fabian Frederick --- tools/testing/selftests/netfilter/nft_flowtable.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/testing/selftests/netfilter/nft_flowtable.sh b/tools/testing/selftests/netfilter/nft_flowtable.sh index 28e32fddf9b2c..c3617d0037f2e 100755 --- a/tools/testing/selftests/netfilter/nft_flowtable.sh +++ b/tools/testing/selftests/netfilter/nft_flowtable.sh @@ -97,9 +97,17 @@ do done ip -net nsr1 link set veth0 mtu $omtu +if [ $? -ne 0 ]; then + exit 1 +fi + ip -net ns1 link set eth0 mtu $omtu ip -net nsr2 link set veth1 mtu $rmtu +if [ $? -ne 0 ]; then + exit 1 +fi + ip -net ns2 link set eth0 mtu $rmtu # transfer-net between nsr1 and nsr2. @@ -119,6 +127,11 @@ for i in 1 2; do ip -net ns$i addr add 10.0.$i.99/24 dev eth0 ip -net ns$i route add default via 10.0.$i.1 ip -net ns$i addr add dead:$i::99/64 dev eth0 + if [ $? -ne 0 ]; then + echo "ERROR: Check Originator/Responder values (problem during address addition)" 1>&2 + exit 1 + fi + ip -net ns$i route add default via dead:$i::1 ip netns exec ns$i sysctl net.ipv4.tcp_no_metrics_save=1 > /dev/null