diff --git a/osbuild-composer.spec b/osbuild-composer.spec index c65465059..6d92dfa24 100644 --- a/osbuild-composer.spec +++ b/osbuild-composer.spec @@ -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/ diff --git a/schutzbot/deploy.sh b/schutzbot/deploy.sh index aa6cba74f..944fe87e0 100755 --- a/schutzbot/deploy.sh +++ b/schutzbot/deploy.sh @@ -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/ \ No newline at end of file diff --git a/test/cases/api.sh b/test/cases/api.sh index 6b5c8c832..4fc5f9817 100644 --- a/test/cases/api.sh +++ b/test/cases/api.sh @@ -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. diff --git a/test/cases/aws.sh b/test/cases/aws.sh index 9c7fe1d39..0ac308713 100755 --- a/test/cases/aws.sh +++ b/test/cases/aws.sh @@ -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 diff --git a/test/cases/base_tests.sh b/test/cases/base_tests.sh index a5d9f4cc8..6e0f67e5d 100755 --- a/test/cases/base_tests.sh +++ b/test/cases/base_tests.sh @@ -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 diff --git a/test/cases/image_tests.sh b/test/cases/image_tests.sh index 715c96cd7..2f2dafc64 100755 --- a/test/cases/image_tests.sh +++ b/test/cases/image_tests.sh @@ -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 diff --git a/test/cases/koji.sh b/test/cases/koji.sh index 59b8abe48..3b0d94879 100755 --- a/test/cases/koji.sh +++ b/test/cases/koji.sh @@ -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 \ diff --git a/test/cases/ostree.sh b/test/cases/ostree.sh index 0fdb3c0ba..beadd8f0d 100755 --- a/test/cases/ostree.sh +++ b/test/cases/ostree.sh @@ -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 diff --git a/test/cases/qemu.sh b/test/cases/qemu.sh index 737557e99..5eb7c4968 100755 --- a/test/cases/qemu.sh +++ b/test/cases/qemu.sh @@ -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} diff --git a/tools/deploy/test/files/run/provision-scripts/provision.sh b/tools/deploy/test/files/run/provision-scripts/provision.sh deleted file mode 120000 index abfbb2295..000000000 --- a/tools/deploy/test/files/run/provision-scripts/provision.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../../../schutzbot/provision.sh \ No newline at end of file diff --git a/tools/deploy/test/user-data.yml b/tools/deploy/test/user-data.yml index a932cf87b..0ec6eed63 100644 --- a/tools/deploy/test/user-data.yml +++ b/tools/deploy/test/user-data.yml @@ -17,4 +17,3 @@ chpasswd: sudo: 'ALL=(ALL) NOPASSWD:ALL' runcmd: - /run/provision-scripts/deploy.sh - - /run/provision-scripts/provision.sh diff --git a/schutzbot/provision.sh b/tools/provision.sh similarity index 100% rename from schutzbot/provision.sh rename to tools/provision.sh