diff mbox series

[3/3] btrfs-progs: tests: enable strict chunk alignment check

Message ID 34710605e3e80a3bd808c1c69bb878bab501c467.1705375819.git.wqu@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: make convert to generate chunks aligned to stripe boundary | expand

Commit Message

Qu Wenruo Jan. 16, 2024, 3:31 a.m. UTC
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>
---
 tests/common         | 2 ++
 tests/common.convert | 2 ++
 2 files changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/tests/common b/tests/common
index 771acaa339e8..1f880adead6d 100644
--- a/tests/common
+++ b/tests/common
@@ -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"
diff --git a/tests/common.convert b/tests/common.convert
index 9b498ef29f1f..7d1d333895fa 100644
--- a/tests/common.convert
+++ b/tests/common.convert
@@ -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.