From a60bb2f04ac7c47f48f0367c8d09e8f5cbbaf327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Mon, 7 Apr 2025 14:08:23 +0200 Subject: [PATCH] Test: allow erasing packages when installing build deps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It became a common thing that the SUT has newer selinux-policy installed than the version available in the configured repositories. osbuild has a build dependency on selinux-policy-devel, which installation fails in such case (there is no `*-devel` package with of the installed version available in the configured repositories). None of the other workarounds actually work consistently, so fall back to allowing DNF to downgrade the installed selinux-policy on SUT. Signed-off-by: Tomáš Hozza --- tests/unit-tests/prep-host-environment.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/unit-tests/prep-host-environment.sh b/tests/unit-tests/prep-host-environment.sh index f0c54cc..eb19934 100755 --- a/tests/unit-tests/prep-host-environment.sh +++ b/tests/unit-tests/prep-host-environment.sh @@ -48,7 +48,10 @@ sudo dnf install -y \ rpm-ostree \ dosfstools \ gdisk -sudo dnf builddep -y osbuild.spec + +# Allow erasing, since the SUT sometimes has a newer selinux-policy installed than the one available +# in the host repos, which makes the installation of selinux-policy-devel fail. +sudo dnf builddep -y --allowerasing --nobest osbuild.spec # Install pytst from pip, because the version in some RHEL / CentOS releases is too old sudo pip3 install pytest