diff --git a/Dockerfile b/Dockerfile index 3f0acb0a8..d9723d993 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,9 +44,19 @@ RUN set -x && \ # copy test suite COPY ./dnf-behave-tests/ /opt/ci/dnf-behave-tests +# remove dnf5 and exclude it to ensure we test old dnf +RUN set -x && \ + dnf -y remove dnf5 --setopt=protected_packages=,; \ + echo "excludepkgs=dnf5*" >> /etc/dnf/dnf.conf + +# On Fedora > 40 the symlinks to dnf-3 and yum are missing (because dnf5 provides dnf), add them manually +RUN set -x && \ + ln -sf /usr/bin/dnf-3 /usr/bin/dnf; \ + ln -sf /usr/bin/dnf-3 /usr/bin/yum + # install test suite dependencies RUN set -x && \ - dnf -y builddep /opt/ci/dnf-behave-tests/requirements.spec --exclude=dnf5 && \ + dnf -y builddep /opt/ci/dnf-behave-tests/requirements.spec && \ pip3 install -r /opt/ci/dnf-behave-tests/requirements.txt # install local RPMs if available diff --git a/dnf-behave-tests/requirements.spec b/dnf-behave-tests/requirements.spec index 0a8fe4f62..a412b02aa 100644 --- a/dnf-behave-tests/requirements.spec +++ b/dnf-behave-tests/requirements.spec @@ -42,9 +42,16 @@ BuildRequires: zchunk # tested packages BuildRequires: createrepo_c +# For newer fedoras we don't build dnf-automatic and dnf/yum packages because of dnf5 +# https://github.com/rpm-software-management/dnf/commit/f519e602a70ce6d3494a9d9d70464187eb9c263e +# https://github.com/rpm-software-management/dnf/commit/d50a6b2a63976bd3e4a0cf99b53aa9cfc189f68a +%if 0%{?fedora} < 41 BuildRequires: dnf BuildRequires: dnf-automatic BuildRequires: yum +%else +BuildRequires: python3-dnf +%endif BuildRequires: dnf-plugins-core BuildRequires: dnf-utils