~raharper/curtin:fix/jenkins-filter-once-more

Last commit made on 2018-10-10
Get this branch:
git clone -b fix/jenkins-filter-once-more https://git.launchpad.net/~raharper/curtin
Only Ryan Harper can upload to this branch. If you are Ryan Harper please log in for upload directions.

Branch merges

Branch information

Name:
fix/jenkins-filter-once-more
Repository:
lp:~raharper/curtin

Recent commits

2666075... by Ryan Harper

jenkins-runner: fix when using --filter only

The elsif 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.

1149317... by Scott Moser

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.

5c7d667... by Ryan Harper

vmtests: prevent tests from modifying cls.collect_scripts

vmtests now has a set of collect scripts which are shared in all
subclassed tests and should not be modifed by the subclass. Fix
test_lvm_raid.py which modified cls.collect_scripts to use
extra_collect_scripts and update the base class to raise a RuntimeError
if a subclass presents a modified cls.collect_scripts.

5f0082d... by Ryan Harper

Enable custom storage configuration for centos images

Add support for the majority of storage configurations including
partitioning, lvm, raid, iscsi and combinations of these. Some
storage configs are unsupported at this time:
 Unsupported storage config options on Centos:
  - bcache (no kernel support)
  - zfs (no kernel support)
  - jfs, ntfs, reiserfs (no kernel, userspace support)

Curtin's built-in curthooks now support Centos in addition
to Ubuntu. The built-in curthooks are now callable by
in-image curthooks. This feature is announced by the
presence of the feature flag, 'CENTOS_CURTHOOK_SUPPORT'

Other notable features added:
 - tools/jenkins-runner now includes a test filtering
   ability which enables generating the list of tests to
   run by specifying attributes of the classes. For example
   to run all centos70 tests append:
   --filter=target_release=centos70
 - curtin/distro.py includes distro specific methods, such as
   package install and distro version detection
 - util.target_path has now moved to curtin.paths module

b812ae8... by Ryan Harper

vmtest: ensure we collect /var/log/journal only once

Appending the journal script to the collect_scripts parameter
modified a share class variable which resulted in more than
one call to the script to collect the journal. The script itself
was not defensive about repeated calls and would copy the
journal dir more than once which resulted in filling the capacity
of the output disk.

The changes here make the script defensive to only run once,
and fail if additional attempts to run are made.