btrfs-progs: tests: enable strict chunk alignment check

The strict check is enabled for both check_image() and
convert_test_do_convert() to detect chunk alignment related problems.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2024-01-16 14:01:26 +10:30 committed by David Sterba
parent 6dfc69104b
commit 04f3efaa0d
2 changed files with 4 additions and 0 deletions

View File

@ -441,6 +441,7 @@ check_image()
image=$1
echo "testing image $(basename $image)" >> "$RESULTS"
export BTRFS_PROGS_DEBUG_STRICT_CHUNK_ALIGNMENT=y
run_mustfail_stdout "btrfs check should have detected corruption" \
"$TOP/btrfs" check "$image" &> "$tmp_output"
@ -449,6 +450,7 @@ check_image()
run_check "$TOP/btrfs" check --repair --force "$image"
run_check_stdout "$TOP/btrfs" check "$image" &> "$tmp_output"
unset BTRFS_PROGS_DEBUG_STRICT_CHUNK_ALIGNMENT
# Also make sure no subpage related warnings for the repaired image
check_test_results "$tmp_output" "$testname"

View File

@ -147,9 +147,11 @@ convert_test_acl() {
# $1: features, argument of -O, can be empty
# $2: nodesize, argument of -N, can be empty
convert_test_do_convert() {
export BTRFS_PROGS_DEBUG_STRICT_CHUNK_ALIGNMENT=y
run_check "$TOP/btrfs-convert" ${1:+-O "$1"} ${2:+-N "$2"} "$TEST_DEV"
run_check "$TOP/btrfs" check "$TEST_DEV"
run_check "$TOP/btrfs" inspect-internal dump-super -Ffa "$TEST_DEV"
unset BTRFS_PROGS_DEBUG_STRICT_CHUNK_ALIGNMENT
}
# post conversion check, verify file permissions.