]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic/577: add missing file removal before empty file test
authorEric Biggers <ebiggers@google.com>
Fri, 4 Nov 2022 20:58:29 +0000 (13:58 -0700)
committerZorro Lang <zlang@kernel.org>
Sat, 5 Nov 2022 15:30:39 +0000 (23:30 +0800)
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>
Reviewed-by: Andrey Albershteyn <aalbersh@redhat.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/577

index 98c3888f84a67d9ca698afb80642b82e304c7722..5f7e0573f11dc74c99cbe17bfc594b77bee596be 100755 (executable)
@@ -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