mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
16f52cac08
This is a basic fs-verity test which verifies: - conditions for enabling verity - verity files have expected contents and size - can't change contents of verity files, but can change metadata - can retrieve a verity file's measurement via FS_IOC_MEASURE_VERITY Signed-off-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
75 lines
2.2 KiB
Plaintext
75 lines
2.2 KiB
Plaintext
QA output created by 572
|
|
|
|
# Enabling verity on file with verity already enabled fails with EEXIST
|
|
(trying again)
|
|
ERROR: FS_IOC_ENABLE_VERITY failed on 'SCRATCH_MNT/file.fsv': File exists
|
|
|
|
# Enabling verity with invalid hash algorithm fails with EINVAL
|
|
ERROR: FS_IOC_ENABLE_VERITY failed on 'SCRATCH_MNT/file.fsv': Invalid argument
|
|
|
|
# Enabling verity with invalid block size fails with EINVAL
|
|
ERROR: FS_IOC_ENABLE_VERITY failed on 'SCRATCH_MNT/file.fsv': Invalid argument
|
|
|
|
# Enabling verity on directory fails with EISDIR
|
|
ERROR: FS_IOC_ENABLE_VERITY failed on 'SCRATCH_MNT/dir': Is a directory
|
|
|
|
# Enabling verity with too-long salt fails with EMSGSIZE
|
|
ERROR: FS_IOC_ENABLE_VERITY failed on 'SCRATCH_MNT/file.fsv': Message too long
|
|
|
|
# Enabling verity on file on read-only filesystem fails with EROFS
|
|
ERROR: FS_IOC_ENABLE_VERITY failed on 'SCRATCH_MNT/file.fsv': Read-only file system
|
|
|
|
# Enabling verity on file open for writing fails with ETXTBSY
|
|
ERROR: FS_IOC_ENABLE_VERITY failed on 'SCRATCH_MNT/file.fsv': Text file busy
|
|
|
|
# Enabling verity can be interrupted
|
|
|
|
# Enabling verity on file with verity already being enabled fails with EBUSY
|
|
ERROR: FS_IOC_ENABLE_VERITY failed on 'SCRATCH_MNT/file.fsv': Device or resource busy
|
|
|
|
# verity file can't be opened for writing
|
|
* reading
|
|
* xfs_io writing, should be O_RDWR
|
|
SCRATCH_MNT/file.fsv: Operation not permitted
|
|
* bash >>, should be O_APPEND
|
|
bash: SCRATCH_MNT/file.fsv: Operation not permitted
|
|
* bash >, should be O_WRONLY|O_CREAT|O_TRUNC
|
|
bash: SCRATCH_MNT/file.fsv: Operation not permitted
|
|
|
|
# verity file can be read
|
|
|
|
# verity file can be measured
|
|
sha256:be54121da3877f8852c65136d731784f134c4dd9d95071502e80d7be9f99b263
|
|
|
|
# verity file can be renamed
|
|
|
|
# verity file can be unlinked
|
|
|
|
# verity file can be linked to
|
|
|
|
# verity file can be chmodded
|
|
|
|
# verity file can be chowned
|
|
|
|
# verity file has correct contents and size
|
|
100000
|
|
100000
|
|
|
|
# Trying to measure non-verity file fails with ENODATA
|
|
ERROR: FS_IOC_MEASURE_VERITY failed on 'SCRATCH_MNT/file.fsv': No data available
|
|
|
|
# verity on 1-byte file
|
|
Files matched
|
|
|
|
# verity on 4095-byte file
|
|
Files matched
|
|
|
|
# verity on 4096-byte file
|
|
Files matched
|
|
|
|
# verity on 100M file (multiple levels in hash tree)
|
|
Files matched
|
|
|
|
# verity on sparse file
|
|
Files matched
|