Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1256771rda; Mon, 23 Oct 2023 07:19:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEsGJBSqSbr2IXvcKtVkDmzngnomYkBnu84i8QDERPlJz8KFArxTz8aJVcdv/E5Doel5bTt X-Received: by 2002:a17:90a:d996:b0:27d:546b:4258 with SMTP id d22-20020a17090ad99600b0027d546b4258mr7151717pjv.31.1698070750397; Mon, 23 Oct 2023 07:19:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698070750; cv=none; d=google.com; s=arc-20160816; b=JSeBTQMHCQfJ0FWyS2CIGXn+d2Bg1cHmkGXhekeowdpd3VSbWMPytruVrL0R29EyFw uYXai9hvWA1zGeEwnz3vMNEvGVXnY8TeXVzWfKuoPXrqD4A1E/dnLnvLtioLzTv99lA8 gkrr8dPTME5VCRJl3M9dOJWJqyiErVAUYFU3F5+SMlPNJlTYoUnjCGn79aBR/r8mzcmk bR/B9aYeQxPSm2t580+hOPOjIqTToKuXsf3E5ohjKw/N7cs+4PXC47sDsfde3A7txum7 2dn9R0JgGz31sBeY6Tp0KrBiL2mm/mYWtzoyLLOmJ8bwu4bYcZUiJhqbLrd0qG9bUHrj lnpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=x4LiknWq0x8Qsnh43nGxv8/iPTK1LMk/JRoA4vZ7Ckk=; fh=nVCKdbaa71Ss8qdALAPq7DzbZP1JH6IU3ZP5ou5X8z4=; b=PAs5Nny17fTWVQHllwG2j96YQ7tx00d7teftShgFNX+8HcMzvcFsiq8UZ3tJ948oSl Y3rQ9YlloVK6CLU41oE4+pgHta/JtzfLFqzZSY/sw9HEWwiPlCp+OeolEkAUFcSeQGKx JYIQQL9v+wU4rJ6RzsfPrFNO3k3exoWSuV3G4iG924hJBoDCTGxIMU/w+Q0z834Wa9Ar 7igbDnD9CwRMhEATxtHFg3N9OKBJZmkT6Jn4xk3oyQvMH1lsDwnsJCmGvuBxh//j+RKf ttK85Mgl7S4zV2NnMXNHJzuiajiAeiCPw5CE1JDq0FMKKVKWl6aWbZtO99kOPuC7avx9 VY2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SXqtsBl0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id z7-20020a1709028f8700b001c60e273252si6178415plo.25.2023.10.23.07.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 07:19:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SXqtsBl0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 82189805EAE3; Mon, 23 Oct 2023 07:19:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230158AbjJWOTC (ORCPT + 99 others); Mon, 23 Oct 2023 10:19:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbjJWOTB (ORCPT ); Mon, 23 Oct 2023 10:19:01 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE60AB3; Mon, 23 Oct 2023 07:18:58 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18AD9C433C7; Mon, 23 Oct 2023 14:18:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698070738; bh=XKHA+o3oAqp09heCyRAIPWkyf94HR5PsGQ+iB2G7+R4=; h=Date:Subject:To:References:From:In-Reply-To:From; b=SXqtsBl0acWkhV/sCPXQG+Utt7JaB3KYlIbEyxJC+W54DIqmBKHov+jQIjMU/UItE 010fYFXToKgIPVNKJXUv2n0OEiBkHvLzMYGp23QH/MVdRaGyJOHDX4dCYJkwDJRF9t 1O307y6lQQE+RArvnyI0aLLf7tGu5L4bA04vkiwnYAZamzJE9AeTiN45mexw0eavih PhUGyPbtMth/t6p6eLmDjDdvFaBPEIJZLOkIBYI4KKoDqV8QjGDWscPiEcDHqsOzF2 H/UnTpi8unNmg2OUn0Vm3JIXIi+I9Zj/5ij+WrBli8OwrfGwACHmg/hpr4o4BZURKr T+05CXxngK04g== Message-ID: Date: Mon, 23 Oct 2023 08:18:57 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] selftests:net change ifconfig with ip command Content-Language: en-US To: Swarup Laxman Kotiaklapudi , davem@davemloft.net, jiri@resnulli.us, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org References: <20231023123422.2895-1-swarupkotikalapudi@gmail.com> From: David Ahern In-Reply-To: <20231023123422.2895-1-swarupkotikalapudi@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 23 Oct 2023 07:19:07 -0700 (PDT) On 10/23/23 6:34 AM, Swarup Laxman Kotiaklapudi wrote: > Change ifconfig with ip command, > on a system where ifconfig is > not used this script will not > work correcly. > > Test result with this patchset: > > sudo make TARGETS="net" kselftest > .... > TAP version 13 > 1..1 > timeout set to 1500 > selftests: net: route_localnet.sh > run arp_announce test > net.ipv4.conf.veth0.route_localnet = 1 > net.ipv4.conf.veth1.route_localnet = 1 > net.ipv4.conf.veth0.arp_announce = 2 > net.ipv4.conf.veth1.arp_announce = 2 > PING 127.25.3.14 (127.25.3.14) from 127.25.3.4 veth0: 56(84) > bytes of data. > 64 bytes from 127.25.3.14: icmp_seq=1 ttl=64 time=0.038 ms > 64 bytes from 127.25.3.14: icmp_seq=2 ttl=64 time=0.068 ms > 64 bytes from 127.25.3.14: icmp_seq=3 ttl=64 time=0.068 ms > 64 bytes from 127.25.3.14: icmp_seq=4 ttl=64 time=0.068 ms > 64 bytes from 127.25.3.14: icmp_seq=5 ttl=64 time=0.068 ms > > --- 127.25.3.14 ping statistics --- > 5 packets transmitted, 5 received, 0% packet loss, time 4073ms > rtt min/avg/max/mdev = 0.038/0.062/0.068/0.012 ms > ok > run arp_ignore test > net.ipv4.conf.veth0.route_localnet = 1 > net.ipv4.conf.veth1.route_localnet = 1 > net.ipv4.conf.veth0.arp_ignore = 3 > net.ipv4.conf.veth1.arp_ignore = 3 > PING 127.25.3.14 (127.25.3.14) from 127.25.3.4 veth0: 56(84) > bytes of data. > 64 bytes from 127.25.3.14: icmp_seq=1 ttl=64 time=0.032 ms > 64 bytes from 127.25.3.14: icmp_seq=2 ttl=64 time=0.065 ms > 64 bytes from 127.25.3.14: icmp_seq=3 ttl=64 time=0.066 ms > 64 bytes from 127.25.3.14: icmp_seq=4 ttl=64 time=0.065 ms > 64 bytes from 127.25.3.14: icmp_seq=5 ttl=64 time=0.065 ms > > --- 127.25.3.14 ping statistics --- > 5 packets transmitted, 5 received, 0% packet loss, time 4092ms > rtt min/avg/max/mdev = 0.032/0.058/0.066/0.013 ms > ok > ok 1 selftests: net: route_localnet.sh > ... > > Signed-off-by: Swarup Laxman Kotiaklapudi > --- > tools/testing/selftests/net/route_localnet.sh | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/net/route_localnet.sh b/tools/testing/selftests/net/route_localnet.sh > index 116bfeab72fa..e08701c750e3 100755 > --- a/tools/testing/selftests/net/route_localnet.sh > +++ b/tools/testing/selftests/net/route_localnet.sh > @@ -18,8 +18,10 @@ setup() { > ip route del 127.0.0.0/8 dev lo table local > ip netns exec "${PEER_NS}" ip route del 127.0.0.0/8 dev lo table local > > - ifconfig veth0 127.25.3.4/24 up > - ip netns exec "${PEER_NS}" ifconfig veth1 127.25.3.14/24 up > + ip address add 127.25.3.4/24 dev veth0 > + ip link set dev veth0 up > + ip netns exec "${PEER_NS}" ip address add 127.25.3.14/24 dev veth1 > + ip netns exec "${PEER_NS}" ip link set dev veth1 up > > ip route flush cache > ip netns exec "${PEER_NS}" ip route flush cache Reviewed-by: David Ahern