diff options
Diffstat (limited to 'iptables/tests/shell/testcases/ipt-save')
-rwxr-xr-x | iptables/tests/shell/testcases/ipt-save/0005iptables_0 | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/iptables/tests/shell/testcases/ipt-save/0005iptables_0 b/iptables/tests/shell/testcases/ipt-save/0005iptables_0 new file mode 100755 index 00000000..d5eb76a7 --- /dev/null +++ b/iptables/tests/shell/testcases/ipt-save/0005iptables_0 @@ -0,0 +1,30 @@ +#!/bin/bash + +set -e + +tmpfile1=$(mktemp) +tmpfile2=$(mktemp) + +clean_tmpfile() +{ + rm -f "$tmpfile1" "$tmpfile2" +} + +trap clean_tmpfile EXIT + + +cat > $tmpfile1<<EOF +-P INPUT ACCEPT +-P FORWARD ACCEPT +-P OUTPUT ACCEPT +-N FOO +-A FOO -j DROP +EOF + +$XT_MULTI iptables -N FOO +$XT_MULTI iptables -A FOO -j DROP +$XT_MULTI iptables -S > $tmpfile2 + +diff -u $tmpfile1 $tmpfile2 + +rm -f $tmpfile1 $tmpfile2 |