diff mbox series

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

Message ID 624194cbbce1d068e1e2a409e5d5497eea366875.1683592875.git.wqu@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: convert: fix csum generation for migrated ranges | expand

Commit Message

Qu Wenruo May 9, 2023, 12:43 a.m. UTC
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.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 .../023-64k-blocksize-migrated/test.sh           | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100755 tests/convert-tests/023-64k-blocksize-migrated/test.sh

Comments

Anand Jain May 9, 2023, 1:48 a.m. UTC | #1
LGTM

Reviewed-by: Anand Jain <anand.jain@oracle.com>
diff mbox series

Patch

diff --git a/tests/convert-tests/023-64k-blocksize-migrated/test.sh b/tests/convert-tests/023-64k-blocksize-migrated/test.sh
new file mode 100755
index 000000000000..99808a74314c
--- /dev/null
+++ b/tests/convert-tests/023-64k-blocksize-migrated/test.sh
@@ -0,0 +1,16 @@ 
+#!/bin/sh
+# 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" -N 64K "$TEST_DEV"
+run_check $SUDO_HELPER "$TOP/btrfs" check --check-data-csum "$TEST_DEV"