c7a9c3b1dd
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`).
52 lines
1.2 KiB
Bash
Executable File
52 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
if test -z "${INSIDE_VM:-}"; then
|
|
|
|
# do this in the host
|
|
. ${commondir}/libvm.sh
|
|
vm_setup
|
|
|
|
if ! vm_ssh_wait 30; then
|
|
echo "ERROR: A running VM is required for 'make vmcheck'."
|
|
exit 1
|
|
fi
|
|
|
|
vm_rsync
|
|
vm_cmd env INSIDE_VM=1 /var/roothome/sync/tests/vmcheck/sync.sh
|
|
exit 0
|
|
fi
|
|
|
|
set -x
|
|
|
|
# And then this code path in the VM
|
|
|
|
ostree admin unlock || :
|
|
|
|
# Now, overlay our built binaries & config files
|
|
INSTTREE=/var/roothome/sync/insttree
|
|
rsync -rlv $INSTTREE/ /
|
|
|
|
restorecon -v /usr/bin/{rpm-,}ostree /usr/libexec/rpm-ostreed
|
|
|
|
overrides_dir=/etc/systemd/system/rpm-ostreed.service.d
|
|
mkdir -p $overrides_dir
|
|
|
|
# For our test suite at least, to catch things like
|
|
# https://github.com/projectatomic/rpm-ostree/issues/826
|
|
cat > $overrides_dir/fatal-warnings.conf << EOF
|
|
[Service]
|
|
Environment=G_DEBUG=fatal-warnings
|
|
EOF
|
|
|
|
# In the developer workflow, it's just not helpful to
|
|
# have the daemon auto-exit. But let's keep it as a separate
|
|
# override file to make it easy to drop if needed.
|
|
cat > $overrides_dir/no-idle-exit.conf << EOF
|
|
[Service]
|
|
Environment=RPMOSTREE_DEBUG_DISABLE_DAEMON_IDLE_EXIT=1
|
|
EOF
|
|
|
|
systemctl daemon-reload
|
|
systemctl restart rpm-ostreed
|