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.
# 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 ]