From patchwork Sun Aug 23 18:15:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 262040 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=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, 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 82C77C433E1 for ; Sun, 23 Aug 2020 18:16:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 664A620825 for ; Sun, 23 Aug 2020 18:16:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726475AbgHWSQS (ORCPT ); Sun, 23 Aug 2020 14:16:18 -0400 Received: from mailrelay102.isp.belgacom.be ([195.238.20.129]:53454 "EHLO mailrelay102.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725867AbgHWSQR (ORCPT ); Sun, 23 Aug 2020 14:16:17 -0400 IronPort-SDR: KRjEKcX+MFJ7e8uWssBY0r0Frzl3tUAv4DXnRBN775yGG6uJ9bv8R2kbT59a+I30yMRy0rVG8R mm0B8BiTYRabS08t8fniIUww7GDQMooCaW43fEOicfitRHH8tD4IldXxrtlr269GV5OWwK2QAQ DFIP5iw6/KI/9sEfnhOoIXWkHdVO5pE3lq9l0xA1suMyu2ypp/+P8Ny6UVVgC2ONknN6XeDKlS J9Ey8yiO8zBj5UQsQ7HrTOuTYekUN6H2dShxllfe4rUGT4DWduJZNYpp/EKDpusNQ8KvyuTQ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IyOBPwkJgyYBglcpslCEEIRpgUCBOAGII4UZgUE/hF+KNASPRqZ5gm2DDIRafpExDyGgMpJDoVqBek0gGIMkCUcZDZxoQjA3AgYKAQEDCVcBPQGMBYQfAQE Received: from 16.165-182-91.adsl-dyn.isp.belgacom.be (HELO localhost.localdomain) ([91.182.165.16]) by relay.skynet.be with ESMTP; 23 Aug 2020 20:16:15 +0200 From: Fabian Frederick To: pablo@netfilter.org, kadlec@netfilter.org, fw@strlen.de, sbrivio@redhat.com Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, Fabian Frederick Subject: [PATCH V2 2/5 nf] selftests: netfilter: exit on invalid parameters Date: Sun, 23 Aug 2020 20:15:59 +0200 Message-Id: <20200823181559.13306-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. Use short testing sequence to avoid shellcheck warnings (suggested by Stefano Brivio). Signed-off-by: Fabian Frederick --- V2: avoid shellcheck warnings .../testing/selftests/netfilter/nft_flowtable.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/netfilter/nft_flowtable.sh b/tools/testing/selftests/netfilter/nft_flowtable.sh index 28e32fddf9b2c..dc05c99405979 100755 --- a/tools/testing/selftests/netfilter/nft_flowtable.sh +++ b/tools/testing/selftests/netfilter/nft_flowtable.sh @@ -96,10 +96,16 @@ do esac done -ip -net nsr1 link set veth0 mtu $omtu +if ! ip -net nsr1 link set veth0 mtu $omtu; then + exit 1 +fi + ip -net ns1 link set eth0 mtu $omtu -ip -net nsr2 link set veth1 mtu $rmtu +if ! ip -net nsr2 link set veth1 mtu $rmtu; then + exit 1 +fi + ip -net ns2 link set eth0 mtu $rmtu # transfer-net between nsr1 and nsr2. @@ -120,7 +126,10 @@ for i in 1 2; do ip -net ns$i route add default via 10.0.$i.1 ip -net ns$i addr add dead:$i::99/64 dev eth0 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 + if ! ip netns exec ns$i sysctl net.ipv4.tcp_no_metrics_save=1 > /dev/null; then + echo "ERROR: Check Originator/Responder values (problem during address addition)" + exit 1 + fi # don't set ip DF bit for first two tests ip netns exec ns$i sysctl net.ipv4.ip_no_pmtu_disc=1 > /dev/null