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.
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.
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.
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.
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.
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.
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.
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.
tools/jenkins-runner: Error if both filters and tests are given.
Previously if you gave both '--filter' and 'tests/vmtests/' arguments
to tools/jenkins-runner it would just silently ignore the test arguments.
Just fail instead of doing the wrong thing, and possibly leaving the user
believing that the tests they provided correctly ran.