summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2017-07-25 20:39:42 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2017-07-27 10:50:21 +0200
commit8a3b2e7327a3057b5976df4af387b8143aad6110 (patch)
tree6122fd07ab0e7caba68e5c90fd8f2e30ad08663f /tests
parent9c870174df2837131359f2876d4675d0f5ffe86a (diff)
monitor: Fix printing of set declarations
The optional attributes 'flags', 'gc-interval' and 'timeout' have to be delimited by stmt_separator (either newline or semicolon), not 'nl' which is set to whitespace by set_print_plain(). In order to restore readability, change stmt_separator to include a single whitespace after the semicolon. Here's monitor output for the following command: | # nft add set ip t testset { type inet_service; \ | timeout 60s; gc-interval 120s; } Before this patch: | add set ip t testset { type inet_service;timeout 1m gc-interval 2m } With this patch applied: | add set ip t testset { type inet_service; timeout 1m; gc-interval 2m; } Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/monitor/testcases/set-maps.t2
-rw-r--r--tests/monitor/testcases/set-mixed.t2
-rw-r--r--tests/monitor/testcases/set-multiple.t4
-rw-r--r--tests/monitor/testcases/set-simple.t2
4 files changed, 5 insertions, 5 deletions
diff --git a/tests/monitor/testcases/set-maps.t b/tests/monitor/testcases/set-maps.t
index d94016be..6ea36cb9 100644
--- a/tests/monitor/testcases/set-maps.t
+++ b/tests/monitor/testcases/set-maps.t
@@ -2,7 +2,7 @@
I add table ip t
O add table ip t
I add map ip t portip { type inet_service: ipv4_addr; flags interval; }
-O add map ip t portip { type inet_service : ipv4_addr;flags interval }
+O add map ip t portip { type inet_service : ipv4_addr;flags interval; }
I add element ip t portip { 80-100: 10.0.0.1 }
O add element ip t portip { 80-100 : 10.0.0.1 }
diff --git a/tests/monitor/testcases/set-mixed.t b/tests/monitor/testcases/set-mixed.t
index c4699eda..2eb35b5a 100644
--- a/tests/monitor/testcases/set-mixed.t
+++ b/tests/monitor/testcases/set-mixed.t
@@ -2,7 +2,7 @@
I add table ip t
O add table ip t
I add set ip t portrange { type inet_service; flags interval; }
-O add set ip t portrange { type inet_service;flags interval }
+O add set ip t portrange { type inet_service;flags interval; }
I add set ip t ports { type inet_service; }
O add set ip t ports { type inet_service;}
diff --git a/tests/monitor/testcases/set-multiple.t b/tests/monitor/testcases/set-multiple.t
index d94f941b..ce919125 100644
--- a/tests/monitor/testcases/set-multiple.t
+++ b/tests/monitor/testcases/set-multiple.t
@@ -2,9 +2,9 @@
I add table ip t
O add table ip t
I add set ip t portrange { type inet_service; flags interval; }
-O add set ip t portrange { type inet_service;flags interval }
+O add set ip t portrange { type inet_service;flags interval; }
I add set ip t portrange2 { type inet_service; flags interval; }
-O add set ip t portrange2 { type inet_service;flags interval }
+O add set ip t portrange2 { type inet_service;flags interval; }
# make sure concurrent adds work
I add element ip t portrange { 1024-65535 }
diff --git a/tests/monitor/testcases/set-simple.t b/tests/monitor/testcases/set-simple.t
index 22f648db..e44cce08 100644
--- a/tests/monitor/testcases/set-simple.t
+++ b/tests/monitor/testcases/set-simple.t
@@ -2,7 +2,7 @@
I add table ip t
O add table ip t
I add set ip t portrange { type inet_service; flags interval; }
-O add set ip t portrange { type inet_service;flags interval }
+O add set ip t portrange { type inet_service;flags interval; }
# adding some ranges
I add element ip t portrange { 1-10 }