diff options
Diffstat (limited to 'iptables/tests/shell/testcases/nft-only/0007-mid-restore-flush_0')
-rwxr-xr-x | iptables/tests/shell/testcases/nft-only/0007-mid-restore-flush_0 | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/iptables/tests/shell/testcases/nft-only/0007-mid-restore-flush_0 b/iptables/tests/shell/testcases/nft-only/0007-mid-restore-flush_0 new file mode 100755 index 00000000..981f007f --- /dev/null +++ b/iptables/tests/shell/testcases/nft-only/0007-mid-restore-flush_0 @@ -0,0 +1,23 @@ +#!/bin/bash + +[[ $XT_MULTI == *xtables-nft-multi ]] || { echo "skip $XT_MULTI"; exit 0; } +nft -v >/dev/null || { echo "skip $XT_MULTI (no nft)"; exit 0; } + +coproc $XT_MULTI iptables-restore --noflush + +cat >&"${COPROC[1]}" <<EOF +*filter +:foo [0:0] +COMMIT +*filter +:foo [0:0] +EOF + +sleep 1 +$XT_MULTI iptables-save | grep -q ':foo' || exit 1 +nft flush ruleset + +echo "COMMIT" >&"${COPROC[1]}" +# close the pipe to make iptables-restore exit if it didn't error out yet +eval "exec ${COPROC[1]}>&-" +wait $COPROC_PID |