From 362ea817df5207086971e0709042e5ec2428f7dc Mon Sep 17 00:00:00 2001 From: Nadzeya Hutsko Date: Mon, 19 Jan 2026 10:57:29 +0100 Subject: [PATCH] test(DMSQUASH): fix autooverlay test checks the entire root.img The test searched for the marker string in the entire root.img, but the string also existed literally in test-init.sh embedded in the first partition, causing a false positive. Fix by extracting and searching only the second (overlay) partition. Fixes: #2054 --- test/TEST-30-DMSQUASH/test.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/TEST-30-DMSQUASH/test.sh b/test/TEST-30-DMSQUASH/test.sh index fbd2b7968..1ed00956f 100755 --- a/test/TEST-30-DMSQUASH/test.sh +++ b/test/TEST-30-DMSQUASH/test.sh @@ -67,8 +67,13 @@ test_run() { rootPartitions=$(sfdisk -d "$TESTDIR"/root.img | grep -c 'root\.img[0-9]') [ "$rootPartitions" -eq 2 ] - # Verify that the string "dracut-autooverlay-success" occurs in the second partition in the image file. - test_marker_check dracut-autooverlay-success root.img + # Verify that the string "dracut-autooverlay-success" occurs in the second partition (overlay). + # Extract only the second partition to avoid false positives from the test script in the first partition. + part2_info=$(sfdisk -d "$TESTDIR"/root.img | grep 'root\.img2') + part2_start=$(echo "$part2_info" | sed -n 's/.*start= *\([0-9]*\).*/\1/p') + part2_size=$(echo "$part2_info" | sed -n 's/.*size= *\([0-9]*\).*/\1/p') + dd if="$TESTDIR"/root.img of="$TESTDIR"/overlay-part.img bs=512 skip="$part2_start" count="$part2_size" status=none + test_marker_check dracut-autooverlay-success overlay-part.img return 0 } -- 2.47.3