This one does change behaviour in that if it has to resize a partition
to make room for the ESP it puts it before the partition, not after.
This lets us put an assertion back in an API test.
No behaviour change yet, this all assumes version 1 partitioning, i.e.
no mix of new and old partitions on a device. But it means we only have
to edit one batch of logic when that stops being true.
A useful concept in other areas of partition / gap handling has to
require a keyword for specifying if we're sending gap or a partition.
Implement that here for the partition and gap keywords, and also on the
downstream partition_disk_handler.
SUBIQUITY_REPLAY_TIMESCALE should be passed to replay-curtin-log.py,
which speeds up test_server_flow (11s -> 2s), and probably others.
For the unit test, by clearing the environment and using a known set,
we can avoid having to keep a second copy of the allow list in test.
It seemed far too much complicated find the proper way to deal with
apt Python library under the snap environment.
Opted for running the system apt command without the LD_*
customisations, similar to what an installer does when chroot into the
taget system.
This allows for running subprocess outside of the snap environment.
Both functions now receive a custom env without the LD_ related vars.
Renamed _create_user() to create_user() to make explicit that it has the
same semantic level as apply_locale().
The trap on ERR doesn't trigger in all the cases that we want.
The EXIT trap seems to be more robust, albeit with the requirement to
actually check the result code.
Move from using .subiquity as output-base to a tmpdir. This solves
several practical problems, like accidentally running the tests while
dryrun is open in another terminal or any other case where the server
process that is connected to is not the one that is expected.
Also makes cleanup nicer.
On failure, it will show which temporary directory was used to allow for
easy log examination.
To allow customization where an install iso can have the autoinstall
data, and to ignore that in favor of autoinstall from cloud-config, this
implements a more specific order of loading from the possible locaitons.
Also, the chosen file is set aside, and then is top priority if the
subiquity process is reloaded.