test: provision test machine from tests

Don't rely on the deployment script to install the right config or to start the
services.

This further disentangles the tests from schutzbot.
This commit is contained in:
Tom Gundersen 2020-10-20 14:06:34 +00:00 committed by Ondřej Budai
parent 8fd93c0d7c
commit 931bd8be57
12 changed files with 28 additions and 7 deletions

View file

@ -176,6 +176,7 @@ install -m 0755 -vp _bin/osbuild-dnf-json-tests %{buildroot}%{_l
install -m 0755 -vp _bin/osbuild-image-tests %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp _bin/osbuild-auth-tests %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp _bin/cloud-cleaner %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp tools/provision.sh %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp tools/image-info %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp tools/run-koji-container.sh %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp tools/koji-compose.py %{buildroot}%{_libexecdir}/osbuild-composer-test/

View file

@ -61,7 +61,4 @@ sudo cp schutzbot/repositories/fedora-*.json /etc/osbuild-composer/repositories/
greenprint "Copying repository configuration for tests"
sudo mkdir -p /etc/tests/osbuild-composer/repositories
sudo cp schutzbot/repositories/*.json /etc/tests/osbuild-composer/repositories/
greenprint "Provisioning the services"
./schutzbot/provision.sh
sudo cp schutzbot/repositories/*.json /etc/tests/osbuild-composer/repositories/

View file

@ -14,6 +14,13 @@
set -euxo pipefail
#
# Provision the software under tet.
#
/usr/libexec/osbuild-composer-test/provision.sh
#
# Verify that this script is running in the right environment. In particular,
# it needs variables is set to access AWS.
@ -33,7 +40,6 @@ function cleanup() {
}
trap cleanup EXIT
#
# Install the aws client from the upstream release, because it doesn't seem to
# be available as a RHEL package.

View file

@ -16,6 +16,9 @@ function greenprint {
echo -e "\033[1;32m${1}\033[0m"
}
# Provision the software under tet.
/usr/libexec/osbuild-composer-test/provision.sh
# Apply lorax patch to work around pytoml issues in RHEL 8.x.
# See BZ 1843704 or https://github.com/weldr/lorax/pull/1030 for more details.
if [[ $ID == rhel ]]; then

View file

@ -37,6 +37,10 @@ run_test_case () {
echo
}
# Provision the software under tet.
/usr/libexec/osbuild-composer-test/provision.sh
# Change to the working directory.
cd $WORKING_DIRECTORY

View file

@ -74,6 +74,9 @@ run_test_case () {
echo
}
# Provision the software under tet.
/usr/libexec/osbuild-composer-test/provision.sh
# Change to the working directory.
cd $WORKING_DIRECTORY

View file

@ -11,6 +11,9 @@ function greenprint {
echo -e "\033[1;32m${1}\033[0m"
}
# Provision the software under tet.
/usr/libexec/osbuild-composer-test/provision.sh
if [[ $ID == rhel ]] && ! rpm -q epel-release; then
greenprint "📦 Setting up EPEL repository"
curl -Ls --retry 5 --output /tmp/epel.rpm \

View file

@ -7,6 +7,9 @@ OSBUILD_COMPOSER_TEST_DATA=/usr/share/tests/osbuild-composer/
source /etc/os-release
ARCH=$(uname -m)
# Provision the software under tet.
/usr/libexec/osbuild-composer-test/provision.sh
# Set os-variant and boot location used by virt-install.
case "${ID}-${VERSION_ID}" in
# Bypass ostree test on rhel 8.2

View file

@ -7,6 +7,9 @@ OSBUILD_COMPOSER_TEST_DATA=/usr/share/tests/osbuild-composer/
source /etc/os-release
ARCH=$(uname -m)
# Provision the software under tet.
/usr/libexec/osbuild-composer-test/provision.sh
# Take the image type passed to the script or use qcow2 by default if nothing
# was passed.
IMAGE_TYPE=${1:-qcow2}

View file

@ -1 +0,0 @@
../../../../../../schutzbot/provision.sh

View file

@ -17,4 +17,3 @@ chpasswd:
sudo: 'ALL=(ALL) NOPASSWD:ALL'
runcmd:
- /run/provision-scripts/deploy.sh
- /run/provision-scripts/provision.sh