3928f548c3f9a5c5af54b1c198956433a5ba5a63
[platform/upstream/btrfs-progs.git] / tests / fsck-tests / 028-unaligned-super-dev-sizes / test.sh
1 #!/bin/bash
2 #
3 # An image with mis-aligned superblock total_bytes, that will be found and
4 # fixed by 'check' or fixed by 'rescue fix-device-size'
5
6 source "$TOP/tests/common"
7
8 check_prereq btrfs
9 setup_root_helper
10
11 check_all_images
12
13 TEST_DEV=$(extract_image "./dev_and_super_mismatch_unaligned.raw.xz")
14
15 # detect and fix
16 run_check "$TOP/btrfs" rescue fix-device-size "$TEST_DEV"
17 # no problem found
18 run_check "$TOP/btrfs" rescue fix-device-size "$TEST_DEV"
19 # check if fix-device-size worked
20 run_check "$TOP/btrfs" check "$TEST_DEV"
21 # mount test
22 run_check_mount_test_dev
23 run_check_umount_test_dev "$TEST_MNT"