-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build bootc VM image for dnf4 bootc tests
- Loading branch information
1 parent
eacd718
commit 279fe3f
Showing
3 changed files
with
177 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Example Usage: | ||
# $ podman build --build-arg TYPE=distro -t ci-dnf-stack -f Dockerfile | ||
# $ podman run --net none -it ci-dnf-stack behave dnf | ||
|
||
ARG BASE=quay.io/fedora/fedora-bootc:40 | ||
FROM $BASE | ||
|
||
ENV LANG C.UTF-8 | ||
ARG TYPE=nightly | ||
|
||
# disable deltas and weak deps | ||
RUN set -x && \ | ||
echo -e "deltarpm=0" >> /etc/dnf/dnf.conf && \ | ||
echo -e "install_weak_deps=0" >> /etc/dnf/dnf.conf | ||
|
||
# Import extra CA certificates | ||
COPY ./ca-trust/ /etc/pki/ca-trust/source/anchors/ | ||
RUN update-ca-trust | ||
|
||
# Copy extra repo files | ||
COPY ./repos.d/ /etc/yum.repos.d/ | ||
|
||
# enable dnf5 | ||
RUN set -x && \ | ||
dnf -y --refresh upgrade; \ | ||
dnf -y install dnf5 dnf5-plugins; \ | ||
dnf5 -y copr enable rpmsoftwaremanagement/test-utils; \ | ||
dnf5 -y copr enable rpmsoftwaremanagement/dnf-nightly; \ | ||
# run upgrade before distro-sync in case there is a new version in dnf-nightly that has a new dependency | ||
dnf5 -y upgrade; \ | ||
dnf5 -y distro-sync --repo copr:copr.fedorainfracloud.org:rpmsoftwaremanagement:dnf-nightly; | ||
|
||
RUN set -x && \ | ||
if [ -n "$COPR" ] && [ -n "$COPR_RPMS" ]; then \ | ||
dnf5 -y copr enable $COPR; \ | ||
dnf5 -y install $COPR_RPMS; \ | ||
fi | ||
|
||
# TMT | ||
RUN <<EOF | ||
dnf5 -y install cloud-init rsync | ||
ln -s ../cloud-init.target /usr/lib/systemd/system/default.target.wants | ||
rm /usr/local -rf && ln -sr /var/usrlocal /usr/local && mkdir -p /var/usrlocal/bin | ||
TESTCLOUD_GUEST="python3 -m http.server 10022 || python -m http.server 10022 || /usr/libexec/platform-python -m http.server 10022 || python2 -m SimpleHTTPServer 10022 || python -m SimpleHTTPServer 10022" | ||
echo "$TESTCLOUD_GUEST" >> /opt/testcloud-guest.sh | ||
chmod +x /opt/testcloud-guest.sh | ||
echo "[Unit]" >> /etc/systemd/system/testcloud.service | ||
echo "Description=Testcloud guest integration" >> /etc/systemd/system/testcloud.service | ||
echo "After=cloud-init.service" >> /etc/systemd/system/testcloud.service | ||
echo "[Service]" >> /etc/systemd/system/testcloud.service | ||
echo "ExecStart=/bin/bash /opt/testcloud-guest.sh" >> /etc/systemd/system/testcloud.service | ||
echo "[Install]" >> /etc/systemd/system/testcloud.service | ||
echo "WantedBy=multi-user.target" >> /etc/systemd/system/testcloud.service | ||
systemctl enable testcloud.service | ||
EOF | ||
|
||
# copy test suite | ||
COPY ./dnf-behave-tests/ /opt/ci/dnf-behave-tests | ||
|
||
# install test suite dependencies | ||
RUN set -x && \ | ||
dnf5 -y builddep /opt/ci/dnf-behave-tests/requirements.spec && \ | ||
pip3 install -r /opt/ci/dnf-behave-tests/requirements.txt | ||
|
||
# install local RPMs if available | ||
COPY ./rpms/ /opt/ci/rpms/ | ||
RUN rm /opt/ci/rpms/*-{devel,debuginfo,debugsource}*.rpm; \ | ||
if [ -n "$(find /opt/ci/rpms/ -maxdepth 1 -name '*.rpm' -print -quit)" ]; then \ | ||
dnf5 -y install /opt/ci/rpms/*.rpm --disableplugin=local; \ | ||
fi | ||
|
||
# create directory for dbus daemon socket | ||
RUN set -x && \ | ||
mkdir -p /run/dbus | ||
|
||
RUN set -x && \ | ||
rm -rf "/opt/ci/dnf-behave-tests/fixtures/certificates/testcerts/" && \ | ||
rm -rf "/opt/ci/dnf-behave-tests/fixtures/gpgkeys/keys/" && \ | ||
rm -rf "/opt/ci/dnf-behave-tests/fixtures/repos/" | ||
|
||
# build test repos from sources | ||
RUN set -x && \ | ||
cd /opt/ci/dnf-behave-tests/fixtures/specs/ && \ | ||
./build.sh --force-rebuild | ||
|
||
WORKDIR /opt/ci/dnf-behave-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
provision: | ||
how: virtual | ||
image: file://./build/qcow2/disk.qcow2 | ||
connection: system | ||
disk: 20 | ||
summary: Run bootc behave tests | ||
tag: dnf | ||
execute: | ||
how: tmt | ||
script: | | ||
bash -c 'echo hello from bootc behave dnf' | ||
# $TMT_PLANS_DATA/ci-dnf-stack/container-test run_bootc | ||
|