From aa8513c20d53192e2107fad87e2d35100d3b2bc8 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Mon, 28 Sep 2020 15:05:23 +0200 Subject: [PATCH] test: move container/ into test/ Move the container directory, containing the container definitions for all the test containers, to test/, where all the other test- related files are located (with the exception of `Schutzbot`). Use `test/build-container.sh` to build the container, instead of replicating that in `test-integration.sh`. --- test/build-container.sh | 4 ++-- {container => test/container}/brew.repo | 0 .../container}/builder/Dockerfile.fedora | 6 +++--- .../container}/builder/Dockerfile.rhel | 10 +++++----- {container => test/container}/builder/kojid.conf | 0 .../container}/builder/osbuild-koji.conf | 0 .../container}/builder/osbuild.krb5.conf | 0 {container => test/container}/builder/run-kojid.sh | 0 .../container}/hub/Dockerfile.fedora | 10 +++++----- {container => test/container}/hub/Dockerfile.rhel | 14 +++++++------- {container => test/container}/hub/hub.conf | 0 {container => test/container}/hub/kojiweb.conf | 0 .../container}/hub/plugin/osbuild.py | 0 {container => test/container}/hub/run-hub.sh | 0 {container => test/container}/hub/ssl.conf | 0 {container => test/container}/hub/web.conf | 0 {container => test/container}/rhel.repo | 0 test/integration.sh | 3 +-- test/run-builder.sh | 2 +- 19 files changed, 24 insertions(+), 25 deletions(-) rename {container => test/container}/brew.repo (100%) rename {container => test/container}/builder/Dockerfile.fedora (68%) rename {container => test/container}/builder/Dockerfile.rhel (55%) rename {container => test/container}/builder/kojid.conf (100%) rename {container => test/container}/builder/osbuild-koji.conf (100%) rename {container => test/container}/builder/osbuild.krb5.conf (100%) rename {container => test/container}/builder/run-kojid.sh (100%) rename {container => test/container}/hub/Dockerfile.fedora (52%) rename {container => test/container}/hub/Dockerfile.rhel (55%) rename {container => test/container}/hub/hub.conf (100%) rename {container => test/container}/hub/kojiweb.conf (100%) rename {container => test/container}/hub/plugin/osbuild.py (100%) rename {container => test/container}/hub/run-hub.sh (100%) rename {container => test/container}/hub/ssl.conf (100%) rename {container => test/container}/hub/web.conf (100%) rename {container => test/container}/rhel.repo (100%) diff --git a/test/build-container.sh b/test/build-container.sh index 14eb98d..a7e681f 100755 --- a/test/build-container.sh +++ b/test/build-container.sh @@ -11,8 +11,8 @@ source /etc/os-release podman build \ -t koji.hub \ - -f container/hub/Dockerfile.${ID} . + -f test/container/hub/Dockerfile.${ID} . podman build -t \ koji.builder \ - -f container/builder/Dockerfile.${ID} . + -f test/container/builder/Dockerfile.${ID} . diff --git a/container/brew.repo b/test/container/brew.repo similarity index 100% rename from container/brew.repo rename to test/container/brew.repo diff --git a/container/builder/Dockerfile.fedora b/test/container/builder/Dockerfile.fedora similarity index 68% rename from container/builder/Dockerfile.fedora rename to test/container/builder/Dockerfile.fedora index cb1743a..6925a17 100644 --- a/container/builder/Dockerfile.fedora +++ b/test/container/builder/Dockerfile.fedora @@ -13,9 +13,9 @@ RUN dnf -y upgrade \ python3-requests \ && dnf clean all -COPY container/builder/kojid.conf /etc/kojid/kojid.conf +COPY test/container/builder/kojid.conf /etc/kojid/kojid.conf COPY plugins/builder/osbuild.py /usr/lib/koji-builder-plugins/ -COPY container/builder/run-kojid.sh /app/run-kojid.sh -COPY container/builder/osbuild.krb5.conf /etc/krb5.conf.d/ +COPY test/container/builder/run-kojid.sh /app/run-kojid.sh +COPY test/container/builder/osbuild.krb5.conf /etc/krb5.conf.d/ ENTRYPOINT /app/run-kojid.sh diff --git a/container/builder/Dockerfile.rhel b/test/container/builder/Dockerfile.rhel similarity index 55% rename from container/builder/Dockerfile.rhel rename to test/container/builder/Dockerfile.rhel index a58aab5..e0ce8e8 100644 --- a/container/builder/Dockerfile.rhel +++ b/test/container/builder/Dockerfile.rhel @@ -1,7 +1,7 @@ FROM registry.access.redhat.com/ubi8/ubi:latest -COPY container/rhel.repo /etc/yum.repos.d/ -COPY container/brew.repo /etc/yum.repos.d/ +COPY test/container/rhel.repo /etc/yum.repos.d/ +COPY test/container/brew.repo /etc/yum.repos.d/ RUN dnf -y upgrade \ && dnf -y \ @@ -14,9 +14,9 @@ RUN dnf -y upgrade \ python3-requests \ && dnf clean all -COPY container/builder/kojid.conf /etc/kojid/kojid.conf +COPY test/container/builder/kojid.conf /etc/kojid/kojid.conf COPY plugins/builder/osbuild.py /usr/lib/koji-builder-plugins/ -COPY container/builder/run-kojid.sh /app/run-kojid.sh -COPY container/builder/osbuild.krb5.conf /etc/krb5.conf.d/ +COPY test/container/builder/run-kojid.sh /app/run-kojid.sh +COPY test/container/builder/osbuild.krb5.conf /etc/krb5.conf.d/ ENTRYPOINT /app/run-kojid.sh diff --git a/container/builder/kojid.conf b/test/container/builder/kojid.conf similarity index 100% rename from container/builder/kojid.conf rename to test/container/builder/kojid.conf diff --git a/container/builder/osbuild-koji.conf b/test/container/builder/osbuild-koji.conf similarity index 100% rename from container/builder/osbuild-koji.conf rename to test/container/builder/osbuild-koji.conf diff --git a/container/builder/osbuild.krb5.conf b/test/container/builder/osbuild.krb5.conf similarity index 100% rename from container/builder/osbuild.krb5.conf rename to test/container/builder/osbuild.krb5.conf diff --git a/container/builder/run-kojid.sh b/test/container/builder/run-kojid.sh similarity index 100% rename from container/builder/run-kojid.sh rename to test/container/builder/run-kojid.sh diff --git a/container/hub/Dockerfile.fedora b/test/container/hub/Dockerfile.fedora similarity index 52% rename from container/hub/Dockerfile.fedora rename to test/container/hub/Dockerfile.fedora index b2d5cd3..c992b28 100644 --- a/container/hub/Dockerfile.fedora +++ b/test/container/hub/Dockerfile.fedora @@ -9,12 +9,12 @@ RUN dnf -y upgrade \ python3-jsonschema \ && dnf clean all -COPY container/hub/hub.conf /etc/koji-hub/hub.conf -COPY container/hub/ssl.conf /etc/httpd/conf.d/ssl.conf +COPY test/container/hub/hub.conf /etc/koji-hub/hub.conf +COPY test/container/hub/ssl.conf /etc/httpd/conf.d/ssl.conf COPY plugins/hub/osbuild.py /usr/lib/koji-hub-plugins/ -COPY container/hub/run-hub.sh /app/run-hub.sh +COPY test/container/hub/run-hub.sh /app/run-hub.sh -COPY container/hub/web.conf /etc/kojiweb/web.conf -COPY container/hub/kojiweb.conf /etc/httpd/conf.d/kojiweb.conf +COPY test/container/hub/web.conf /etc/kojiweb/web.conf +COPY test/container/hub/kojiweb.conf /etc/httpd/conf.d/kojiweb.conf ENTRYPOINT /app/run-hub.sh diff --git a/container/hub/Dockerfile.rhel b/test/container/hub/Dockerfile.rhel similarity index 55% rename from container/hub/Dockerfile.rhel rename to test/container/hub/Dockerfile.rhel index 5a6cc13..f558816 100644 --- a/container/hub/Dockerfile.rhel +++ b/test/container/hub/Dockerfile.rhel @@ -1,7 +1,7 @@ FROM registry.access.redhat.com/ubi8/ubi:latest -COPY container/rhel.repo /etc/yum.repos.d/ -COPY container/brew.repo /etc/yum.repos.d/ +COPY test/container/rhel.repo /etc/yum.repos.d/ +COPY test/container/brew.repo /etc/yum.repos.d/ # koji db schema is in docs, remove nodocs from from dnf config RUN sed -i '/^tsflags=nodocs$/d' /etc/dnf/dnf.conf @@ -18,12 +18,12 @@ RUN dnf -y upgrade \ python3-jsonschema \ && dnf clean all -COPY container/hub/hub.conf /etc/koji-hub/hub.conf -COPY container/hub/ssl.conf /etc/httpd/conf.d/ssl.conf +COPY test/container/hub/hub.conf /etc/koji-hub/hub.conf +COPY test/container/hub/ssl.conf /etc/httpd/conf.d/ssl.conf COPY plugins/hub/osbuild.py /usr/lib/koji-hub-plugins/ -COPY container/hub/run-hub.sh /app/run-hub.sh +COPY test/container/hub/run-hub.sh /app/run-hub.sh -COPY container/hub/web.conf /etc/kojiweb/web.conf -COPY container/hub/kojiweb.conf /etc/httpd/conf.d/kojiweb.conf +COPY test/container/hub/web.conf /etc/kojiweb/web.conf +COPY test/container/hub/kojiweb.conf /etc/httpd/conf.d/kojiweb.conf ENTRYPOINT /app/run-hub.sh diff --git a/container/hub/hub.conf b/test/container/hub/hub.conf similarity index 100% rename from container/hub/hub.conf rename to test/container/hub/hub.conf diff --git a/container/hub/kojiweb.conf b/test/container/hub/kojiweb.conf similarity index 100% rename from container/hub/kojiweb.conf rename to test/container/hub/kojiweb.conf diff --git a/container/hub/plugin/osbuild.py b/test/container/hub/plugin/osbuild.py similarity index 100% rename from container/hub/plugin/osbuild.py rename to test/container/hub/plugin/osbuild.py diff --git a/container/hub/run-hub.sh b/test/container/hub/run-hub.sh similarity index 100% rename from container/hub/run-hub.sh rename to test/container/hub/run-hub.sh diff --git a/container/hub/ssl.conf b/test/container/hub/ssl.conf similarity index 100% rename from container/hub/ssl.conf rename to test/container/hub/ssl.conf diff --git a/container/hub/web.conf b/test/container/hub/web.conf similarity index 100% rename from container/hub/web.conf rename to test/container/hub/web.conf diff --git a/container/rhel.repo b/test/container/rhel.repo similarity index 100% rename from container/rhel.repo rename to test/container/rhel.repo diff --git a/test/integration.sh b/test/integration.sh index 60ae31d..0f36de4 100755 --- a/test/integration.sh +++ b/test/integration.sh @@ -43,8 +43,7 @@ greenprint "Creating composer SSL certificates" sudo test/make-certs.sh greenprint "Building containers" -sudo podman build -t koji.hub -f container/hub/Dockerfile.${ID} . -sudo podman build -t koji.builder -f container/builder/Dockerfile.${ID} . +sudo test/build-container.sh greenprint "Starting containers" sudo test/run-koji-container.sh start diff --git a/test/run-builder.sh b/test/run-builder.sh index 0889b69..3839f70 100755 --- a/test/run-builder.sh +++ b/test/run-builder.sh @@ -28,7 +28,7 @@ builder_start() { --name org.osbuild.koji.builder --network org.osbuild.koji \ -v "${SHARE_DIR}:/share:z" \ -v "${DATA_DIR}:/mnt:z" \ - -v "${PWD}/container/builder/osbuild-koji.conf:/etc/koji-osbuild/builder.conf:z" \ + -v "${PWD}/test/container/builder/osbuild-koji.conf:/etc/koji-osbuild/builder.conf:z" \ --hostname org.osbuild.koji.kojid \ --add-host=composer:${GATEWAY_IP} \ koji.builder