Rework vmcheck to use `kola spawn`, move off of PAPR
There's a lot going on here, but essentially:
1. We change the `vmcheck` model so that it always operates on an
immutable base image. It takes that image and dynamically launches a
separate VM for each test using `kola spawn`. This means we can drop
a lot of hacks around re-using the same VMs.
2. Following from 1., `vmoverlay` now takes as input a base image,
overlays the built rpm-ostree bits, then creates a new base image. Of
course, we don't have to do this in CI, because we build FCOS with
the freshly built RPMs (so it uses `SKIP_VMOVERLAY=1`). `vmoverlay`
then will be more for the developer case where one doesn't want to
iterate via `cosa build` to test rpm-ostree changes. I say "will"
because the functionality doesn't exist yet; I'd like to enhance
`cosa dev-overlay` to do this. (Note `vmsync` should still works just
as before too.)
3. `vmcheck` can be run without building the tree first, as
`tests/vmcheck.sh`. The `make vmcheck` target still exists though for
finger compatibility and better meshing with `vmoverlay` in the
developer case.
What's really nice about using kola spawn is that it takes care of a lot
of things for us, such as the qemu command, journal and console
gathering, and SSH.
Similarly to the compose testsuites, we're using parallel here to run
multiple vmcheck tests at once. (On developer laptops, we cap
parallelism at `$(nproc) - 1`).
2019-12-13 20:23:41 +03:00
branches :
- master
- auto
- try
2017-06-08 23:17:33 +03:00
2019-03-15 17:00:52 +03:00
# NB: when bumping 29 here, also bump compose script
2017-05-26 23:21:02 +03:00
2019-03-15 17:00:52 +03:00
context : f29-compose1
2017-07-05 19:01:31 +03:00
2016-12-03 02:07:08 +03:00
build : false
2017-07-05 19:01:31 +03:00
2018-10-01 20:15:02 +03:00
timeout : 35m
2016-12-03 02:07:08 +03:00
# This test case wants an "unprivileged container with bubblewrap",
# which we don't have right now; so just provision a VM and do a
# docker --privileged run.
host :
2019-03-15 17:00:52 +03:00
distro : fedora/29/atomic
2018-01-09 18:46:23 +03:00
# Compose tests are slow and should be parallelized
specs :
cpus : 4
2016-12-03 02:07:08 +03:00
2018-08-09 19:14:01 +03:00
env :
RPMOSTREE_COMPOSE_TEST_FILTER : odd
Add releasever opt, avoid opening up host's rpmdb in treecompose
Closes: https://github.com/projectatomic/rpm-ostree/issues/546
Previously, we'd open up the host's rpmdb for both `compose tree`
and `ex container`. In the first case, because we require root, we'd
succeed. For `ex container`, we'd spew an error.
Fixing this was trickier than I thought. First because there was
*also* a libdnf bug here: https://github.com/rpm-software-management/libdnf/pull/307
Second, there's a compatibility hazard here for anyone using `.repo` files that
reference `$releasever`. This actually happened to me with `ex container` as I'd
just done a `ln -s /etc/yum.repos.d/fedora.repo rpmmd.repos.d`. I fixed
that first by doing a `sed -i -e 's,$releasever,26,' rpmmd.repos.d/*.repo`.
As far as I can see today, none of Fedora Atomic or CentOS AH rely on this. But
in order to enhance compatibility, let's add a "releasever" option. This makes
it easier again to reuse stock `.repo` files if we wanted to do so.
(Also, I realized we can just use `/usr/share/empty` as *the* canonical immutable
empty directory)
Closes: #875
Approved by: jlebon
2017-07-13 19:37:41 +03:00
# Copy yum.repos.d to get any injected repos from the host, which
# will point to a closer mirror. Note we substitute $releasever
# since https://github.com/projectatomic/rpm-ostree/pull/875
2016-12-03 02:07:08 +03:00
tests :
2017-05-26 23:21:02 +03:00
- docker run --privileged --rm
2018-08-09 19:14:01 +03:00
-e RPMOSTREE_COMPOSE_TEST_FILTER
2017-09-29 17:01:18 +03:00
-e RPMOSTREE_COMPOSE_TEST_USE_REPOS=/etc/yum.repos.d.host
2017-05-26 23:21:02 +03:00
-v /etc/yum.repos.d:/etc/yum.repos.d.host:ro
-v $(pwd):/srv/code -w /srv/code
2019-03-15 17:00:52 +03:00
registry.fedoraproject.org/fedora:29 /bin/sh -c
2018-10-01 22:23:25 +03:00
"cp /etc/yum.repos.d.host/* /etc/yum.repos.d/ && ./ci/build.sh && make install && ./tests/compose"
2016-12-09 01:31:20 +03:00
artifacts :
2018-01-08 22:54:10 +03:00
- test-compose-logs
2017-07-27 21:27:31 +03:00
---
2018-08-09 19:14:01 +03:00
inherit : true
2019-03-15 17:00:52 +03:00
context : f29-compose2
2018-08-09 19:14:01 +03:00
env :
RPMOSTREE_COMPOSE_TEST_FILTER : even