]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(test/DMSQUASH): zero overlay partition on reset
authorNadzeya Hutsko <nadzeya.hutsko@canonical.com>
Thu, 22 Jan 2026 11:54:13 +0000 (12:54 +0100)
committerBenjamin Drung <bdrung@ubuntu.com>
Thu, 22 Jan 2026 14:01:03 +0000 (15:01 +0100)
The reset_overlay_partition function was not fully clearing
the overlay partition. Delete the partition from the
partition table and zero out the disk region to ensure a
clean state between test runs.

test/TEST-30-DMSQUASH/test.sh

index 0b5ef316e68c4d97d9c668964e184b364ed43be7..d5d85b2445c72f2c43837aa3792f577d61c7e5a4 100755 (executable)
@@ -60,6 +60,8 @@ check_autooverlay_marker() {
 # Reset root.img to single partition state for autooverlay test
 reset_overlay_partition() {
     test_marker_reset
+    sfdisk --delete "$TESTDIR"/root.img 2 2> /dev/null || true
+    dd if=/dev/zero of="$TESTDIR"/root.img bs=1M seek=320 count=50 conv=notrunc status=none
     local rootPartitions
     rootPartitions=$(sfdisk -d "$TESTDIR"/root.img | grep -c 'root\.img[0-9]')
     [ "$rootPartitions" -eq 1 ]