mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-25 00:52:45 -04:00
Add first part of flower tests. This patch only contains dst/src ip/mac matching. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
24 lines
452 B
Bash
24 lines
452 B
Bash
#!/bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
tc_check_packets()
|
|
{
|
|
local id=$1
|
|
local handle=$2
|
|
local count=$3
|
|
local ret
|
|
|
|
output="$(tc -j -s filter show $id)"
|
|
# workaround the jq bug which causes jq to return 0 in case input is ""
|
|
ret=$?
|
|
if [[ $ret -ne 0 ]]; then
|
|
return $ret
|
|
fi
|
|
echo $output | \
|
|
jq -e ".[] \
|
|
| select(.options.handle == $handle) \
|
|
| select(.options.actions[0].stats.packets == $count)" \
|
|
&> /dev/null
|
|
return $?
|
|
}
|