From ff70b269fbc211c07d9cb249c78bfe84d67a6786 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Thu, 22 Oct 2020 17:55:16 +0000 Subject: [PATCH] schutzbot: move repository snapshot definitions to the -test package The test package should be self-contained and contain all the configuration necessary for a known-good test run (minus secrets). This moves repo overrides from the test orchestration into the test package. We want all the external sources (including boot isos and repositories) to be pinned by their content hash, and never use anything that is not strictly defined. This moves us in the right direction, but we still have some tests to update to use these shipped repos rather than official mirrors. One remaining challenge is that we must make sure all our test runners have access to the RHEL snapshots, which is not currently the case for the runners in EC2, but a solution is in the works. Signed-off-by: Tom Gundersen --- osbuild-composer.spec | 3 +++ schutzbot/deploy.sh | 11 ----------- test/cases/api.sh | 2 +- test/cases/ostree.sh | 2 +- {schutzbot => test/data}/repositories/fedora-32.json | 0 {schutzbot => test/data}/repositories/fedora-33.json | 0 .../data}/repositories/rhel-8-beta.json | 0 {schutzbot => test/data}/repositories/rhel-8.json | 0 .../test/files/etc/osbuild-composer/repositories | 1 - tools/provision.sh | 7 +++++++ 10 files changed, 12 insertions(+), 14 deletions(-) rename {schutzbot => test/data}/repositories/fedora-32.json (100%) rename {schutzbot => test/data}/repositories/fedora-33.json (100%) rename {schutzbot => test/data}/repositories/rhel-8-beta.json (100%) rename {schutzbot => test/data}/repositories/rhel-8.json (100%) delete mode 120000 tools/deploy/test/files/etc/osbuild-composer/repositories diff --git a/osbuild-composer.spec b/osbuild-composer.spec index 6d92dfa24..1e1e01e27 100644 --- a/osbuild-composer.spec +++ b/osbuild-composer.spec @@ -210,6 +210,9 @@ install -m 0644 -vp test/data/cloud-init/* %{buildroot}%{_d install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer/composer install -m 0644 -vp test/data/composer/* %{buildroot}%{_datadir}/tests/osbuild-composer/composer/ +install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer/repositories +install -m 0644 -vp test/data/repositories/* %{buildroot}%{_datadir}/tests/osbuild-composer/repositories/ + install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer/kerberos install -m 0644 -vp test/data/kerberos/* %{buildroot}%{_datadir}/tests/osbuild-composer/kerberos/ diff --git a/schutzbot/deploy.sh b/schutzbot/deploy.sh index 944fe87e0..1a8426d60 100755 --- a/schutzbot/deploy.sh +++ b/schutzbot/deploy.sh @@ -51,14 +51,3 @@ fi greenprint "Installing the Image Builder packages" # Note: installing only -tests to catch missing dependencies retry sudo dnf -y install osbuild-composer-tests - -greenprint "Setting up a directory to hold repository overrides for weldr" -sudo mkdir -p /etc/osbuild-composer/repositories - -# Copy Fedora rpmrepo snapshots for use in weldr tests. RHEL's are usually more -# stable, and not available publically from rpmrepo. -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/ \ No newline at end of file diff --git a/test/cases/api.sh b/test/cases/api.sh index 4fc5f9817..28c8971a7 100644 --- a/test/cases/api.sh +++ b/test/cases/api.sh @@ -86,7 +86,7 @@ cat > "$REQUEST_FILE" << EOF { "architecture": "$ARCH", "image_type": "ami", - "repositories": $(jq ".\"$ARCH\"" /etc/tests/osbuild-composer/repositories/"$DISTRO".json), + "repositories": $(jq ".\"$ARCH\"" /usr/share/tests/osbuild-composer/repositories/"$DISTRO".json), "upload_requests": [ { "type": "aws", diff --git a/test/cases/ostree.sh b/test/cases/ostree.sh index beadd8f0d..d93694e79 100755 --- a/test/cases/ostree.sh +++ b/test/cases/ostree.sh @@ -22,7 +22,7 @@ case "${ID}-${VERSION_ID}" in BOOT_LOCATION="https://mirrors.rit.edu/fedora/fedora/linux/releases/32/Everything/x86_64/os/";; "rhel-8.3") # Override old rhel-8-beta.json because test needs latest systemd and redhat-release - sudo cp schutzbot/repositories/rhel-8-beta.json /etc/osbuild-composer/repositories/ + sudo cp /usr/share/tests/osbuild-composer/repositories/rhel-8-beta.json /etc/osbuild-composer/repositories/ sudo systemctl restart osbuild-composer.socket IMAGE_TYPE=rhel-edge-commit OSTREE_REF="rhel/8/${ARCH}/edge" diff --git a/schutzbot/repositories/fedora-32.json b/test/data/repositories/fedora-32.json similarity index 100% rename from schutzbot/repositories/fedora-32.json rename to test/data/repositories/fedora-32.json diff --git a/schutzbot/repositories/fedora-33.json b/test/data/repositories/fedora-33.json similarity index 100% rename from schutzbot/repositories/fedora-33.json rename to test/data/repositories/fedora-33.json diff --git a/schutzbot/repositories/rhel-8-beta.json b/test/data/repositories/rhel-8-beta.json similarity index 100% rename from schutzbot/repositories/rhel-8-beta.json rename to test/data/repositories/rhel-8-beta.json diff --git a/schutzbot/repositories/rhel-8.json b/test/data/repositories/rhel-8.json similarity index 100% rename from schutzbot/repositories/rhel-8.json rename to test/data/repositories/rhel-8.json diff --git a/tools/deploy/test/files/etc/osbuild-composer/repositories b/tools/deploy/test/files/etc/osbuild-composer/repositories deleted file mode 120000 index 38d1c5ab2..000000000 --- a/tools/deploy/test/files/etc/osbuild-composer/repositories +++ /dev/null @@ -1 +0,0 @@ -../../../../../../schutzbot/repositories \ No newline at end of file diff --git a/tools/provision.sh b/tools/provision.sh index 8ce711dca..b942aa178 100755 --- a/tools/provision.sh +++ b/tools/provision.sh @@ -5,6 +5,13 @@ sudo mkdir -p /etc/osbuild-composer sudo cp -a /usr/share/tests/osbuild-composer/composer/*.toml \ /etc/osbuild-composer/ + +# Copy Fedora rpmrepo snapshots for use in weldr tests. RHEL's are usually more +# stable, and not available publically from rpmrepo. +sudo mkdir -p /etc/osbuild-composer/repositories +sudo cp -a /usr/share/tests/osbuild-composer/repositories/fedora-*.json \ + /etc/osbuild-composer/repositories/ + sudo cp -a /usr/share/tests/osbuild-composer/ca/* \ /etc/osbuild-composer/ sudo chown _osbuild-composer /etc/osbuild-composer/composer-*.pem