netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft 1/3] tests/shell: fix preserving ruleset diff after test
@ 2023-09-18 19:59 Thomas Haller
  2023-09-18 19:59 ` [PATCH nft 2/3] tests/shell: simplify collecting error result in "test-wrapper.sh" Thomas Haller
  2023-09-18 19:59 ` [PATCH nft 3/3] tests/shell: run `nft --check` on persisted dump files Thomas Haller
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Haller @ 2023-09-18 19:59 UTC (permalink / raw)
  To: NetFilter; +Cc: Thomas Haller

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>
---
 tests/shell/helpers/test-wrapper.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/shell/helpers/test-wrapper.sh b/tests/shell/helpers/test-wrapper.sh
index cd8f480504ad..ad6a71031506 100755
--- a/tests/shell/helpers/test-wrapper.sh
+++ b/tests/shell/helpers/test-wrapper.sh
@@ -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
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-20 15:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-18 19:59 [PATCH nft 1/3] tests/shell: fix preserving ruleset diff after test Thomas Haller
2023-09-18 19:59 ` [PATCH nft 2/3] tests/shell: simplify collecting error result in "test-wrapper.sh" Thomas Haller
2023-09-18 19:59 ` [PATCH nft 3/3] tests/shell: run `nft --check` on persisted dump files Thomas Haller
2023-09-20 15:50   ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).