Skip to content

Commit ea4ae56

Browse files
committed
btrfs-progs: tests: add test case for basic checksum conversion
Test the following: - Create a btrfs with crc32c csum - Populate the filesystem - Convert the filesystem to the following csums: * xxhash * blake2 * sha256 * crc32c Signed-off-by: Qu Wenruo <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 3644eb7 commit ea4ae56

File tree

1 file changed

+30
-0
lines changed
  • tests/misc-tests/064-csum-conversion-basic

1 file changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
# Verify the csum conversion works as expected.
3+
4+
source "$TEST_TOP/common" || exit
5+
source "$TEST_TOP/common.convert" || exit
6+
7+
check_experimental_build
8+
setup_root_helper
9+
prepare_test_dev
10+
11+
convert_to_csum()
12+
{
13+
local new_csum="$1"
14+
15+
run_check "$TOP/btrfstune" --csum "$new_csum" "$TEST_DEV"
16+
run_check "$TOP/btrfs" check --check-data-csum "$TEST_DEV"
17+
}
18+
19+
run_check_mkfs_test_dev --csum crc32c
20+
21+
# We only mount the filesystem once to populate its contents, later one we
22+
# would never mount the fs (to reduce the dependency on kernel features).
23+
run_check_mount_test_dev
24+
populate_fs
25+
run_check_umount_test_dev
26+
27+
convert_to_csum xxhash
28+
convert_to_csum blake2
29+
convert_to_csum sha256
30+
convert_to_csum crc32c

0 commit comments

Comments
 (0)