mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-26 16:12:34 +00:00
3e7cc11ecb
Executing the script inside the directories as './test.sh' is not
supposed to work but could happen accidentally. With an exit after
attempting to source the we can fix that. Not all cases have been fixed
in f6bbe06c08
("btrfs-progs: tests: add protection against running
out of test suite").
Signed-off-by: David Sterba <dsterba@suse.com>
26 lines
653 B
Bash
Executable File
26 lines
653 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# An image with mis-aligned superblock total_bytes, that will be found and
|
|
# fixed by 'check' or fixed by 'rescue fix-device-size'
|
|
|
|
source "$TEST_TOP/common" || exit
|
|
|
|
check_prereq btrfs
|
|
setup_root_helper
|
|
|
|
check_all_images
|
|
|
|
TEST_DEV=$(extract_image "./dev_and_super_mismatch_unaligned.raw.xz")
|
|
|
|
# detect and fix
|
|
run_check "$TOP/btrfs" rescue fix-device-size "$TEST_DEV"
|
|
# no problem found
|
|
run_check "$TOP/btrfs" rescue fix-device-size "$TEST_DEV"
|
|
# check if fix-device-size worked
|
|
run_check "$TOP/btrfs" check "$TEST_DEV"
|
|
# mount test
|
|
run_check_mount_test_dev
|
|
run_check_umount_test_dev "$TEST_MNT"
|
|
# remove restored image
|
|
rm -- "$TEST_DEV"
|