From f8b1bc9d95920d977ee2a24bbda3f97cb563b1bc Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 17 Aug 2020 12:12:23 +0200 Subject: src: add comment support for map too Extend and slightly rework tests/shell to cover this case too. Signed-off-by: Pablo Neira Ayuso --- tests/shell/testcases/sets/0054comments_set_0 | 8 +++----- tests/shell/testcases/sets/dumps/0054comments_set_0.nft | 6 ++++++ 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'tests/shell/testcases') diff --git a/tests/shell/testcases/sets/0054comments_set_0 b/tests/shell/testcases/sets/0054comments_set_0 index 93a73f0d..9c8f7875 100755 --- a/tests/shell/testcases/sets/0054comments_set_0 +++ b/tests/shell/testcases/sets/0054comments_set_0 @@ -1,11 +1,9 @@ #!/bin/bash +set -e + # Test that comments are added to sets $NFT add table t $NFT add set t s {type ipv4_addr \; flags interval \; comment "test" \;} -if ! $NFT list ruleset | grep test >/dev/null ; then - echo "E: missing comment in set" >&2 - exit 1 -fi - +$NFT add map t m {type ipv4_addr : ipv4_addr \; flags interval \; comment \"another test\" \;} diff --git a/tests/shell/testcases/sets/dumps/0054comments_set_0.nft b/tests/shell/testcases/sets/dumps/0054comments_set_0.nft index 2ad84003..79299241 100644 --- a/tests/shell/testcases/sets/dumps/0054comments_set_0.nft +++ b/tests/shell/testcases/sets/dumps/0054comments_set_0.nft @@ -4,4 +4,10 @@ table ip t { flags interval comment "test" } + + map m { + type ipv4_addr : ipv4_addr + flags interval + comment "another test" + } } -- cgit v1.2.3