[Devel] [PATCH RHEL10 COMMIT] selftests: net: forwarding: cleanup veth peers created via NUM_NETIFS
Konstantin Khorenko
khorenko at virtuozzo.com
Fri Jan 9 18:08:41 MSK 2026
The commit is pushed to "branch-rh10-6.12.0-55.13.1.2.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-55.13.1.2.29.vz10
------>
commit 9719129d049291a3b407ff9c71846d1321450aeb
Author: Aleksei Oladko <aleksey.oladko at virtuozzo.com>
Date: Sun Jan 4 01:50:25 2026 +0000
selftests: net: forwarding: cleanup veth peers created via NUM_NETIFS
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.
https://virtuozzo.atlassian.net/browse/VSTOR-121804
Signed-off-by: Aleksei Oladko <aleksey.oladko at virtuozzo.com>
Feature: fix selftests
---
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 9f7f5b7ab18c8..4ef22f17f1848 100644
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -793,6 +793,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
}
__last_tb_id=0
More information about the Devel
mailing list