summaryrefslogtreecommitdiffstats
path: root/iptables/tests/shell/testcases/ipt-restore/0002-parameters_0
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-09-05 19:14:40 +0200
committerFlorian Westphal <fw@strlen.de>2018-09-10 15:27:33 +0200
commit9242b5d9341434a5ae1491f64802df6926340d20 (patch)
treeffb72e9ed4e4d6a3d9f2380721f5202eb13fde7f /iptables/tests/shell/testcases/ipt-restore/0002-parameters_0
parentc9f4f04bafe36927d2bca7ecf717723e0d7410d7 (diff)
xtables: Accept --wait in iptables-nft-restore
Passing --wait option to iptables-nft-restore led to program abort because the flag parameter was not skipped. Mimick iptables-restore behaviour when encountering --wait or --wait-interval options (but still ignore the parameter). Fixes: b9d7b49d84bc2 ("xtables-compat: restore: sync options with iptables-restore") Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/tests/shell/testcases/ipt-restore/0002-parameters_0')
-rwxr-xr-xiptables/tests/shell/testcases/ipt-restore/0002-parameters_021
1 files changed, 21 insertions, 0 deletions
diff --git a/iptables/tests/shell/testcases/ipt-restore/0002-parameters_0 b/iptables/tests/shell/testcases/ipt-restore/0002-parameters_0
new file mode 100755
index 00000000..5c8748ec
--- /dev/null
+++ b/iptables/tests/shell/testcases/ipt-restore/0002-parameters_0
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+# make sure wait and wait-interval options are accepted
+
+clean_tempfile()
+{
+ if [ -n "${tmpfile}" ]; then
+ rm -f "${tmpfile}"
+ fi
+}
+
+trap clean_tempfile EXIT
+
+tmpfile=$(mktemp) || exit 1
+
+$XT_MULTI iptables-save -f $tmpfile
+$XT_MULTI iptables-restore $tmpfile
+$XT_MULTI iptables-restore -w 5 $tmpfile
+$XT_MULTI iptables-restore -w 5 -W 1 $tmpfile