Skip to content

Commit

Permalink
selftests: mlxsw: mirror_gre: Obey TESTS
Browse files Browse the repository at this point in the history
This test is unusual in that overriding TESTS does not change the tests to
be run. Split the individual tests into several functions and invoke them
through tests_run() as appropriate.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
pmachata authored and davem330 committed Jun 28, 2024
1 parent 06704a0 commit 098ba97
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions tools/testing/selftests/drivers/net/mlxsw/mirror_gre.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ source $lib_dir/mirror_lib.sh
source $lib_dir/mirror_gre_lib.sh
source $lib_dir/mirror_gre_topo_lib.sh

ALL_TESTS="
test_keyful
test_soft
test_tos_fixed
test_ttl_inherit
"

setup_keyful()
{
tunnel_create gt6-key ip6gretap 2001:db8:3::1 2001:db8:3::2 \
Expand Down Expand Up @@ -162,19 +169,25 @@ test_span_failable()
log_test "fail $what"
}

test_failable()
test_keyful()
{
test_span_failable gt6-key "mirror to keyful gretap"
test_span_failable gt6-soft "mirror to gretap w/ soft underlay"
}

test_hw()
test_soft()
{
test_failable
test_span_failable gt6-soft "mirror to gretap w/ soft underlay"
}

test_tos_fixed()
{
test_span_gre_tos_fixed gt4 gretap "mirror to gretap"
test_span_gre_tos_fixed gt6 ip6gretap "mirror to ip6gretap"
}


test_ttl_inherit()
{
test_span_gre_ttl_inherit gt4 gretap "mirror to gretap"
test_span_gre_ttl_inherit gt6 ip6gretap "mirror to ip6gretap"
}
Expand All @@ -184,6 +197,6 @@ trap cleanup EXIT
setup_prepare
setup_wait

test_hw
tests_run

exit $EXIT_STATUS

0 comments on commit 098ba97

Please sign in to comment.