From 81c51fc1ab699fb6e417ada77221657ca34efd0b Mon Sep 17 00:00:00 2001 From: Eric Jallot Date: Wed, 30 Oct 2019 18:06:19 +0100 Subject: src: flowtable: add support for named flowtable listing This patch allows you to dump a named flowtable. # nft list flowtable inet t f table inet t { flowtable f { hook ingress priority filter + 10 devices = { eth0, eth1 } } } Also: libnftables-json.adoc: fix missing quotes. Fixes: db0697ce7f60 ("src: support for flowtable listing") Fixes: 872f373dc50f ("doc: Add JSON schema documentation") Signed-off-by: Eric Jallot Signed-off-by: Pablo Neira Ayuso --- tests/shell/testcases/listing/0020flowtable_0 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 tests/shell/testcases/listing/0020flowtable_0 (limited to 'tests/shell') diff --git a/tests/shell/testcases/listing/0020flowtable_0 b/tests/shell/testcases/listing/0020flowtable_0 new file mode 100755 index 00000000..6f630f14 --- /dev/null +++ b/tests/shell/testcases/listing/0020flowtable_0 @@ -0,0 +1,21 @@ +#!/bin/bash + +# list only the flowtable asked for with table + +EXPECTED="table inet filter { + flowtable f { + hook ingress priority filter + devices = { lo } + } +}" + +set -e + +$NFT -f - <<< "$EXPECTED" + +GET="$($NFT list flowtable inet filter f)" +if [ "$EXPECTED" != "$GET" ] ; then + DIFF="$(which diff)" + [ -x $DIFF ] && $DIFF -u <(echo "$EXPECTED") <(echo "$GET") + exit 1 +fi -- cgit v1.2.3