Skip to content

Commit 31f26e4

Browse files
liuhangbindavem330
authored andcommitted
selftests: bonding: make sure new active is not null
One of Jakub's tests[1] shows that there may be period all ports are down and no active slave. This makes the new_active_slave null and the test fails. Add a check to make sure the new active is not null. [ 189.051966] br0: port 2(s1) entered disabled state [ 189.317881] bond0: (slave eth1): link status definitely down, disabling slave [ 189.318487] bond0: (slave eth2): making interface the new active one [ 190.435430] br0: port 4(s2) entered disabled state [ 190.773786] bond0: (slave eth0): link status definitely down, disabling slave [ 190.774204] bond0: (slave eth2): link status definitely down, disabling slave [ 190.774715] bond0: now running without any active interface! [ 190.877760] bond0: (slave eth0): link status definitely up [ 190.878098] bond0: (slave eth0): making interface the new active one [ 190.878495] bond0: active interface up! [ 191.802872] br0: port 4(s2) entered blocking state [ 191.803157] br0: port 4(s2) entered forwarding state [ 191.813756] bond0: (slave eth2): link status definitely up [ 192.847095] br0: port 2(s1) entered blocking state [ 192.847396] br0: port 2(s1) entered forwarding state [ 192.853740] bond0: (slave eth1): link status definitely up # TEST: prio (active-backup ns_ip6_target primary_reselect 1) [FAIL] # Current active slave is null but not eth0 [1] https://netdev-3.bots.linux.dev/vmksft-bonding/results/464481/1-bond-options-sh/stdout Fixes: 45bf79b ("selftests: bonding: reduce garp_test/arp_validate test time") Signed-off-by: Hangbin Liu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ae94dc2 commit 31f26e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/testing/selftests/drivers/net/bonding/bond_options.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ active_slave_changed()
5050
local old_active_slave=$1
5151
local new_active_slave=$(cmd_jq "ip -n ${s_ns} -d -j link show bond0" \
5252
".[].linkinfo.info_data.active_slave")
53-
test "$old_active_slave" != "$new_active_slave"
53+
[ "$new_active_slave" != "$old_active_slave" -a "$new_active_slave" != "null" ]
5454
}
5555

5656
check_active_slave()
5757
{
5858
local target_active_slave=$1
59-
slowwait 2 active_slave_changed $active_slave
59+
slowwait 5 active_slave_changed $active_slave
6060
active_slave=$(cmd_jq "ip -n ${s_ns} -d -j link show bond0" ".[].linkinfo.info_data.active_slave")
6161
test "$active_slave" = "$target_active_slave"
6262
check_err $? "Current active slave is $active_slave but not $target_active_slave"

0 commit comments

Comments
 (0)