diff options
author | Eric Jallot <ejallot@gmail.com> | 2019-10-30 18:06:19 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-10-31 14:16:42 +0100 |
commit | 81c51fc1ab699fb6e417ada77221657ca34efd0b (patch) | |
tree | a0deb244f9e69ba8b6013162a1293cc2ec517de2 /tests/shell | |
parent | 909e297ed430c3d7be0ad06bb002913e766115f1 (diff) |
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 <ejallot@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell')
-rwxr-xr-x | tests/shell/testcases/listing/0020flowtable_0 | 21 |
1 files changed, 21 insertions, 0 deletions
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 |