Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp655915rda; Sun, 22 Oct 2023 04:32:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFE5KLEzCPhG6LjmBD3ybcT7VAPa9DtJ/npKt73rRy6z64bKMomjF6IAp6aiuU26E5pwRrb X-Received: by 2002:a05:6a21:35c9:b0:14c:3218:c1bd with SMTP id ba9-20020a056a2135c900b0014c3218c1bdmr6664849pzc.11.1697974334750; Sun, 22 Oct 2023 04:32:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697974334; cv=none; d=google.com; s=arc-20160816; b=cQZfh40m9P7ThNrSE3qzsg2qCs74REFh3ZJeCeyd1qpIjbJK6C6SDN93eIs+4mDBdU WPpT3J/J2OLC36FLMbIGrAMHY5Tn/1ZqyTVy/7ZNGZ7xZRIzaOK4GN1naPrcdw53xcct YWv+ebpOzfRB/CBP235trg5gZqJc9hqeRZ8zOuxxO9hCt29Nxtm1RkTXp5h3ZaFssCc2 fMWxR6v8Qeo7Q/w9LtPr9ZPzg3dMhDrBsvLE81d0J1NgKF7uclnTOLpxploCMLu6c5o3 OmGCDpFe4zivNk6lrLguV1JuVfwWVHaVyp90iDSrHQ7QcjteBCAmCh7RMVKzJDlDIEHN 9JqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=GQ7n+v9m+PyKaMpTphITvlWXT1CO3oXKgg4jO6DVoj8=; fh=vTuvZX/pPW5RBgl9ikfuZ/1cIGGukKMwDqp8zu4iDXs=; b=aEV49S3nK+07SLgdnfcgaifMk78FPfkC3Yyw/+ixTNDFMqE9td/W3Ff+5T5yGTzDo2 kTM15nPjpHM4c2epGL46Joui8nf4QffR6+1GQvua7K7rY9P5J0+/T2xCf5OE5mIgrPVO yUWmOKqQVUOiDRKG138+6GJFdklNcidHNDbRKMqNvCZ7SAm0nUMQeQFSw4IQnJ8YIrVt KjkOJdkY1y7Zww4v0jDmiyrXShnlpkQP+4oJ5vj/IkcaLej1+jXxiKz2EtCaCZ8Dm7aO rvkseSGeNvm45owiZVOnZSNpV8NUQcwXDr6YPdwFv57r0gcHGDEIRacWy4SBiPXf7ZhU YkLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Pk9zkKC4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id w24-20020a63f518000000b005aa0af5b62esi4599140pgh.511.2023.10.22.04.32.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 04:32:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Pk9zkKC4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C907E804E447; Sun, 22 Oct 2023 04:32:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231783AbjJVLcJ (ORCPT + 99 others); Sun, 22 Oct 2023 07:32:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231684AbjJVLcH (ORCPT ); Sun, 22 Oct 2023 07:32:07 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53E2F11B; Sun, 22 Oct 2023 04:32:02 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6b497c8575aso2350038b3a.1; Sun, 22 Oct 2023 04:32:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697974321; x=1698579121; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GQ7n+v9m+PyKaMpTphITvlWXT1CO3oXKgg4jO6DVoj8=; b=Pk9zkKC4iq2w0RIHV9nWDaxhPYwZV79uUtMsRdU1wnW+esMA5XkYALbKYjbPITY/oK 2VCSIBns+g6wSoU4IBr9YLHY6r3EnFUTz27EBH7A9m5zM1pGZdrBx5je5/G7jzvddjHh VPmBKuxIZ1w8XDz6p+J7Awf+JcB/nhwP7FbUpijY43judsOcEeITJLP8Vqd5fDuwW+kz 6eCEXzeo6Bbhex7kGRDvbRjkV60aXks0Bz6prR7uBLeQHJrormf8IgXAEtKlP7bfC77L 7H8HHh40peT3jN2AoIn6AQBSWqobRYylYAEcZ7jidhKT68FePjPD27/efofNbTYSXUg7 yh5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697974321; x=1698579121; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GQ7n+v9m+PyKaMpTphITvlWXT1CO3oXKgg4jO6DVoj8=; b=Orqa9iRYIrLafefXqS575JfEWWj+UZsJLdijui4/48l4glfTSGaf3+oTxpGRDefc1R OyV9uz2meOGbzGWJFDc4P2MFDvlioSOh9DbEeMQxjCxMxcYAf9qY1ioRDUiZ8XP3CKAn LvH3zV0a/B7flO8qn7EZjA3/wMX2E5zdocr8ppqHS0LBEcwJM7xDtiyGPQRBPZacyXIt T+aoX5mQJ3JLWtFIHmoquU3NOwd2ErN9yVvAlV/EvbG6ByRGbrVTQpR8EJ0FDMTy6dat XrF5KfPIchqn+WIKm0gl9ETnqH7hpv3yPhduqrHTqjB0GtbTuS8ysjfsbr7ByaCOYrFd SQbg== X-Gm-Message-State: AOJu0YywU5cN4ov577XbeXppO1zb84qJYzTrD6lBcWdDCAdxXQCT2KgY iVmSyPZRH1jTi2uDLbVvsuA= X-Received: by 2002:a05:6a00:a27:b0:6bf:83d1:da6e with SMTP id p39-20020a056a000a2700b006bf83d1da6emr1955818pfh.22.1697974321053; Sun, 22 Oct 2023 04:32:01 -0700 (PDT) Received: from swarup-virtual-machine.localdomain ([171.76.85.44]) by smtp.gmail.com with ESMTPSA id f125-20020a625183000000b0065a1b05193asm4649833pfb.185.2023.10.22.04.31.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 04:32:00 -0700 (PDT) From: Swarup Laxman Kotiaklapudi To: davem@davemloft.net, 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 Cc: Swarup Laxman Kotiaklapudi Subject: [PATCH] selftests:net change ifconfig with ip command Date: Sun, 22 Oct 2023 17:01:48 +0530 Message-Id: <20231022113148.2682-1-swarupkotikalapudi@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 22 Oct 2023 04:32:13 -0700 (PDT) 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..3ab9beb4462c 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 a add 127.25.3.4/24 dev veth0 + ip link set dev veth0 up + ip netns exec "${PEER_NS}" ip a 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 -- 2.34.1