From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4967810EA for ; Tue, 18 Jul 2023 07:23:03 +0000 (UTC) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72733EC; Tue, 18 Jul 2023 00:22:59 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 7B9B532007E8; Tue, 18 Jul 2023 03:22:54 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 18 Jul 2023 03:22:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1689664974; x=1689751374; bh=hcOqxuJYpCUDm 7OSYb+0ENGEvGMeG3JMgPYd+FVq3rQ=; b=Y6YPCbVC28+5y/DrY50kJ6mKnb2sO p2boWneE1mrO7RG3KQ0MSleQ8HgpBlfDKZ4Xt1r7mVo4vAC0lBx61cFngf80KIFh Hgne9EG8VZXt/eCGzC7r6MyvIosIwFW22u0T038RtdoTPIwCQu6eQKq5GF01ZKAt Zbaa4pqN/VVjrdEmi66yk5WSrdcwLBaerf8LYRFWWgcK3PvSmO2gJKAA2TcRC0mo XmBiOusDZ1kdWdGBRDmrM2hlPnOi31KXaYBUnpdQs/nZJ0AlSHR5XJXhENl8WET2 ayhMrpvTbPZKR0AAD+I1W4aPbfi6Jwz3+uAIRst91g6bOWPNq//b3eqGA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgeefgdduudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepkfguohcu ufgthhhimhhmvghluceoihguohhstghhsehiughoshgthhdrohhrgheqnecuggftrfgrth htvghrnhepvddufeevkeehueegfedtvdevfefgudeifeduieefgfelkeehgeelgeejjeeg gefhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepih guohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Feedback-ID: i494840e7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Jul 2023 03:22:52 -0400 (EDT) Date: Tue, 18 Jul 2023 10:22:50 +0300 From: Ido Schimmel To: Mirsad Todorovac Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Ido Schimmel , Nikolay Aleksandrov , Linux Kernel Mailing List , petrm@nvidia.com Subject: Re: [PROBLEM] selftests: net/forwarding/*.sh: 'Command line is not complete. Try option "help"' Message-ID: References: <856d454e-f83c-20cf-e166-6dc06cbc1543@alu.unizg.hr> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <856d454e-f83c-20cf-e166-6dc06cbc1543@alu.unizg.hr> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net On Mon, Jul 17, 2023 at 10:51:04PM +0200, Mirsad Todorovac wrote: > Tests fail with error message: > > Command line is not complete. Try option "help" > Failed to create netif > > The script > > # tools/testing/seltests/net/forwarding/bridge_igmp.sh > > bash `set -x` ends with an error: > > ++ create_netif_veth > ++ local i > ++ (( i = 1 )) > ++ (( i <= NUM_NETIFS )) > ++ local j=2 > ++ ip link show dev > ++ [[ 255 -ne 0 ]] > ++ ip link add type veth peer name > Command line is not complete. Try option "help" > ++ [[ 255 -ne 0 ]] > ++ echo 'Failed to create netif' > Failed to create netif > ++ exit 1 > > The problem seems to be linked with this piece of code of "lib.sh": > > create_netif_veth() > { > local i > > for ((i = 1; i <= NUM_NETIFS; ++i)); do > local j=$((i+1)) > > ip link show dev ${NETIFS[p$i]} &> /dev/null > if [[ $? -ne 0 ]]; then > ip link add ${NETIFS[p$i]} type veth \ > peer name ${NETIFS[p$j]} > if [[ $? -ne 0 ]]; then > echo "Failed to create netif" > exit 1 > fi > fi > i=$j > done > } > > Somehow, ${NETIFS[p$i]} is evaluated to an empty string? You need to provide a configuration file in tools/testing/selftests/net/forwarding/forwarding.config. See tools/testing/selftests/net/forwarding/forwarding.config.sample for example. Another option is to provide the interfaces on the command line. ./bridge_igmp.sh veth0 veth1 veth2 veth3 If no configuration file is present, we can try to assume that the tests are meant to be run with veth pairs and not with physical loopbacks. Something like: diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index 71f7c0c49677..5b0183013017 100755 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -16,8 +16,6 @@ TEAMD=${TEAMD:=teamd} WAIT_TIME=${WAIT_TIME:=5} PAUSE_ON_FAIL=${PAUSE_ON_FAIL:=no} PAUSE_ON_CLEANUP=${PAUSE_ON_CLEANUP:=no} -NETIF_TYPE=${NETIF_TYPE:=veth} -NETIF_CREATE=${NETIF_CREATE:=yes} MCD=${MCD:=smcrouted} MC_CLI=${MC_CLI:=smcroutectl} PING_COUNT=${PING_COUNT:=10} @@ -30,6 +28,20 @@ REQUIRE_MZ=${REQUIRE_MZ:=yes} REQUIRE_MTOOLS=${REQUIRE_MTOOLS:=no} STABLE_MAC_ADDRS=${STABLE_MAC_ADDRS:=no} TCPDUMP_EXTRA_FLAGS=${TCPDUMP_EXTRA_FLAGS:=} +NETIF_TYPE=${NETIF_TYPE:=veth} +NETIF_CREATE=${NETIF_CREATE:=yes} +declare -A NETIFS=( + [p1]=veth0 + [p2]=veth1 + [p3]=veth2 + [p4]=veth3 + [p5]=veth4 + [p6]=veth5 + [p7]=veth6 + [p8]=veth7 + [p9]=veth8 + [p10]=veth9 +) relative_path="${BASH_SOURCE%/*}" if [[ "$relative_path" == "${BASH_SOURCE}" ]]; then