public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests: net: forwarding: cleanup veth peers created via NUM_NETIFS
@ 2026-01-20 23:09 Aleksei Oladko
  2026-01-21  1:31 ` Bobby Eshleman
  2026-01-21 13:39 ` Petr Machata
  0 siblings, 2 replies; 4+ messages in thread
From: Aleksei Oladko @ 2026-01-20 23:09 UTC (permalink / raw)
  To: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Shuah Khan, Petr Machata
  Cc: netdev, linux-kselftest, linux-kernel, Aleksei Oladko

Some net/forwarding kselftests set NUM_NETIFS, causing lib.sh to create
the requested number of veth peer interfaces.

These interfaces are not removed when the tests finish, leaving stale
veth devices in the system. This can cause subsequent tests to fail,
for example min_max_mtu.sh.

Ensure that veth peers created via NUM_NETIFS are properly removed at
the end of the tests to avoid interference between test runs.

Signed-off-by: Aleksei Oladko <aleksey.oladko@virtuozzo.com>
---
 tools/testing/selftests/net/forwarding/lib.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index a9034f0bb58b..ae7699c0c7e5 100644
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -597,6 +597,10 @@ vrf_cleanup()
 	ip -6 rule del pref 32765
 	ip -4 rule add pref 0 table local
 	ip -4 rule del pref 32765
+
+	for ((i = 1; i <= NUM_NETIFS; i=$i+2)); do
+		ip link delete dev ${NETIFS[p$i]} 2>/dev/null || true
+	done
 }
 
 adf_vrf_prepare()
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-21 15:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-20 23:09 [PATCH] selftests: net: forwarding: cleanup veth peers created via NUM_NETIFS Aleksei Oladko
2026-01-21  1:31 ` Bobby Eshleman
2026-01-21  1:41   ` Bobby Eshleman
2026-01-21 13:39 ` Petr Machata

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox