[PATCH nft] tests: extend tests for destroy command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Extend tests to cover destroy command for chains, flowtables, sets,
maps. In addition rename a destroy command test for rules with a
duplicated number.

Signed-off-by: Fernando Fernandez Mancera <ffmancera@xxxxxxxxxx>
---
 tests/shell/testcases/chains/0044chain_destroy_0          | 7 +++++++
 tests/shell/testcases/chains/0045chain_destroy_0          | 8 ++++++++
 .../shell/testcases/chains/dumps/0044chain_destroy_0.nft  | 2 ++
 .../shell/testcases/chains/dumps/0045chain_destroy_0.nft  | 2 ++
 tests/shell/testcases/flowtable/0015destroy_0             | 7 +++++++
 tests/shell/testcases/flowtable/0016destroy_0             | 6 ++++++
 tests/shell/testcases/flowtable/dumps/0015destroy_0.nft   | 2 ++
 tests/shell/testcases/flowtable/dumps/0016destroy_0.nft   | 2 ++
 tests/shell/testcases/maps/0014destroy_0                  | 8 ++++++++
 tests/shell/testcases/maps/0015destroy_0                  | 7 +++++++
 tests/shell/testcases/maps/dumps/0014destroy_0.nft        | 2 ++
 tests/shell/testcases/maps/dumps/0015destroy_0.nft        | 2 ++
 .../rule_management/{0011destroy_0 => 0013destroy_0}      | 0
 .../dumps/{0011destroy_0.nft => 0013destroy_0}            | 0
 tests/shell/testcases/sets/0072destroy_0                  | 8 ++++++++
 tests/shell/testcases/sets/0073destroy_0                  | 7 +++++++
 tests/shell/testcases/sets/dumps/0072destroy_0.nft        | 2 ++
 tests/shell/testcases/sets/dumps/0073destroy_0.nft        | 2 ++
 18 files changed, 74 insertions(+)
 create mode 100755 tests/shell/testcases/chains/0044chain_destroy_0
 create mode 100755 tests/shell/testcases/chains/0045chain_destroy_0
 create mode 100644 tests/shell/testcases/chains/dumps/0044chain_destroy_0.nft
 create mode 100644 tests/shell/testcases/chains/dumps/0045chain_destroy_0.nft
 create mode 100755 tests/shell/testcases/flowtable/0015destroy_0
 create mode 100755 tests/shell/testcases/flowtable/0016destroy_0
 create mode 100644 tests/shell/testcases/flowtable/dumps/0015destroy_0.nft
 create mode 100644 tests/shell/testcases/flowtable/dumps/0016destroy_0.nft
 create mode 100755 tests/shell/testcases/maps/0014destroy_0
 create mode 100755 tests/shell/testcases/maps/0015destroy_0
 create mode 100644 tests/shell/testcases/maps/dumps/0014destroy_0.nft
 create mode 100644 tests/shell/testcases/maps/dumps/0015destroy_0.nft
 rename tests/shell/testcases/rule_management/{0011destroy_0 => 0013destroy_0} (100%)
 rename tests/shell/testcases/rule_management/dumps/{0011destroy_0.nft => 0013destroy_0} (100%)
 create mode 100755 tests/shell/testcases/sets/0072destroy_0
 create mode 100755 tests/shell/testcases/sets/0073destroy_0
 create mode 100644 tests/shell/testcases/sets/dumps/0072destroy_0.nft
 create mode 100644 tests/shell/testcases/sets/dumps/0073destroy_0.nft

