Skip to content

Commit

Permalink
btrfs-progs: tests: convert: add a test case to check the csum for th…
Browse files Browse the repository at this point in the history
…e 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 <[email protected]>
Signed-off-by: Qu Wenruo <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
adam900710 authored and kdave committed May 10, 2023
1 parent bbc164f commit 1628b2f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/convert-tests/023-64k-blocksize-migrated/test.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 1628b2f

Please sign in to comment.