diff mbox series

[net-next] selftests: bonding: make sure new active is not null

Message ID 20240214092128.3041109-1-liuhangbin@gmail.com (mailing list archive)
State Accepted
Commit 31f26e4fec1fd9fd51efab0aee6b6c370b5e27e7
Delegated to: Netdev Maintainers
Headers show
Series [net-next] selftests: bonding: make sure new active is not null | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers fail 1 blamed authors not CCed: przemyslaw.kitszel@intel.com; 4 maintainers not CCed: andy@greyhouse.net shuah@kernel.org przemyslaw.kitszel@intel.com linux-kselftest@vger.kernel.org
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success net selftest script(s) already in Makefile
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch warning WARNING: line length of 87 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-02-15--00-00 (tests: 1443)

Commit Message

Hangbin Liu Feb. 14, 2024, 9:21 a.m. UTC
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: 45bf79bc56c4 ("selftests: bonding: reduce garp_test/arp_validate test time")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 tools/testing/selftests/drivers/net/bonding/bond_options.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Feb. 16, 2024, 8:10 a.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Wed, 14 Feb 2024 17:21:28 +0800 you wrote:
> 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
> 
> [...]

Here is the summary with links:
  - [net-next] selftests: bonding: make sure new active is not null
    https://git.kernel.org/netdev/net-next/c/31f26e4fec1f

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/drivers/net/bonding/bond_options.sh b/tools/testing/selftests/drivers/net/bonding/bond_options.sh
index 6fd0cff3e1e9..644ea5769e81 100755
--- a/tools/testing/selftests/drivers/net/bonding/bond_options.sh
+++ b/tools/testing/selftests/drivers/net/bonding/bond_options.sh
@@ -50,13 +50,13 @@  active_slave_changed()
 	local old_active_slave=$1
 	local new_active_slave=$(cmd_jq "ip -n ${s_ns} -d -j link show bond0" \
 				".[].linkinfo.info_data.active_slave")
-	test "$old_active_slave" != "$new_active_slave"
+	[ "$new_active_slave" != "$old_active_slave" -a "$new_active_slave" != "null" ]
 }
 
 check_active_slave()
 {
 	local target_active_slave=$1
-	slowwait 2 active_slave_changed $active_slave
+	slowwait 5 active_slave_changed $active_slave
 	active_slave=$(cmd_jq "ip -n ${s_ns} -d -j link show bond0" ".[].linkinfo.info_data.active_slave")
 	test "$active_slave" = "$target_active_slave"
 	check_err $? "Current active slave is $active_slave but not $target_active_slave"