diff options
author | Florian Westphal <fw@strlen.de> | 2018-06-29 19:14:18 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-07-02 17:10:14 +0200 |
commit | f15639bdac71dfe3534d274b14047d224088b15c (patch) | |
tree | 22809024e31b5985cca21aa876cccf69e0ca4691 /iptables/tests/shell/testcases/firewalld-restore/0002-firewalld-restart_0 | |
parent | 27f7db219eb9452fcf2a290a5713e81cd29e3f43 (diff) |
tests: add script that mimics firewalld startup
Mimic firewalld startup, i.e. "iptables-restore -n" use.
First script is normal startup,
second script restores ruleset, then re-runs first one (i.e., with
existing rules rather than non-existent tables).
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/tests/shell/testcases/firewalld-restore/0002-firewalld-restart_0')
-rwxr-xr-x | iptables/tests/shell/testcases/firewalld-restore/0002-firewalld-restart_0 | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/iptables/tests/shell/testcases/firewalld-restore/0002-firewalld-restart_0 b/iptables/tests/shell/testcases/firewalld-restore/0002-firewalld-restart_0 new file mode 100755 index 00000000..50e94924 --- /dev/null +++ b/iptables/tests/shell/testcases/firewalld-restore/0002-firewalld-restart_0 @@ -0,0 +1,17 @@ +#!/bin/sh + +# simulate restart after it went down, so first restore +# the complete ruleset + +$XT_MULTI iptables-restore < $(dirname "$0")/dumps/ipt-save-completed.txt + +# add dummy rules to see if they get cleared or not. +for table in raw mangle nat filter;do + $XT_MULTI iptables -t $table -N FOO$table || exit 1 + $XT_MULTI iptables -t $table -A OUTPUT -m comment --comment '"dummy rule in table $table OUTPUT"' || exit 1 + $XT_MULTI iptables -t $table -A FOO$table -m comment --comment '"dummy rule in table $table FOO$table"' || exit 1 +done + +# then run the other test script so it finds already-existing ruleset. + +exec $(dirname "$0")/0001-firewalld_0 |