diff options
author | Petr Machata <petrm@mellanox.com> | 2020-05-29 14:16:54 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-30 21:48:24 -0700 |
commit | 3ed97037f063b9130b56991f55f346597d27440d (patch) | |
tree | f063063095695deaa42305100380e2402ef779a7 | |
parent | 1c0522b4a2e143fa6e55e4bd2308415c81184ec7 (diff) | |
download | linux-3ed97037f063b9130b56991f55f346597d27440d.tar.bz2 |
selftests: forwarding: pedit_dsfield: Check counter value
A missing stats_update callback was recently added to act_pedit. Now that
iproute2 supports JSON dumping for pedit, extend the pedit_dsfield selftest
with a check that would have caught the fact that the callback was missing.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rwxr-xr-x | tools/testing/selftests/net/forwarding/pedit_dsfield.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/forwarding/pedit_dsfield.sh b/tools/testing/selftests/net/forwarding/pedit_dsfield.sh index 1181d647f6a7..55eeacf59241 100755 --- a/tools/testing/selftests/net/forwarding/pedit_dsfield.sh +++ b/tools/testing/selftests/net/forwarding/pedit_dsfield.sh @@ -132,7 +132,12 @@ do_test_pedit_dsfield_common() local pkts pkts=$(busywait "$TC_HIT_TIMEOUT" until_counter_is ">= 10" \ tc_rule_handle_stats_get "dev $h2 ingress" 101) - check_err $? "Expected to get 10 packets, but got $pkts." + check_err $? "Expected to get 10 packets on test probe, but got $pkts." + + pkts=$(tc_rule_handle_stats_get "$pedit_locus" 101) + ((pkts >= 10)) + check_err $? "Expected to get 10 packets on pedit rule, but got $pkts." + log_test "$pedit_locus pedit $pedit_action" } |