diff --git a/tests/shell/testcases/chains/0044chain_destroy_0 b/tests/shell/testcases/chains/0044chain_destroy_0
new file mode 100755
index 00000000..070021cf
--- /dev/null
+++ b/tests/shell/testcases/chains/0044chain_destroy_0
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+set -e
+
+$NFT add table t
+
+$NFT destroy chain t nochain
diff --git a/tests/shell/testcases/chains/0045chain_destroy_0 b/tests/shell/testcases/chains/0045chain_destroy_0
new file mode 100755
index 00000000..b356f8f8
--- /dev/null
+++ b/tests/shell/testcases/chains/0045chain_destroy_0
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+set -e
+
+$NFT add table t
+$NFT add chain t c
+
+$NFT destroy chain t c
diff --git a/tests/shell/testcases/chains/dumps/0044chain_destroy_0.nft b/tests/shell/testcases/chains/dumps/0044chain_destroy_0.nft
new file mode 100644
index 00000000..985768ba
--- /dev/null
+++ b/tests/shell/testcases/chains/dumps/0044chain_destroy_0.nft
@@ -0,0 +1,2 @@
+table ip t {
+}
diff --git a/tests/shell/testcases/chains/dumps/0045chain_destroy_0.nft b/tests/shell/testcases/chains/dumps/0045chain_destroy_0.nft
new file mode 100644
index 00000000..985768ba
--- /dev/null
+++ b/tests/shell/testcases/chains/dumps/0045chain_destroy_0.nft
@@ -0,0 +1,2 @@
+table ip t {
+}
diff --git a/tests/shell/testcases/flowtable/0015destroy_0 b/tests/shell/testcases/flowtable/0015destroy_0
new file mode 100755
index 00000000..4828d818
--- /dev/null
+++ b/tests/shell/testcases/flowtable/0015destroy_0
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+set -e
+$NFT add table t
+$NFT add flowtable t f { hook ingress priority 10 \; devices = { lo }\; }
+
+$NFT destroy flowtable t f
diff --git a/tests/shell/testcases/flowtable/0016destroy_0 b/tests/shell/testcases/flowtable/0016destroy_0
new file mode 100755
index 00000000..ce23c753
--- /dev/null
+++ b/tests/shell/testcases/flowtable/0016destroy_0
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+set -e
+$NFT add table t
+
+$NFT destroy flowtable t f
diff --git a/tests/shell/testcases/flowtable/dumps/0015destroy_0.nft b/tests/shell/testcases/flowtable/dumps/0015destroy_0.nft
new file mode 100644
index 00000000..985768ba
--- /dev/null
+++ b/tests/shell/testcases/flowtable/dumps/0015destroy_0.nft
@@ -0,0 +1,2 @@
+table ip t {
+}
diff --git a/tests/shell/testcases/flowtable/dumps/0016destroy_0.nft b/tests/shell/testcases/flowtable/dumps/0016destroy_0.nft
new file mode 100644
index 00000000..985768ba
--- /dev/null
+++ b/tests/shell/testcases/flowtable/dumps/0016destroy_0.nft
@@ -0,0 +1,2 @@
+table ip t {
+}
diff --git a/tests/shell/testcases/maps/0014destroy_0 b/tests/shell/testcases/maps/0014destroy_0
new file mode 100755
index 00000000..b769276d
--- /dev/null
+++ b/tests/shell/testcases/maps/0014destroy_0
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+set -e
+
+$NFT add table x
+$NFT add map x y { type ipv4_addr : ipv4_addr\; }
+
+$NFT destroy map x y
diff --git a/tests/shell/testcases/maps/0015destroy_0 b/tests/shell/testcases/maps/0015destroy_0
new file mode 100755
index 00000000..abad4d57
--- /dev/null
+++ b/tests/shell/testcases/maps/0015destroy_0
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+set -e
+
+$NFT add table x
+
+$NFT destroy map x nonmap
diff --git a/tests/shell/testcases/maps/dumps/0014destroy_0.nft b/tests/shell/testcases/maps/dumps/0014destroy_0.nft
new file mode 100644
index 00000000..5d4d2caf
--- /dev/null
+++ b/tests/shell/testcases/maps/dumps/0014destroy_0.nft
@@ -0,0 +1,2 @@
+table ip x {
+}
diff --git a/tests/shell/testcases/maps/dumps/0015destroy_0.nft b/tests/shell/testcases/maps/dumps/0015destroy_0.nft
new file mode 100644
index 00000000..5d4d2caf
--- /dev/null
+++ b/tests/shell/testcases/maps/dumps/0015destroy_0.nft
@@ -0,0 +1,2 @@
+table ip x {
+}
diff --git a/tests/shell/testcases/rule_management/0011destroy_0 b/tests/shell/testcases/rule_management/0013destroy_0
similarity index 100%
rename from tests/shell/testcases/rule_management/0011destroy_0
rename to tests/shell/testcases/rule_management/0013destroy_0
diff --git a/tests/shell/testcases/rule_management/dumps/0011destroy_0.nft b/tests/shell/testcases/rule_management/dumps/0013destroy_0
similarity index 100%
rename from tests/shell/testcases/rule_management/dumps/0011destroy_0.nft
rename to tests/shell/testcases/rule_management/dumps/0013destroy_0
diff --git a/tests/shell/testcases/sets/0072destroy_0 b/tests/shell/testcases/sets/0072destroy_0
new file mode 100755
index 00000000..c9cf9ff7
--- /dev/null
+++ b/tests/shell/testcases/sets/0072destroy_0
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+set -e
+
+$NFT add table x
+$NFT add set x s {type ipv4_addr\; size 2\;}
+
+$NFT destroy set x s
diff --git a/tests/shell/testcases/sets/0073destroy_0 b/tests/shell/testcases/sets/0073destroy_0
new file mode 100755
index 00000000..a9d65a55
--- /dev/null
+++ b/tests/shell/testcases/sets/0073destroy_0
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+set -e
+
+$NFT add table x
+
+$NFT destroy set x s
diff --git a/tests/shell/testcases/sets/dumps/0072destroy_0.nft b/tests/shell/testcases/sets/dumps/0072destroy_0.nft
new file mode 100644
index 00000000..5d4d2caf
--- /dev/null
+++ b/tests/shell/testcases/sets/dumps/0072destroy_0.nft
@@ -0,0 +1,2 @@
+table ip x {
+}
diff --git a/tests/shell/testcases/sets/dumps/0073destroy_0.nft b/tests/shell/testcases/sets/dumps/0073destroy_0.nft
new file mode 100644
index 00000000..5d4d2caf
--- /dev/null
+++ b/tests/shell/testcases/sets/dumps/0073destroy_0.nft
@@ -0,0 +1,2 @@
+table ip x {
+}
-- 
2.30.2




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux