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 <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2020-10-22 17:55:16 +00:00 committed by Ondřej Budai
parent 0e7a1dd407
commit ff70b269fb
10 changed files with 12 additions and 14 deletions

View file

@ -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/

View file

@ -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/

View file

@ -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",

View file

@ -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"

View file

@ -1 +0,0 @@
../../../../../../schutzbot/repositories

View file

@ -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