Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6485982rwp; Tue, 18 Jul 2023 00:43:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlEc3F5I3Xg94A5gRq0UCgV2er7SSjIzVrtNtmpeUsg2JvVnILb1IGNe8C3hxaYgYNED71xE X-Received: by 2002:a17:90a:4e46:b0:258:9995:91cb with SMTP id t6-20020a17090a4e4600b00258999591cbmr11197353pjl.49.1689666180784; Tue, 18 Jul 2023 00:43:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689666180; cv=none; d=google.com; s=arc-20160816; b=VMLRXC22XKkD+qBDUhNC3sk8ptmNIae5yjuaAq6Tj3rWi40r5Zgh0uR6EkHBCnUSSs kmyIs9mC2Le5JQX5IvwxQRzM+PZLeBb/VdtYnWpFQuo9Gvtga/lGTNxErv+RDXqdwYP4 gSXUcbYFbAviU660Iyg+79+bS0Ll8OMecvEbGSdz4OoYh+F6Syxx3CrCD36pohAJl8S/ ENLvyfC1zQVq1c6dA4J2dEDbfKfwObonxze5HMjJ4zsgT2H2WfVlMms1o7k92sBQz45J qaDq/Q8Gb5ALJu4UK/TqaY34vc6WD3W3JGXB2lUoM3pmVhgpC9SkYMYz9YRqIbD5Gmfw hvFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature; bh=hcOqxuJYpCUDm7OSYb+0ENGEvGMeG3JMgPYd+FVq3rQ=; fh=7VC7OIvnFH8hLTrN5KE/kAhVVq0GqBpJMJD3s8kWzTk=; b=oX1+rprVSZchIH0odtXdw+uppHPGn/mefI90NQBGYGR75aHFmeRtEQynHAI3eAwLV6 Z9kEeULtv6VklGJb3CZCDf8cK3VDIZVxmr+w51iJT/zXokqrZBKPLIIgehY84LD7xwzz JjLGmacWz6G8Ql6WkAu+RXVb75HPszngAK1XarTfin0o4+K0XMKalsWvpWIBdWlwBaPj TwCwasIpZcq/w2hX8Guncios6VcyxTM8jEMHbxFgMZTyusR1W7W41kgTmu8kHYnocpZu VBvnPIa8AvS1jLt9inLHv/4uiWa/DLcuwsZEXn7yYEEvfT5Gr9OpMRxmRV10oxEfvp8R uqTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=Y6YPCbVC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gm9-20020a17090b100900b0025e7ff46234si7009043pjb.57.2023.07.18.00.42.47; Tue, 18 Jul 2023 00:43:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=Y6YPCbVC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbjGRHXH (ORCPT + 99 others); Tue, 18 Jul 2023 03:23:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231696AbjGRHXC (ORCPT ); Tue, 18 Jul 2023 03:23:02 -0400 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> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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