selftests: netdevsim: sprinkle more udevadm settle
authorJakub Kicinski <kuba@kernel.org>
Sun, 14 Jan 2024 22:47:26 +0000 (14:47 -0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 16 Jan 2024 11:16:04 +0000 (12:16 +0100)
Number of tests are failing when netdev renaming is active
on the system. Add udevadm settle in logic determining
the names.

Fixes: 242aaf03dc9b ("selftests: add a test for ethtool pause stats")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240114224726.1210532-1-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/testing/selftests/drivers/net/netdevsim/ethtool-common.sh
tools/testing/selftests/drivers/net/netdevsim/udp_tunnel_nic.sh

index 9227440..8016057 100644 (file)
@@ -51,6 +51,7 @@ function make_netdev {
     fi
 
     echo $NSIM_ID $@ > /sys/bus/netdevsim/new_device
+    udevadm settle
     # get new device name
     ls /sys/bus/netdevsim/devices/netdevsim${NSIM_ID}/net/
 }
index 1b08e04..4855ef5 100755 (executable)
@@ -233,6 +233,7 @@ function print_tables {
 function get_netdev_name {
     local -n old=$1
 
+    udevadm settle
     new=$(ls /sys/class/net)
 
     for netdev in $new; do