diff options
Diffstat (limited to 'tests/fsck-tests')
-rw-r--r-- | tests/fsck-tests/014-no-extent-info/.lowmem_repairable | 0 | ||||
-rw-r--r-- | tests/fsck-tests/014-no-extent-info/no_extent.raw.xz | bin | 0 -> 28084 bytes | |||
-rw-r--r-- | tests/fsck-tests/014-no-extent-info/no_extent_bad_dev.img (renamed from tests/fsck-tests/014-no-extent-info/default_case.img) | bin | 4096 -> 4096 bytes | |||
-rwxr-xr-x | tests/fsck-tests/031-metadatadump-check-data-csum/test.sh | 4 | ||||
-rw-r--r-- | tests/fsck-tests/032-corrupted-qgroup/qgroup_corrupted.img | bin | 0 -> 3072 bytes | |||
-rwxr-xr-x | tests/fsck-tests/032-corrupted-qgroup/test.sh | 19 | ||||
-rwxr-xr-x | tests/fsck-tests/033-lowmem-collission-dir-items/test.sh | 24 | ||||
-rw-r--r-- | tests/fsck-tests/034-bad-inode-flags/default_case.img | bin | 0 -> 4096 bytes | |||
-rwxr-xr-x | tests/fsck-tests/034-bad-inode-flags/test.sh | 15 |
9 files changed, 61 insertions, 1 deletions
diff --git a/tests/fsck-tests/014-no-extent-info/.lowmem_repairable b/tests/fsck-tests/014-no-extent-info/.lowmem_repairable new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/fsck-tests/014-no-extent-info/.lowmem_repairable diff --git a/tests/fsck-tests/014-no-extent-info/no_extent.raw.xz b/tests/fsck-tests/014-no-extent-info/no_extent.raw.xz Binary files differnew file mode 100644 index 00000000..6e568a9c --- /dev/null +++ b/tests/fsck-tests/014-no-extent-info/no_extent.raw.xz diff --git a/tests/fsck-tests/014-no-extent-info/default_case.img b/tests/fsck-tests/014-no-extent-info/no_extent_bad_dev.img Binary files differindex 1ff27434..1ff27434 100644 --- a/tests/fsck-tests/014-no-extent-info/default_case.img +++ b/tests/fsck-tests/014-no-extent-info/no_extent_bad_dev.img diff --git a/tests/fsck-tests/031-metadatadump-check-data-csum/test.sh b/tests/fsck-tests/031-metadatadump-check-data-csum/test.sh index 30b0b7a3..e9b2d5c6 100755 --- a/tests/fsck-tests/031-metadatadump-check-data-csum/test.sh +++ b/tests/fsck-tests/031-metadatadump-check-data-csum/test.sh @@ -16,6 +16,8 @@ run_check_mount_test_dev run_check $SUDO_HELPER dd if=/dev/urandom of="$TEST_MNT/file" bs=4k count=16 run_check_umount_test_dev +touch restored_image +chmod a+w restored_image run_check $SUDO_HELPER "$TOP/btrfs-image" "$TEST_DEV" "restored_image" # use prepare_test_dev() to wipe all existing data on $TEST_DEV @@ -27,4 +29,4 @@ run_check $SUDO_HELPER "$TOP/btrfs-image" -r "restored_image" "$TEST_DEV" # Should not report any error run_check "$TOP/btrfs" check --check-data-csum "$TEST_DEV" -rm -rf -- "restored_image*" +rm -rf -- "restored_image" diff --git a/tests/fsck-tests/032-corrupted-qgroup/qgroup_corrupted.img b/tests/fsck-tests/032-corrupted-qgroup/qgroup_corrupted.img Binary files differnew file mode 100644 index 00000000..a19a3035 --- /dev/null +++ b/tests/fsck-tests/032-corrupted-qgroup/qgroup_corrupted.img diff --git a/tests/fsck-tests/032-corrupted-qgroup/test.sh b/tests/fsck-tests/032-corrupted-qgroup/test.sh new file mode 100755 index 00000000..4bfa3601 --- /dev/null +++ b/tests/fsck-tests/032-corrupted-qgroup/test.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Check if btrfs check can handle valid orphan items. +# Orphan item is a marker for deleted inodes that were open at the time of +# deletion. Orphan inode/root is not referenced and will have an orphan +# item, which should not be reported as error. + +source "$TEST_TOP/common" + +check_prereq btrfs + +check_image() { + run_mustfail "btrfs check failed to detect qgroup corruption" \ + "$TOP/btrfs" check "$1" + # Above command can fail due to other bugs, so add extra check to + # ensure we can fix qgroup without problems. + run_check "$TOP/btrfs" check --repair "$1" +} + +check_all_images diff --git a/tests/fsck-tests/033-lowmem-collission-dir-items/test.sh b/tests/fsck-tests/033-lowmem-collission-dir-items/test.sh new file mode 100755 index 00000000..60f34b25 --- /dev/null +++ b/tests/fsck-tests/033-lowmem-collission-dir-items/test.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Ensure that running btrfs check on a fs which has name collisions of files +# doesn't result in false positives. This test is specifically targeted at +# lowmem mode. + +source "$TEST_TOP/common" + +check_prereq btrfs +check_prereq mkfs.btrfs + +setup_root_helper +prepare_test_dev + +run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$TEST_DEV" +run_check_mount_test_dev + +# Create 2 files whose names collide +run_check $SUDO_HELPER touch "$TEST_MNT/5ab4e206~~~~~~~~XVT1U3ZF647YS2PD4AKAG826" +run_check $SUDO_HELPER touch "$TEST_MNT/5ab4e26a~~~~~~~~AP1C3VQBE79IJOTVOEZIR9YU" + +run_check_umount_test_dev + +# The fs is clean so lowmem shouldn't produce any warnings +run_check "$TOP/btrfs" check --readonly "$TEST_DEV" diff --git a/tests/fsck-tests/034-bad-inode-flags/default_case.img b/tests/fsck-tests/034-bad-inode-flags/default_case.img Binary files differnew file mode 100644 index 00000000..43a2a6f6 --- /dev/null +++ b/tests/fsck-tests/034-bad-inode-flags/default_case.img diff --git a/tests/fsck-tests/034-bad-inode-flags/test.sh b/tests/fsck-tests/034-bad-inode-flags/test.sh new file mode 100755 index 00000000..4bdc2bf0 --- /dev/null +++ b/tests/fsck-tests/034-bad-inode-flags/test.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# In order to confirm that 'btrfs check' supports checking symlinks +# with immutable/append attributes that are not possible to set by standard +# syscall or ioctl so they're handled as corruption + +source "$TEST_TOP/common" + +check_prereq btrfs + +check_image() { + run_mustfail "check should report errors about inode flags" \ + $SUDO_HELPER "$TOP/btrfs" check "$1" +} + +check_all_images |