]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests/shell: fix preserving ruleset diff after test
authorThomas Haller <thaller@redhat.com>
Mon, 18 Sep 2023 19:59:22 +0000 (21:59 +0200)
committerFlorian Westphal <fw@strlen.de>
Mon, 18 Sep 2023 20:05:49 +0000 (22:05 +0200)
We want to delete the file in the case when there was no diff (and we
expect the file to be empty). The condition was wrong.

Fixes: 55fe071cd193 ('tests/shell: cleanup result handling in "test-wrapper.sh"')
Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
tests/shell/helpers/test-wrapper.sh

index cd8f480504adf89ec46f804005f54dc28aa36074..ad6a7103150662d7af256ffb12bbaa8c1f044e3e 100755 (executable)
@@ -125,6 +125,7 @@ if [ "$rc_test" -ne 77 -a -f "$DUMPFILE" ] ; then
        if [ "$dump_written" != y ] ; then
                if ! $DIFF -u "$DUMPFILE" "$NFT_TEST_TESTTMPDIR/ruleset-after" &> "$NFT_TEST_TESTTMPDIR/ruleset-diff" ; then
                        rc_dump=124
+               else
                        rm -f "$NFT_TEST_TESTTMPDIR/ruleset-diff"
                fi
        fi