Skip to content

Commit 084fafe

Browse files
pmachatadavem330
authored andcommitted
selftests: forwarding: mirror_gre_flower: Fix test result handling
The global variable RET needs to be initialized before each call to log_test. This test case sets it once before running the tests, but then calls log_tests for every individual test. Thus a failure in one of the tests causes spurious failures in follow-up tests as well. Fix by moving the initialization of RET from test_all() to full_test_span_gre_dir_acl(), a function that implements the test. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2243cad commit 084fafe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/testing/selftests/net/forwarding/mirror_gre_flower.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ full_test_span_gre_dir_acl()
8181
local match_dip=$1; shift
8282
local what=$1; shift
8383

84+
RET=0
85+
8486
mirror_install $swp1 $direction $tundev \
8587
"protocol ip flower $tcflags dst_ip $match_dip"
8688
fail_test_span_gre_dir $tundev $direction
@@ -108,8 +110,6 @@ test_ip6gretap()
108110

109111
test_all()
110112
{
111-
RET=0
112-
113113
slow_path_trap_install $swp1 ingress
114114
slow_path_trap_install $swp1 egress
115115

0 commit comments

Comments
 (0)