btrfs-progs: convert-tests: Add test for backup superblock migration
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Wed, 1 Jun 2016 01:51:21 +0000 (09:51 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 1 Jun 2016 13:37:23 +0000 (15:37 +0200)
New convert framework uses new and simpler chunk layout, while the cost
is the more complex superblock range migration logical, compared to old
convert.

Enhance the convert test script to create file which will takes up 2nd
backup superblock space, to ensure the superblock migration is working
as expected.

Suggested-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
tests/convert-tests.sh

index 9428517..94477b4 100755 (executable)
@@ -124,6 +124,12 @@ convert_test() {
        # create a file to check btrfs-convert can convert regular file
        # correct
        run_check_mount_test_dev
+
+       # create a file inside the fs before convert, to make sure there is
+       # data covering btrfs backup superblock range (64M)
+       run_check $SUDO_HELPER dd if=/dev/zero bs=1M count=64 \
+               of=$TEST_MNT/convert_space_holder
+
        populate_fs
        run_check $SUDO_HELPER dd if=/dev/zero of=$TEST_MNT/test bs=$nodesize \
                count=1 >/dev/null 2>&1