Commit 5a967512 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

selftests: forwarding: add tests for TC chain get and dump operations

Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dc66fe43
......@@ -88,9 +88,30 @@ create_destroy_chain()
tc chain add dev $h2 ingress
check_err $? "Failed to create default chain"
output="$(tc -j chain get dev $h2 ingress)"
check_err $? "Failed to get default chain"
echo $output | jq -e ".[] | select(.chain == 0)" &> /dev/null
check_err $? "Unexpected output for default chain"
tc chain add dev $h2 ingress chain 1
check_err $? "Failed to create chain 1"
output="$(tc -j chain get dev $h2 ingress chain 1)"
check_err $? "Failed to get chain 1"
echo $output | jq -e ".[] | select(.chain == 1)" &> /dev/null
check_err $? "Unexpected output for chain 1"
output="$(tc -j chain show dev $h2 ingress)"
check_err $? "Failed to dump chains"
echo $output | jq -e ".[] | select(.chain == 0)" &> /dev/null
check_err $? "Can't find default chain in dump"
echo $output | jq -e ".[] | select(.chain == 1)" &> /dev/null
check_err $? "Can't find chain 1 in dump"
tc chain del dev $h2 ingress
check_err $? "Failed to destroy default chain"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment