]> www.infradead.org Git - users/hch/misc.git/commitdiff
selftests: net: speed up pmtu.sh by avoiding unnecessary cleanup
authorJakub Kicinski <kuba@kernel.org>
Sat, 6 Sep 2025 21:45:35 +0000 (14:45 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 9 Sep 2025 23:26:44 +0000 (16:26 -0700)
The pmtu test takes nearly an hour when run on a debug kernel
(10min on a normal kernel, so the debug slow down is quite significant).
NIPA tries to ensure all results are delivered by a certain deadline
so this prevents it from retrying the test in case of a flake.

Looks like one of the slowest operations in the test is calling out
to ./openvswitch/ovs-dpctl.py to remove potential leftover OvS interfaces.
Check whether the interfaces exist in the first place in sysfs,
since it can be done directly in bash it is very fast.

This should save us around 20-30% of the test runtime.

Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250906214535.3204785-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/pmtu.sh

index 88e914c4eef94c358f46b2ba646903338a6e536c..a3323c21f00149aaa086fdc71c4e30239b81057a 100755 (executable)
@@ -1089,10 +1089,11 @@ cleanup() {
 
        cleanup_all_ns
 
-       ip link del veth_A-C            2>/dev/null
-       ip link del veth_A-R1           2>/dev/null
-       cleanup_del_ovs_internal
-       cleanup_del_ovs_vswitchd
+       [ -e "/sys/class/net/veth_A-C"  ] && ip link del veth_A-C
+       [ -e "/sys/class/net/veth_A-R1" ] && ip link del veth_A-R1
+       [ -e "/sys/class/net/ovs_br0"   ] && cleanup_del_ovs_internal
+       [ -e "/sys/class/net/ovs_br0"   ] && cleanup_del_ovs_vswitchd
+
        rm -f "$tmpoutfile"
 }