Skip to content

Commit 3ed9703

Browse files
pmachatadavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1c0522b commit 3ed9703

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,12 @@ do_test_pedit_dsfield_common()
132132
local pkts
133133
pkts=$(busywait "$TC_HIT_TIMEOUT" until_counter_is ">= 10" \
134134
tc_rule_handle_stats_get "dev $h2 ingress" 101)
135-
check_err $? "Expected to get 10 packets, but got $pkts."
135+
check_err $? "Expected to get 10 packets on test probe, but got $pkts."
136+
137+
pkts=$(tc_rule_handle_stats_get "$pedit_locus" 101)
138+
((pkts >= 10))
139+
check_err $? "Expected to get 10 packets on pedit rule, but got $pkts."
140+
136141
log_test "$pedit_locus pedit $pedit_action"
137142
}
138143

0 commit comments

Comments
 (0)