selftests: forwarding: mirror_gre_flower: Fix test result handling
authorPetr Machata <petrm@mellanox.com>
Thu, 31 Jan 2019 22:35:27 +0000 (22:35 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Feb 2019 23:26:37 +0000 (15:26 -0800)
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>
tools/testing/selftests/net/forwarding/mirror_gre_flower.sh

index 12914f40612d36e7113ef905091bf59fb9d314e2..09389f3b936946af6a6964f439718510df80fe77 100755 (executable)
@@ -81,6 +81,8 @@ full_test_span_gre_dir_acl()
        local match_dip=$1; shift
        local what=$1; shift
 
+       RET=0
+
        mirror_install $swp1 $direction $tundev \
                       "protocol ip flower $tcflags dst_ip $match_dip"
        fail_test_span_gre_dir $tundev $direction
@@ -108,8 +110,6 @@ test_ip6gretap()
 
 test_all()
 {
-       RET=0
-
        slow_path_trap_install $swp1 ingress
        slow_path_trap_install $swp1 egress