Skip to content

Commit

Permalink
selftests: Extend fib tests to run with and without flags notifications
Browse files Browse the repository at this point in the history
Run the test cases with both `fib_notify_on_flag_change` sysctls set to
'1', and then with both sysctls set to '0' to verify there are no
regressions in the test when notifications are added.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Amit Cohen authored and Jakub Kicinski committed Feb 3, 2021
1 parent 907eea4 commit d1a7a48
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tools/testing/selftests/drivers/net/mlxsw/fib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,16 @@ ipv6_local_replace()
ip -n $ns link del dev dummy1
}

fib_notify_on_flag_change_set()
{
local notify=$1; shift

ip netns exec testns1 sysctl -qw net.ipv4.fib_notify_on_flag_change=$notify
ip netns exec testns1 sysctl -qw net.ipv6.fib_notify_on_flag_change=$notify

log_info "Set fib_notify_on_flag_change to $notify"
}

setup_prepare()
{
ip netns add testns1
Expand All @@ -251,6 +261,10 @@ trap cleanup EXIT

setup_prepare

fib_notify_on_flag_change_set 1
tests_run

fib_notify_on_flag_change_set 0
tests_run

exit $EXIT_STATUS
14 changes: 14 additions & 0 deletions tools/testing/selftests/drivers/net/netdevsim/fib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,16 @@ ipv6_error_path()
ipv6_error_path_replay
}

fib_notify_on_flag_change_set()
{
local notify=$1; shift

ip netns exec testns1 sysctl -qw net.ipv4.fib_notify_on_flag_change=$notify
ip netns exec testns1 sysctl -qw net.ipv6.fib_notify_on_flag_change=$notify

log_info "Set fib_notify_on_flag_change to $notify"
}

setup_prepare()
{
local netdev
Expand Down Expand Up @@ -336,6 +346,10 @@ trap cleanup EXIT

setup_prepare

fib_notify_on_flag_change_set 1
tests_run

fib_notify_on_flag_change_set 0
tests_run

exit $EXIT_STATUS

0 comments on commit d1a7a48

Please sign in to comment.