lorax/test/vm.install
Lars Karlitski 250f49f78d Use Cockpit's test images and infrastructure
Allows to run the tests on multiple operating systems and on the
infrastructure that the Cockpit team maintains.

`make vm` downloads one of Cockpit's test images (override which one
with TEST_OS) and installs rpms build from the local checkout of lorax.
The resulting image is placed in `test/images/$TEST_OS`.

TEST_OS can be set to any of Cockpit's supported images (default:
fedora-30).

Run `make check-vm` to run the CLI checks in the VM. The bulk of the
work is done in `test/check-cli`, which uses Cockpit's `bots` library to
start the VM and run the script in it.

Also included is a `test/run` script, which is the entrypoint for
Cockpit's test infrastructure.
2019-05-20 20:24:01 +02:00

19 lines
544 B
Bash

#!/bin/sh -eux
SRPM="$1"
# Grow root partition to make room for images. This only works on Fedora right now.
echo ", +" | sfdisk -N 2 -f /dev/vda
partprobe
pvresize /dev/vda2
lvresize fedora/root -l+100%FREE -r
su builder -c "/usr/bin/mock --no-clean --resultdir build-results --rebuild $SRPM"
packages=$(find build-results -name '*.rpm' -not -name '*.src.rpm')
rpm -e $(basename -a ${packages[@]} | sed 's/-[0-9].*.rpm$//') || true
yum install -y beakerlib $packages
systemctl enable lorax-composer.socket
systemctl enable docker.service