btrfs-progs: tests: convert: add a test case to check the csum for the image file

The new test case would create an empty ext4 with 64K block size, which
can lead to a new data chunk which is no longer 1:1 mapped.

Then convert the fs and verify it with --check-data-csum to make sure
the image file is fine.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2023-05-09 08:43:15 +08:00 committed by David Sterba
parent 416507904c
commit 1ea7292354

View File

@ -0,0 +1,16 @@
#!/bin/bash
# Make sure the migrated range doesn't cause csum errors
source "$TEST_TOP/common" || exit
source "$TEST_TOP/common.convert" || exit
setup_root_helper
prepare_test_dev 10G
check_global_prereq mkfs.ext4
check_prereq btrfs-convert
check_prereq btrfs
run_check mkfs.ext4 -b 64K -F "$TEST_DEV"
run_check $SUDO_HELPER "$TOP/btrfs-convert" --nodesize 64K "$TEST_DEV"
run_check $SUDO_HELPER "$TOP/btrfs" check --check-data-csum "$TEST_DEV"