* [nft PATCH] tests/shell: add tests for handles and comments
@ 2015-12-23 13:19 Arturo Borrero Gonzalez
2015-12-25 12:17 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Arturo Borrero Gonzalez @ 2015-12-23 13:19 UTC (permalink / raw)
To: netfilter-devel; +Cc: pablo
Here some tests for optional things like rule handles and comments.
Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
| 8 ++++++++
tests/shell/testcases/optionals/comments_handles_0 | 10 ++++++++++
tests/shell/testcases/optionals/handles_0 | 8 ++++++++
tests/shell/testcases/optionals/handles_1 | 8 ++++++++
4 files changed, 34 insertions(+)
create mode 100755 tests/shell/testcases/optionals/comments_0
create mode 100755 tests/shell/testcases/optionals/comments_handles_0
create mode 100755 tests/shell/testcases/optionals/handles_0
create mode 100755 tests/shell/testcases/optionals/handles_1
--git a/tests/shell/testcases/optionals/comments_0 b/tests/shell/testcases/optionals/comments_0
new file mode 100755
index 0000000..29b8506
--- /dev/null
+++ b/tests/shell/testcases/optionals/comments_0
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# comments are shown
+
+$NFT add table test
+$NFT add chain test test
+$NFT add rule test test tcp dport 22 counter accept comment test_comment
+$NFT list table test -a | grep 'accept comment \"test_comment\"' >/dev/null
diff --git a/tests/shell/testcases/optionals/comments_handles_0 b/tests/shell/testcases/optionals/comments_handles_0
new file mode 100755
index 0000000..30539bf
--- /dev/null
+++ b/tests/shell/testcases/optionals/comments_handles_0
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+# handles and comments mix well
+
+$NFT add table test
+$NFT add chain test test
+$NFT add rule test test tcp dport 22 counter accept comment test_comment
+set -e
+$NFT list table test -a | grep 'accept comment \"test_comment\" # handle '[[:digit:]]$ >/dev/null
+$NFT list table test | grep 'accept comment \"test_comment\"' | grep -v '# handle '[[:digit:]]$ >/dev/null
diff --git a/tests/shell/testcases/optionals/handles_0 b/tests/shell/testcases/optionals/handles_0
new file mode 100755
index 0000000..7c6a437
--- /dev/null
+++ b/tests/shell/testcases/optionals/handles_0
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# handles are shown last
+
+$NFT add table test
+$NFT add chain test test
+$NFT add rule test test tcp dport 22 counter accept
+$NFT list table test -a | grep 'accept # handle '[[:digit:]]$ >/dev/null
diff --git a/tests/shell/testcases/optionals/handles_1 b/tests/shell/testcases/optionals/handles_1
new file mode 100755
index 0000000..a3ae1a7
--- /dev/null
+++ b/tests/shell/testcases/optionals/handles_1
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# handles are not shown if not asked for them
+
+$NFT add table test
+$NFT add chain test test
+$NFT add rule test test tcp dport 22 counter accept
+$NFT list table test | grep 'accept # handle '[[:digit:]]$ >/dev/null
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [nft PATCH] tests/shell: add tests for handles and comments
2015-12-23 13:19 [nft PATCH] tests/shell: add tests for handles and comments Arturo Borrero Gonzalez
@ 2015-12-25 12:17 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2015-12-25 12:17 UTC (permalink / raw)
To: Arturo Borrero Gonzalez; +Cc: netfilter-devel
On Wed, Dec 23, 2015 at 02:19:22PM +0100, Arturo Borrero Gonzalez wrote:
> Here some tests for optional things like rule handles and comments.
Applied, thanks Arturo.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-25 12:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-23 13:19 [nft PATCH] tests/shell: add tests for handles and comments Arturo Borrero Gonzalez
2015-12-25 12:17 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).