summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/maps
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2023-08-01 13:35:27 +0200
committerPhil Sutter <phil@nwl.cc>2023-08-03 14:58:20 +0200
commitf6cc747991758801e4c3eb25bb06840870963cc2 (patch)
tree2ae998c68d919ad65c72d7d43bc85586671929d6 /tests/shell/testcases/maps
parent28d202216535ac54216f825e511a92d9acea5d3c (diff)
tests: shell: Review test-cases for destroy command
Having separate files for successful destroy of existing and non-existing objects is a bit too much, just combine them into one. While being at it: * No bashisms, using /bin/sh is fine * Append '-e' to shebang itself instead of calling 'set' * Use 'nft -a -e' instead of assuming the created rule's handle value * Shellcheck warned about curly braces, quote them Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'tests/shell/testcases/maps')
-rwxr-xr-xtests/shell/testcases/maps/0014destroy_010
-rwxr-xr-xtests/shell/testcases/maps/0015destroy_07
-rw-r--r--tests/shell/testcases/maps/dumps/0015destroy_0.nft2
3 files changed, 6 insertions, 13 deletions
diff --git a/tests/shell/testcases/maps/0014destroy_0 b/tests/shell/testcases/maps/0014destroy_0
index b769276d..14c3f78a 100755
--- a/tests/shell/testcases/maps/0014destroy_0
+++ b/tests/shell/testcases/maps/0014destroy_0
@@ -1,8 +1,10 @@
-#!/bin/bash
-
-set -e
+#!/bin/sh -e
$NFT add table x
-$NFT add map x y { type ipv4_addr : ipv4_addr\; }
+# pass for non-existent map
+$NFT destroy map x y
+
+# successfully delete existing map
+$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
deleted file mode 100755
index abad4d57..00000000
--- a/tests/shell/testcases/maps/0015destroy_0
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-set -e
-
-$NFT add table x
-
-$NFT destroy map x nonmap
diff --git a/tests/shell/testcases/maps/dumps/0015destroy_0.nft b/tests/shell/testcases/maps/dumps/0015destroy_0.nft
deleted file mode 100644
index 5d4d2caf..00000000
--- a/tests/shell/testcases/maps/dumps/0015destroy_0.nft
+++ /dev/null
@@ -1,2 +0,0 @@
-table ip x {
-}