]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
tests: shell: Drop any dump sorting in place
authorPhil Sutter <phil@nwl.cc>
Mon, 6 Jul 2020 16:40:16 +0000 (18:40 +0200)
committerPhil Sutter <phil@nwl.cc>
Mon, 21 Dec 2020 17:33:21 +0000 (18:33 +0100)
With iptables-nft-save output now sorted just like legacy one, no
sorting to unify them is needed anymore.

Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/tests/shell/testcases/firewalld-restore/0001-firewalld_0
iptables/tests/shell/testcases/ipt-restore/0007-flush-noflush_0
iptables/tests/shell/testcases/ipt-restore/0014-verbose-restore_0

index 0174b03f4ebc76324a7099e2cfe3e0f3401b603c..4900554e7d9e6810b89acf5d16a1f2fd839c09a8 100755 (executable)
@@ -230,21 +230,8 @@ for table in nat mangle raw filter;do
        $XT_MULTI iptables-save -t $table | grep -v '^#' >> "$tmpfile"
 done
 
-case "$XT_MULTI" in
-*xtables-nft-multi)
-       # nft-multi displays chain names in different order, work around this for now
-       tmpfile2=$(mktemp)
-       sort "$tmpfile" > "$tmpfile2"
-       sort $(dirname "$0")/dumps/ipt-save-completed.txt > "$tmpfile"
-       diff -u $tmpfile $tmpfile2
-       RET=$?
-       rm -f "$tmpfile2"
-       ;;
-*)
-       diff -u $tmpfile  $(dirname "$0")/dumps/ipt-save-completed.txt
-       RET=$?
-       ;;
-esac
+diff -u $tmpfile  $(dirname "$0")/dumps/ipt-save-completed.txt
+RET=$?
 
 rm -f "$tmpfile"
 
index 029db2235b9a49b3d1c3cdfdf3b7dd61c18210db..e705b28c873594f35eebfb0186a3b762f0a30de6 100755 (executable)
@@ -18,7 +18,7 @@ EXPECT="*nat
 :POSTROUTING ACCEPT [0:0]
 -A POSTROUTING -j ACCEPT
 COMMIT"
-diff -u -Z <(echo -e "$EXPECT" | sort) <($XT_MULTI iptables-save | grep -v '^#' | sort)
+diff -u -Z <(echo -e "$EXPECT") <($XT_MULTI iptables-save | grep -v '^#')
 
 $XT_MULTI iptables-restore <<EOF
 *filter
@@ -39,4 +39,4 @@ COMMIT
 :POSTROUTING ACCEPT [0:0]
 -A POSTROUTING -j ACCEPT
 COMMIT"
-diff -u -Z <(echo -e "$EXPECT" | sort) <($XT_MULTI iptables-save | grep -v '^#' | sort)
+diff -u -Z <(echo -e "$EXPECT") <($XT_MULTI iptables-save | grep -v '^#')
index 94bed0ec29c6bcd914c3ade0673af1b83cf963da..fc8559c5bac9efd77223b3b247afbcb1ac2b1135 100755 (executable)
@@ -59,7 +59,7 @@ Flushing chain \`secfoo'
 Deleting chain \`secfoo'"
 
 for ipt in iptables-restore ip6tables-restore; do
-       diff -u -Z <(sort <<< "$EXPECT") <($XT_MULTI $ipt -v <<< "$DUMP" | sort)
+       diff -u -Z <(echo "$EXPECT") <($XT_MULTI $ipt -v <<< "$DUMP")
 done
 
 DUMP="*filter