]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
tests: fix some tests for systems with fs.verity.require_signatures=1
authorEric Biggers <ebiggers@google.com>
Fri, 4 Nov 2022 20:58:30 +0000 (13:58 -0700)
committerZorro Lang <zlang@kernel.org>
Sat, 5 Nov 2022 15:30:39 +0000 (23:30 +0800)
Some of the newer verity tests don't work properly on systems where
fs.verity.require_signatures is enabled, either because they forget to
disable it at the beginning of the test, or they forget to re-enable it
afterwards, or both.  Fix this.

Reviewed-by: Andrey Albershteyn <aalbersh@redhat.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/btrfs/290
tests/btrfs/291
tests/generic/624
tests/generic/692

index b7254c5ee46ac70bc809485a3d66c4359dc31da8..06a58f47336561af969bc11178ab42643d44b412 100755 (executable)
@@ -15,6 +15,14 @@ _begin_fstest auto quick verity
 . ./common/filter
 . ./common/verity
 
+# Override the default cleanup function.
+_cleanup()
+{
+       cd /
+       _restore_fsverity_signatures
+       rm -f $tmp.*
+}
+
 # real QA test starts here
 _supported_fs btrfs
 _require_scratch_verity
@@ -24,6 +32,7 @@ _require_xfs_io_command "falloc"
 _require_xfs_io_command "pread"
 _require_xfs_io_command "pwrite"
 _require_btrfs_corrupt_block
+_disable_fsverity_signatures
 
 get_ino() {
        local file=$1
index bbdd183d41ec88844eb0f9677875fb668980c173..c594713323994055709eccddc94817d20c9566c4 100755 (executable)
@@ -23,6 +23,7 @@ _cleanup()
        rm -f $img
        $LVM_PROG vgremove -f -y $vgname >>$seqres.full 2>&1
        losetup -d $loop_dev >>$seqres.full 2>&1
+       _restore_fsverity_signatures
 }
 
 # Import common functions.
@@ -43,6 +44,7 @@ _require_command $LVM_PROG lvm
 _require_scratch_verity
 _require_btrfs_command inspect-internal dump-tree
 _require_test_program "log-writes/replay-log"
+_disable_fsverity_signatures
 
 sync_loop() {
        i=$1
index 89fbf256570f8dc095a84462994647572ed0ac3c..7c447289dc0e4cfbc4a08151a0ededeb35b1bfe1 100755 (executable)
 . ./common/preamble
 _begin_fstest auto quick verity
 
+# Override the default cleanup function.
+_cleanup()
+{
+       cd /
+       _restore_fsverity_signatures
+       rm -f $tmp.*
+}
+
 . ./common/filter
 . ./common/verity
 
index 0bb1fd33bc2cfa843f8a6aa5eb641f653ab4d2db..d6da734b5e4f992bbf7d2b060972a182c6ad4e0e 100644 (file)
 . ./common/preamble
 _begin_fstest auto quick verity
 
+# Override the default cleanup function.
+_cleanup()
+{
+       cd /
+       _restore_fsverity_signatures
+       rm -f $tmp.*
+}
 
 # Import common functions.
 . ./common/filter
@@ -26,6 +33,7 @@ _require_test
 _require_math
 _require_scratch_verity
 _require_fsverity_max_file_size_limit
+_disable_fsverity_signatures
 
 _scratch_mkfs_verity &>> $seqres.full
 _scratch_mount