summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/nft-i
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shell/testcases/nft-i')
-rw-r--r--tests/shell/testcases/nft-i/dumps/0001define_0.json-nft11
-rw-r--r--tests/shell/testcases/nft-i/dumps/0001define_0.nft0
-rw-r--r--tests/shell/testcases/nft-i/dumps/index_0.nft8
-rw-r--r--tests/shell/testcases/nft-i/dumps/set_0.nft7
-rwxr-xr-xtests/shell/testcases/nft-i/index_011
-rwxr-xr-xtests/shell/testcases/nft-i/set_09
6 files changed, 46 insertions, 0 deletions
diff --git a/tests/shell/testcases/nft-i/dumps/0001define_0.json-nft b/tests/shell/testcases/nft-i/dumps/0001define_0.json-nft
new file mode 100644
index 00000000..546cc597
--- /dev/null
+++ b/tests/shell/testcases/nft-i/dumps/0001define_0.json-nft
@@ -0,0 +1,11 @@
+{
+ "nftables": [
+ {
+ "metainfo": {
+ "version": "VERSION",
+ "release_name": "RELEASE_NAME",
+ "json_schema_version": 1
+ }
+ }
+ ]
+}
diff --git a/tests/shell/testcases/nft-i/dumps/0001define_0.nft b/tests/shell/testcases/nft-i/dumps/0001define_0.nft
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/shell/testcases/nft-i/dumps/0001define_0.nft
diff --git a/tests/shell/testcases/nft-i/dumps/index_0.nft b/tests/shell/testcases/nft-i/dumps/index_0.nft
new file mode 100644
index 00000000..abcd1b7c
--- /dev/null
+++ b/tests/shell/testcases/nft-i/dumps/index_0.nft
@@ -0,0 +1,8 @@
+table inet foo {
+ chain bar {
+ type filter hook input priority filter; policy accept;
+ accept
+ accept
+ accept
+ }
+}
diff --git a/tests/shell/testcases/nft-i/dumps/set_0.nft b/tests/shell/testcases/nft-i/dumps/set_0.nft
new file mode 100644
index 00000000..d3377d63
--- /dev/null
+++ b/tests/shell/testcases/nft-i/dumps/set_0.nft
@@ -0,0 +1,7 @@
+table inet foo {
+ set bar {
+ type ipv4_addr
+ flags interval
+ elements = { 10.1.1.1, 10.1.1.2 }
+ }
+}
diff --git a/tests/shell/testcases/nft-i/index_0 b/tests/shell/testcases/nft-i/index_0
new file mode 100755
index 00000000..f885fdeb
--- /dev/null
+++ b/tests/shell/testcases/nft-i/index_0
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -e
+
+RULESET="add table inet foo
+add chain inet foo bar { type filter hook input priority filter; }
+add rule inet foo bar accept
+insert rule inet foo bar index 0 accept
+add rule inet foo bar index 0 accept"
+
+$NFT -i <<< "$RULESET"
diff --git a/tests/shell/testcases/nft-i/set_0 b/tests/shell/testcases/nft-i/set_0
new file mode 100755
index 00000000..e87eef1d
--- /dev/null
+++ b/tests/shell/testcases/nft-i/set_0
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+set -e
+
+RULESET="add table inet foo
+add set inet foo bar { type ipv4_addr; flags interval; }; add element inet foo bar { 10.1.1.1/32 }
+add element inet foo bar { 10.1.1.2/32 }"
+
+$NFT -i <<< "$RULESET"