From f6cc747991758801e4c3eb25bb06840870963cc2 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 1 Aug 2023 13:35:27 +0200 Subject: 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 --- tests/shell/testcases/chains/0044chain_destroy_0 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tests/shell/testcases/chains/0044chain_destroy_0') diff --git a/tests/shell/testcases/chains/0044chain_destroy_0 b/tests/shell/testcases/chains/0044chain_destroy_0 index 070021cf..8384da66 100755 --- a/tests/shell/testcases/chains/0044chain_destroy_0 +++ b/tests/shell/testcases/chains/0044chain_destroy_0 @@ -1,7 +1,10 @@ -#!/bin/bash - -set -e +#!/bin/sh -e $NFT add table t -$NFT destroy chain t nochain +# pass for non-existent chain +$NFT destroy chain t c + +# successfully delete existing chain +$NFT add chain t c +$NFT destroy chain t c -- cgit v1.2.3