diff mbox series

[xfstests,2/3] generic/577: add missing file removal before empty file test

Message ID 20221104064742.167326-3-ebiggers@kernel.org (mailing list archive)
State Superseded
Headers show
Series Fix test bugs related to fs.verity.require_signatures | expand

Commit Message

Eric Biggers Nov. 4, 2022, 6:47 a.m. UTC
From: Eric Biggers <ebiggers@google.com>

The fix for _fsv_have_hash_algorithm() exposed a bug where one of the
test cases in generic/577 isn't deleting the file from the previous test
case before it tries to write to it.  That causes a failure, since due
to the fix for _fsv_have_hash_algorithm(), the file from the previous
test case now ends up with verity enabled and therefore cannot be
written to.  Fix this by deleting the file.

Reported-by: Andrey Albershteyn <aalbersh@redhat.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 tests/generic/577 | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/tests/generic/577 b/tests/generic/577
index 98c3888f..5f7e0573 100755
--- a/tests/generic/577
+++ b/tests/generic/577
@@ -121,6 +121,7 @@  if _fsv_have_hash_algorithm sha512 $fsv_file; then
 fi
 
 echo -e "\n# Testing empty file"
+rm -f $fsv_file
 echo -n > $fsv_file
 _fsv_sign $fsv_file $sigfile.emptyfile --key=$keyfile --cert=$certfile | \
 		_filter_scratch