Skip to content

Commit

Permalink
selftests: forwarding: pedit_dsfield: Check counter value
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Petr Machata authored and David S. Miller committed May 31, 2020
1 parent 1c0522b commit 3ed9703
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/testing/selftests/net/forwarding/pedit_dsfield.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down

0 comments on commit 3ed9703

Please sign in to comment.