~chad.smith/curtin:tests/fix-apt-preserve-vmtests

Last commit made on 2018-11-05
Get this branch:
git clone -b tests/fix-apt-preserve-vmtests https://git.launchpad.net/~chad.smith/curtin
Only Chad Smith can upload to this branch. If you are Chad Smith please log in for upload directions.

Branch merges

Branch information

Name:
tests/fix-apt-preserve-vmtests
Repository:
lp:~chad.smith/curtin

Recent commits

001a6da... by Chad Smith

remove unused Trusty/Xenial test cases

d4bd6b0... by Chad Smith

strict yaml format assertion. support for trusty/precise vs newer releases

13a3bef... by Chad Smith

update tests to support both apt_preserve_sources_list formats

20c71b8... by Chad Smith

update fix for old_pat_features

30fc579... by Chad Smith

tests: fix vmtests for apt perserve_source_list changes

40e6cc3... by Scott Moser

apt: Use new format apt config when writing preserve_sources_list.

cloud-init reads the "preserve_sources_list" setting from 2 config paths:
 old: top level apt_preserve_sources_list
 new: apt/preserve_sources_list

Previously curtin would write only the old form. That lead to the
case where cloud-init would raise exception complaining about conflicting
settings and exiting error. That occurred because MAAS was incorrectly
sending 'preserve_sources_list: True'

The change here could result in actually causing that problem if:
A. a user was specifying old style 'apt_preserve_sources_list=False' in
   user-data. They now have to match the version that curtin writes
   but at least curtin is writing new format on new cloud-init.
B. MAAS provided differing setting in the curtin config
  'debconf_selections'

That is because now the system will have format config specifying True
written by curtin and a different format written by user/maas.

I'd suggest the most likely chance for regression here would be
16.04+ systems with old MAAS (providing 'B') or JuJu providing 'A'.

LP: #1735950

01e9fc5... by Ryan Harper

vmtests: multipath mount /home with nofail and validate in unittest

In some scenarios the mounting of /home partition under multipath fails
and leaves the boot stage hung in emergency shell. We have no ability
to debug this in automated runs on infrastructure. Instead we will now
pass the 'nofail' mount option which instructs systemd to not fall to
the emergency shell allowing the boot to complete and vmtest to collect
information. We now validate the status of the home mount in the
unittest in the class. When this fails, we will have collected the
journal and the unit information which should help narrow down why
we see the failure.

182a58b... by Scott Moser

vmtests: fix common collect scripts to not exit failure.

If collect scripts exit non-zero, then cloud-init in the booted system
will complain that they have done so. This adds noise to logs.

At this point, the only command in a long list that affects the exit code
is the last one. At some point in the future we may have more systematic
collection. At that point it might make sense to exit if the collection
failed.

For now, just exit 0.

d3b8b70... by Ryan Harper

vmtest: handle collect disk unpack failure

If unpacking a collect disk fails, we don't chmod the collect
disk output which can leave un-removable files for non-root users.
Fix this by catching the CalledProcessException and adding a
finally clause to run the recursive chmod.

1ad639b... by Ryan Harper

vmtests: dont use multiple subclasses in uefi 4k tests

The uefi 4k sector size test used an intermediary subclass
to set the sector_size of 4k, but the resulting subclass
ended up creating an instance of the parent class which set
the 'collect_scripts' attribute and then tripped the runtime
check on vmtests having an empty 'collect_scripts' attribute.

The fix was to create the 4k tests directly from the base class.