Skip to content

Commit

Permalink
test-units: Don't fail fsverity test if /dev/loop-control is missing
Browse files Browse the repository at this point in the history
This fixes containers#324

Signed-off-by: Alexander Larsson <[email protected]>
  • Loading branch information
alexlarsson committed Aug 28, 2024
1 parent 63c0b34 commit 9880367
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test-units.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ function test_mount_digest () {

local DIGEST=$(fsverity measure $dir/test.cfs | awk "{ print \$1 }" | sed s/sha256://)

$BINDIR/mount.composefs -o basedir=$dir/objects,digest=$DIGEST $dir/test.cfs $dir/mnt 2> $dir/stderr || assert_file_has_content $dir/stderr "Permission denied"
# We should either successfully mount, or start trying and fail for one of these reasons:
# * Permission denied, if not root
# * No such file or directory, if /dev/loop-control is missing
# What should not happen is that it should fail for fs-verity reasons before trying to mount.
$BINDIR/mount.composefs -o basedir=$dir/objects,digest=$DIGEST $dir/test.cfs $dir/mnt 2> $dir/stderr || assert_file_has_content $dir/stderr "Permission denied\|No such file or directory"
umount $dir/mnt 2> $dir/stderr || true
fi
}
Expand Down

0 comments on commit 9880367

Please sign in to comment.