diff --git a/test/units/TEST-58-REPART.sh b/test/units/TEST-58-REPART.sh index c862c07d2e..326c66e2af 100755 --- a/test/units/TEST-58-REPART.sh +++ b/test/units/TEST-58-REPART.sh @@ -715,6 +715,46 @@ EOF assert_in "$imgs/auto3 : start= 45056, size= 20480, type=${root_guid}," "$output" } +testcase_size_auto_foreign_partitions() { + local defs imgs output + + defs="$(mktemp --directory "/tmp/test-repart.defs.XXXXXXXXXX")" + imgs="$(mktemp --directory "/var/tmp/test-repart.imgs.XXXXXXXXXX")" + # shellcheck disable=SC2064 + trap "rm -rf '$defs' '$imgs'" RETURN + chmod 0755 "$defs" + + echo "*** Adding a partition with --size=auto to an image with foreign partitions ***" + + # --size=auto reloads the partition table, which must not lose the UUID and label of the existing + # partitions that have no definition. + truncate -s 12M "$imgs/foreign.img" + sfdisk "$imgs/foreign.img" <