From a9350dc93850b1e616d65acf30651377dcd1d87d Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Wed, 3 Feb 2021 17:57:05 +0100 Subject: tests: extend dtype test case to cover expression with integer type ... nft doesn't handle this correctly at the moment: they are added as network byte order (invalid byte order). ct zone has integer_type, the byte order has to be taken from the expression. Signed-off-by: Florian Westphal --- .../shell/testcases/sets/0029named_ifname_dtype_0 | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'tests/shell/testcases/sets/0029named_ifname_dtype_0') diff --git a/tests/shell/testcases/sets/0029named_ifname_dtype_0 b/tests/shell/testcases/sets/0029named_ifname_dtype_0 index 39b3c90c..2dbcd22b 100755 --- a/tests/shell/testcases/sets/0029named_ifname_dtype_0 +++ b/tests/shell/testcases/sets/0029named_ifname_dtype_0 @@ -13,12 +13,53 @@ EXPECTED="table inet t { elements = { \"ssh\" . \"eth0\" } } + set nv { + type ifname . mark + } + + set z { + typeof ct zone + elements = { 1 } + } + + set m { + typeof meta mark + elements = { 1 } + } + + map cz { + typeof meta iifname : ct zone + elements = { \"veth4\" : 1 } + } + + map cm { + typeof meta iifname : ct mark + elements = { \"veth4\" : 1 } + } + chain c { iifname @s accept oifname @s accept tcp dport . meta iifname @sc accept + meta iifname . meta mark @nv accept } }" set -e $NFT -f - <<< "$EXPECTED" +$NFT add element inet t s '{ "eth1" }' +$NFT add element inet t s '{ "eth2", "eth3", "veth1" }' + +$NFT add element inet t sc '{ 80 . "eth0" }' +$NFT add element inet t sc '{ 80 . "eth0" }' || true +$NFT add element inet t sc '{ 80 . "eth1" }' +$NFT add element inet t sc '{ 81 . "eth0" }' + +$NFT add element inet t nv '{ "eth0" . 1 }' +$NFT add element inet t nv '{ "eth0" . 2 }' + +$NFT add element inet t z '{ 2, 3, 4, 5, 6 }' +$NFT add element inet t cz '{ "eth0" : 1, "eth1" : 2 }' + +$NFT add element inet t m '{ 2, 3, 4, 5, 6 }' +$NFT add element inet t cm '{ "eth0" : 1, "eth1" : 2 }' -- cgit v1.2.3