netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [nft PATCH 1/3] tests: shell: delete useless stderr output in testcase
@ 2016-11-03 12:04 Arturo Borrero Gonzalez
  2016-11-03 12:04 ` [nft PATCH 2/3] tests: shell: introduce the cache testcases directory Arturo Borrero Gonzalez
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arturo Borrero Gonzalez @ 2016-11-03 12:04 UTC (permalink / raw)
  To: netfilter-devel

From: Arturo Borrero Gonzalez <arturo@debian.org>

This stderr output is expected.

Signed-off-by: Arturo Borrero Gonzalez <arturo@debian.org>
---
 tests/shell/testcases/transactions/0014chain_1 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/shell/testcases/transactions/0014chain_1 b/tests/shell/testcases/transactions/0014chain_1
index a03ef12..955860d 100755
--- a/tests/shell/testcases/transactions/0014chain_1
+++ b/tests/shell/testcases/transactions/0014chain_1
@@ -16,5 +16,5 @@ delete chain x y
 delete chain x y"
 
 echo "$RULESET" > $tmpfile
-$NFT -f $tmpfile
+$NFT -f $tmpfile 2>/dev/null
 echo "E: allowing double-removal of chain" >&2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [nft PATCH 2/3] tests: shell: introduce the cache testcases directory
  2016-11-03 12:04 [nft PATCH 1/3] tests: shell: delete useless stderr output in testcase Arturo Borrero Gonzalez
@ 2016-11-03 12:04 ` Arturo Borrero Gonzalez
  2016-11-03 12:04 ` [nft PATCH 3/3] tests: shell: add a new testcase for ruleset loading bug Arturo Borrero Gonzalez
  2016-11-08 23:22 ` [nft PATCH 1/3] tests: shell: delete useless stderr output in testcase Pablo Neira Ayuso
  2 siblings, 0 replies; 4+ messages in thread
From: Arturo Borrero Gonzalez @ 2016-11-03 12:04 UTC (permalink / raw)
  To: netfilter-devel

From: Arturo Borrero Gonzalez <arturo@debian.org>

This directory is for testcases related to the nft cache.

Signed-off-by: Arturo Borrero Gonzalez <arturo@debian.org>
---
 tests/shell/testcases/cache/0001_cache_handling_0 |   29 +++++++++++++++++++++
 tests/shell/testcases/sets/cache_handling_0       |   29 ---------------------
 2 files changed, 29 insertions(+), 29 deletions(-)
 create mode 100755 tests/shell/testcases/cache/0001_cache_handling_0
 delete mode 100755 tests/shell/testcases/sets/cache_handling_0

