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.
Unified · Split
| @@ -81,6 +81,8 @@ full_test_span_gre_dir_acl() · 80 unmodified lines | |||
| 81 | local match_dip=$1; shift | 81 | local match_dip=$1; shift |
| 82 | local what=$1; shift | 82 | local what=$1; shift |
| 83 | 83 | ||
| 84 | RET=0 | ||
| 85 | |||
| 84 | mirror_install $swp1 $direction $tundev \ | 86 | mirror_install $swp1 $direction $tundev \ |
| 85 | "protocol ip flower $tcflags dst_ip $match_dip" | 87 | "protocol ip flower $tcflags dst_ip $match_dip" |
| 86 | fail_test_span_gre_dir $tundev $direction | 88 | fail_test_span_gre_dir $tundev $direction |
| @@ -108,8 +110,6 @@ test_ip6gretap() · 21 unmodified lines | |||
| 108 | 110 | ||
| 109 | test_all() | 111 | test_all() |
| 110 | { | 112 | { |
| 111 | RET=0 | ||
| 112 | |||
| 113 | slow_path_trap_install $swp1 ingress | 113 | slow_path_trap_install $swp1 ingress |
| 114 | slow_path_trap_install $swp1 egress | 114 | slow_path_trap_install $swp1 egress |
| 115 | 115 | ||