~smoser/curtin:fix/1735950-new-preserve_sources-when-possible

Last commit made on 2018-10-29
Get this branch:
git clone -b fix/1735950-new-preserve_sources-when-possible https://git.launchpad.net/~smoser/curtin
Only Scott Moser can upload to this branch. If you are Scott Moser please log in for upload directions.

Branch merges

Branch information

Name:
fix/1735950-new-preserve_sources-when-possible
Repository:
lp:~smoser/curtin

Recent commits

08914fa... by Scott Moser

add preserve_sources_list doc

8bf31ee... by Scott Moser

fix call to get_package_version

577541d... 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

e4727e8... by Ryan Harper

vmtests: disable snapd/seeding to avoid boot hang

In Cosmic some snaps are now seeded in the image and will
automatically install/mount at runtime. Overlayroot has
exposed a bug in snapd but prevents images from booting
completely. Workaround this issue (bug #1797218)
snapd and snapd.seeded services. A nice side-effect is that
those images with seeded snaps boot faster and use less
memory.

94afac7... by Ryan Harper

jenkins-runner: fix when using --filter only

The elif clause when checking for tests via positional or filter
parameters never took the path where we invoked vmtest-filter.
Fix this by only pre-populating tests with 'tests/vmtests' if
there are no positional parameters and no filter parameters.

Also re-indent filter block to match program style.

0f99308... by Ryan Harper

distro: fix system_upgrade command using string instead of function

The distro system_upgrade configuration dictionary used a string
for the name of the function to call which resulted in attempting
to call a string type which failed. This was found in CI running
proposed upgrade testing.

The fix is to use the function name itself rather than string.
This branch also adds unittest for invoking the system_upgrade path.

LP: #1796968

f4bf707... by Ryan Harper

Capture stdout when using lxc file push

Newer lxd (3.4+) 'file' command now produces progress info in some
cases written to stdout. This breaks curtin-from-container which
is invoked with the 'pack' curtin command which also writes to stdout.
The result was a corrupt curtin package output file which left all
vmtests sitting idle in the ephemeral boot phase and timing out.

To resolve, we capture stdout from lxc file push and report
the contents if file push fails.

14210d5... by Scott Moser

vmtest: boot ephemeral with 'ro' on the kernel command line.

As raised in bug 1792905, when 'ro' is present in on the kernel command
line and the squashfs (rooturl=) parameter does not have a /lib/modules
then copymods fails to copy the modules into the "real root" and
things fail.

Maas is booting with 'ro', so it makes sense for curtin to do the same.
Additionally, 'ro' is present in almost all cases on a command line.

3aafe77... by Scott Moser

vmtest: Fix typo in skip-by-date.

The previous commit made one skip by date change go backwards.
Instead of 2019 we had set it to 2018.

0a27f28... by Scott Moser

vmtest: kick skip-by-date for 1671951.

The bug is marked as fix-released (cosmic), and not fixed in bionic.
Our tests still fail in cosmic though, so kick this along while we figure
that out.