xref: /openbmc/linux/tools/testing/selftests/net/forwarding/tc_common.sh (revision fcbd8037f7df694aa7bfb7ce82c0c7f5e53e7b7b)
1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3
4CHECK_TC="yes"
5
6tc_check_packets()
7{
8	local id=$1
9	local handle=$2
10	local count=$3
11
12	cmd_jq "tc -j -s filter show $id" \
13	       ".[] | select(.options.handle == $handle) | \
14	              select(.options.actions[0].stats.packets == $count)" \
15	       &> /dev/null
16}
17