diff --git a/tests/shell/testcases/cache/0001_cache_handling_0 b/tests/shell/testcases/cache/0001_cache_handling_0
new file mode 100755
index 0000000..9a73769
--- /dev/null
+++ b/tests/shell/testcases/cache/0001_cache_handling_0
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+tmpfile=$(mktemp)
+if [ ! -w $tmpfile ] ; then
+	echo "Failed to create tmp file" >&2
+	exit 0
+fi
+
+trap "rm -rf $tmpfile" EXIT # cleanup if aborted
+
+echo "
+table inet test {
+	set test {
+		type ipv4_addr
+		elements = { 1.1.1.1}
+	}
+
+	chain test {
+		ip saddr @test counter accept
+		ip daddr { 2.2.2.2} counter accept
+	}
+}" > $tmpfile
+
+set -e
+
+$NFT -f $tmpfile
+$NFT delete rule inet test test handle 2
+$NFT delete set inet test test
+$NFT -f $tmpfile
diff --git a/tests/shell/testcases/sets/cache_handling_0 b/tests/shell/testcases/sets/cache_handling_0
deleted file mode 100755
index 9a73769..0000000
--- a/tests/shell/testcases/sets/cache_handling_0
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-tmpfile=$(mktemp)
-if [ ! -w $tmpfile ] ; then
-	echo "Failed to create tmp file" >&2
-	exit 0
-fi
-
-trap "rm -rf $tmpfile" EXIT # cleanup if aborted
-
-echo "
-table inet test {
-	set test {
-		type ipv4_addr
-		elements = { 1.1.1.1}
-	}
-
-	chain test {
-		ip saddr @test counter accept
-		ip daddr { 2.2.2.2} counter accept
-	}
-}" > $tmpfile
-
-set -e
-
-$NFT -f $tmpfile
-$NFT delete rule inet test test handle 2
-$NFT delete set inet test test
-$NFT -f $tmpfile


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [nft PATCH 3/3] tests: shell: add a new testcase for ruleset loading bug
  2016-11-03 12:04 [nft PATCH 1/3] tests: shell: delete useless stderr output in testcase Arturo Borrero Gonzalez
  2016-11-03 12:04 ` [nft PATCH 2/3] tests: shell: introduce the cache testcases directory Arturo Borrero Gonzalez
@ 2016-11-03 12:04 ` Arturo Borrero Gonzalez
  2016-11-08 23:22 ` [nft PATCH 1/3] tests: shell: delete useless stderr output in testcase Pablo Neira Ayuso
  2 siblings, 0 replies; 4+ messages in thread
From: Arturo Borrero Gonzalez @ 2016-11-03 12:04 UTC (permalink / raw)
  To: netfilter-devel

From: Arturo Borrero Gonzalez <arturo@debian.org>

There seems to be a bug that prevent loading a ruleset twice in a row
if the ruleset contains sets with intervals. This seems related to the
nft cache.

By the time of this commit, the bug is not fixed yet.

Signed-off-by: Arturo Borrero Gonzalez <arturo@debian.org>
---
 tests/shell/testcases/cache/0002_interval_0 |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100755 tests/shell/testcases/cache/0002_interval_0

diff --git a/tests/shell/testcases/cache/0002_interval_0 b/tests/shell/testcases/cache/0002_interval_0
new file mode 100755
index 0000000..f500911
--- /dev/null
+++ b/tests/shell/testcases/cache/0002_interval_0
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# This testcase checks that we can load a ruleset twice in a row.
+# bug --> Error: interval overlaps with an existing one
+
+set -e
+
+tmpfile=$(mktemp)
+if [ ! -w $tmpfile ] ; then
+        echo "Failed to create tmp file" >&2
+        exit 0
+fi
+
+trap "rm -rf $tmpfile" EXIT # cleanup if aborted
+
+RULESET="flush ruleset
+table inet t {
+	set s { type ipv4_addr; flags interval; }
+}
+
+add element inet t s {
+	192.168.0.1/24,
+}"
+
+echo "$RULESET" > $tmpfile
+$NFT -f $tmpfile
+$NFT -f $tmpfile


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [nft PATCH 1/3] tests: shell: delete useless stderr output in testcase
  2016-11-03 12:04 [nft PATCH 1/3] tests: shell: delete useless stderr output in testcase Arturo Borrero Gonzalez
  2016-11-03 12:04 ` [nft PATCH 2/3] tests: shell: introduce the cache testcases directory Arturo Borrero Gonzalez
  2016-11-03 12:04 ` [nft PATCH 3/3] tests: shell: add a new testcase for ruleset loading bug Arturo Borrero Gonzalez
@ 2016-11-08 23:22 ` Pablo Neira Ayuso
  2 siblings, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2016-11-08 23:22 UTC (permalink / raw)
  To: Arturo Borrero Gonzalez; +Cc: netfilter-devel

Series applied, thanks Arturo.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-08 23:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-03 12:04 [nft PATCH 1/3] tests: shell: delete useless stderr output in testcase Arturo Borrero Gonzalez
2016-11-03 12:04 ` [nft PATCH 2/3] tests: shell: introduce the cache testcases directory Arturo Borrero Gonzalez
2016-11-03 12:04 ` [nft PATCH 3/3] tests: shell: add a new testcase for ruleset loading bug Arturo Borrero Gonzalez
2016-11-08 23:22 ` [nft PATCH 1/3] tests: shell: delete useless stderr output in testcase 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).