]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
tests: shell: Extend ipt-restore/0004-restore-race_0
authorPhil Sutter <phil@nwl.cc>
Tue, 21 Apr 2020 12:02:59 +0000 (14:02 +0200)
committerPhil Sutter <phil@nwl.cc>
Thu, 23 Apr 2020 10:54:44 +0000 (12:54 +0200)
Add a second table to dump/restore. This triggers failures after
reverting c550c81fd373e ("nft: cache: Fix nft_release_cache() under
stress"), hence acts as a reproducer for the bug fixed by that commit as
well.

Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/tests/shell/testcases/ipt-restore/0004-restore-race_0

index 9fc50615b89264dd7627b9ce61d76da41d59f732..a7fae41df0e7434a4a3cb3461e9248845ced3b88 100755 (executable)
@@ -45,8 +45,7 @@ get_target()
 
 make_dummy_rules()
 {
-
-       echo "*filter"
+       echo "*${1:-filter}"
        echo ":INPUT ACCEPT [0:0]"
        echo ":FORWARD ACCEPT [0:0]"
        echo ":OUTPUT ACCEPT [0:0]"
@@ -74,7 +73,7 @@ make_dummy_rules()
 tmpfile=$(mktemp) || exit 1
 dumpfile=$(mktemp) || exit 1
 
-make_dummy_rules > $dumpfile
+(make_dummy_rules; make_dummy_rules security) > $dumpfile
 $XT_MULTI iptables-restore -w < $dumpfile
 LINES1=$(wc -l < $dumpfile)
 $XT_MULTI iptables-save | grep -v '^#' > $dumpfile