diff options
author | Eric Biggers <ebiggers@google.com> | 2019-05-28 16:12:30 -0700 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2019-05-30 17:08:08 -0400 |
commit | 0e660ee14592d2e893522f2ccc836c011ca4f383 (patch) | |
tree | 9746d66b14de5a454c7f57b9f173e555edd3a58f /tests | |
parent | 40aa2743b5cf97399b69f65b84907d22d00120e0 (diff) | |
download | e2fsprogs-0e660ee14592d2e893522f2ccc836c011ca4f383.tar.gz |
tests: add test for e2fsck of verity file
Test that e2fsck doesn't report errors when an inode with the 'verity'
flag has blocks past i_size.
This is a regression test for commits 3baafde6a8ae ("e2fsck: allow
verity files to have initialized blocks past i_size") and 43466d039689
("e2fsck: handle verity files in scan_extent_node()").
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/f_verity/expect.1 | 7 | ||||
-rw-r--r-- | tests/f_verity/image.gz | bin | 0 -> 2247 bytes | |||
-rwxr-xr-x | tests/f_verity/mkimage.sh | 28 | ||||
-rw-r--r-- | tests/f_verity/name | 1 | ||||
-rw-r--r-- | tests/f_verity/script | 2 |
5 files changed, 38 insertions, 0 deletions
diff --git a/tests/f_verity/expect.1 b/tests/f_verity/expect.1 new file mode 100644 index 00000000..07059677 --- /dev/null +++ b/tests/f_verity/expect.1 @@ -0,0 +1,7 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 12/128 files (8.3% non-contiguous), 58/128 blocks +Exit status is 0 diff --git a/tests/f_verity/image.gz b/tests/f_verity/image.gz Binary files differnew file mode 100644 index 00000000..72dfd816 --- /dev/null +++ b/tests/f_verity/image.gz diff --git a/tests/f_verity/mkimage.sh b/tests/f_verity/mkimage.sh new file mode 100755 index 00000000..565083e2 --- /dev/null +++ b/tests/f_verity/mkimage.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# This is the script that was used to create the image.gz in this directory. + +set -e -u + +mkdir -p mnt +umount mnt &> /dev/null || true + +dd if=/dev/zero of=image bs=4096 count=128 +mke2fs -O 'verity,extents' -b 4096 -N 128 image +mount image mnt + +# Create a verity file, but make it fragmented so that it needs at least one +# extent tree index node, in order to cover the scan_extent_node() case. +for i in {1..80}; do + head -c 4096 /dev/zero > mnt/tmp_$i +done +for i in {1..80..2}; do + rm mnt/tmp_$i +done +head -c $((40 * 4096)) /dev/zero > mnt/file +fsverity enable mnt/file +rm mnt/tmp_* + +umount mnt +rmdir mnt +gzip -9 -f image diff --git a/tests/f_verity/name b/tests/f_verity/name new file mode 100644 index 00000000..f43910fc --- /dev/null +++ b/tests/f_verity/name @@ -0,0 +1 @@ +verity file diff --git a/tests/f_verity/script b/tests/f_verity/script new file mode 100644 index 00000000..8ab2b9c6 --- /dev/null +++ b/tests/f_verity/script @@ -0,0 +1,2 @@ +ONE_PASS_ONLY="true" +. $cmd_dir/run_e2fsck |