All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs-progs: tests: fix false alerts on github CI
@ 2026-11-14 23:03 Qu Wenruo
  2026-11-14 23:03 ` [PATCH 1/2] btrfs-progs: tests: fix false alerts on convert/017 Qu Wenruo
  2026-11-14 23:03 ` [PATCH 2/2] btrfs-progs: tests: fix github CI failure on mkfs/037 Qu Wenruo
  0 siblings, 2 replies; 3+ messages in thread
From: Qu Wenruo @ 2026-11-14 23:03 UTC (permalink / raw)
  To: linux-btrfs

After the CI workers updated to ubuntu 26.04, there are several new fail tests cases:

- convert/017
  There is not enough metadata space to support a convert.
  This test relies on both the mkfs.ext4 behavior and kernel ext4 write behavior.
  Change the test case to skip the run if there is not enough space left.

- mkfs/037
  There is no '/usr/lib/lib*` files anymore there on ubuntu 26.04.
  Use generated data instead.

Qu Wenruo (2):
  btrfs-progs: tests: fix false alerts on convert/017
  btrfs-progs: tests: fix github CI failure on mkfs/037

 tests/convert-tests/017-fs-near-full/test.sh  | 12 +++++--
 .../mkfs-tests/037-basic-compression/test.sh  | 31 +++++++++----------
 2 files changed, 24 insertions(+), 19 deletions(-)

--
2.56.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] btrfs-progs: tests: fix false alerts on convert/017
  2026-11-14 23:03 [PATCH 0/2] btrfs-progs: tests: fix false alerts on github CI Qu Wenruo
@ 2026-11-14 23:03 ` Qu Wenruo
  2026-11-14 23:03 ` [PATCH 2/2] btrfs-progs: tests: fix github CI failure on mkfs/037 Qu Wenruo
  1 sibling, 0 replies; 3+ messages in thread
From: Qu Wenruo @ 2026-11-14 23:03 UTC (permalink / raw)
  To: linux-btrfs

On github CI workers, the test convert/017 fails as the following:

 ERROR: failed to reserve 33554432 bytes for metadata chunk, largest available: 33488896 bytes
 ERROR: unable to create initial ctree: No space left on device
 WARNING: error during conversion, the original filesystem is not modified

The test case is verifying the behavior of converting an almost full
ext4, unfortunately the chunk layout is dependent on the ext4 fs, so
we do not reliable have enough metadata space for such case.

Instead of using convert_test_do_convert() which expects the convert run
to success, open-code the helper, and use "run_mayfail" instead, and
only continue checking if the convert succeeded.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 tests/convert-tests/017-fs-near-full/test.sh | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/tests/convert-tests/017-fs-near-full/test.sh b/tests/convert-tests/017-fs-near-full/test.sh
index 92048f08d376..fa5073b1830e 100755
--- a/tests/convert-tests/017-fs-near-full/test.sh
+++ b/tests/convert-tests/017-fs-near-full/test.sh
@@ -27,6 +27,12 @@ done
 
 run_check_umount_test_dev
 
-# convert_test_do_convert() will call btrfs check, which should expose any
-# invalid inline extent with too large size
-convert_test_do_convert
+export BTRFS_PROGS_DEBUG_STRICT_CHUNK_ALIGNMENT=y
+# The e2mkfs may use extra space due to their default feature changes.
+# So the convert itself may fail due to lack of space.
+run_mayfail "$TOP/btrfs-convert" "$TEST_DEV"
+if [ $? -ne 0 ]; then
+	_not_run "Not enough space left for btrfs-convert"
+fi
+run_check "$TOP/btrfs" check "$TEST_DEV"
+run_check "$TOP/btrfs" inspect-internal dump-super -Ffa "$TEST_DEV"
-- 
2.56.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] btrfs-progs: tests: fix github CI failure on mkfs/037
  2026-11-14 23:03 [PATCH 0/2] btrfs-progs: tests: fix false alerts on github CI Qu Wenruo
  2026-11-14 23:03 ` [PATCH 1/2] btrfs-progs: tests: fix false alerts on convert/017 Qu Wenruo
@ 2026-11-14 23:03 ` Qu Wenruo
  1 sibling, 0 replies; 3+ messages in thread
From: Qu Wenruo @ 2026-11-14 23:03 UTC (permalink / raw)
  To: linux-btrfs

The github CI fails with the mkfs/037 due to changed `/usr/lib` layout:

 failed: cp -axf --update --no-preserve=ownership,context /usr/lib*/lib[abcdef]* /tmp/btrfs-progs-mkfs-rootdir.Ivn4QL

We should never rely on the host to populate the rootdir at all.
So use generated data instead, which also improves the coverage, as now
we have both compressible, incompressible and partial compressible
files.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 .../mkfs-tests/037-basic-compression/test.sh  | 31 +++++++++----------
 1 file changed, 15 insertions(+), 16 deletions(-)

diff --git a/tests/mkfs-tests/037-basic-compression/test.sh b/tests/mkfs-tests/037-basic-compression/test.sh
index bb1653cf3074..6c2cf9023e5d 100755
--- a/tests/mkfs-tests/037-basic-compression/test.sh
+++ b/tests/mkfs-tests/037-basic-compression/test.sh
@@ -12,23 +12,22 @@ setup_root_helper
 prepare_test_dev
 
 tmp=$(_mktemp_dir mkfs-rootdir)
-limit=$((128*1024*1024))
 
-# Create dataset of approximate size 256M so the repeated compression does not take that long
-for file in /usr/bin/[gx]*; do
-	run_check cp -axf --update --no-preserve=ownership,context "$file" "$tmp"
-	size=$(du -sb "$tmp" | awk '{print $1}')
-	if [ "$size" -gt "$limit" ]; then
-		break
-	fi
-done
-
-for file in /usr/lib*/lib[abcdef]*; do
-	run_check cp -axf --update --no-preserve=ownership,context "$file" "$tmp"
-	size=$(du -sb "$tmp" | awk '{print $1}')
-	if [ "$size" -gt "$limit" ]; then
-		break
-	fi
+# Create dataset of approximate size 256M so the repeated compression does not
+# take that long.
+# Mix compressible, incompressible and partially compressible files.
+for i in $(seq 1 25); do
+	# Compressible: zeros
+	run_check dd if=/dev/zero of="$tmp/zero_$i" bs=1M count=4 status=none
+	# Incompressible: random data
+	run_check dd if=/dev/urandom of="$tmp/random_$i" bs=1M count=4 status=none
+	# Partially compressible: 64K of random data alternating with 64K of
+	# zeros, so a compressed extent (max 128K) contains both
+	run_check dd if=/dev/zero of="$tmp/mixed_$i" bs=1M count=2 status=none
+	for j in $(seq 0 15); do
+		run_check dd if=/dev/urandom of="$tmp/mixed_$i" bs=64K count=1 \
+			seek=$((j * 2)) conv=notrunc status=none
+	done
 done
 
 run_check du -sh "$tmp"
-- 
2.56.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-14 23:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-14 23:03 [PATCH 0/2] btrfs-progs: tests: fix false alerts on github CI Qu Wenruo
2026-11-14 23:03 ` [PATCH 1/2] btrfs-progs: tests: fix false alerts on convert/017 Qu Wenruo
2026-11-14 23:03 ` [PATCH 2/2] btrfs-progs: tests: fix github CI failure on mkfs/037 Qu Wenruo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.