From 56b0c7cf8667589db2938c9d22b8792194efdb5a Mon Sep 17 00:00:00 2001 From: Katerina Koukiou Date: Tue, 9 Jul 2024 10:50:01 +0200 Subject: [PATCH] infra: temporarily install selinux-policy-targeted in container This will unblock container refreshes. This affects also RHEL. Related: https://bugzilla.redhat.com/show_bug.cgi?id=2295428 Related: https://issues.redhat.com/browse/RHEL-46558 Cherry-picked from master branch commit: 56e02693154ff7c1d91ae914592e18cbd9bb3ab7. --- dockerfile/anaconda-ci/Dockerfile | 8 +++++++- .../payload/test_module_payload_dnf_installation.py | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dockerfile/anaconda-ci/Dockerfile b/dockerfile/anaconda-ci/Dockerfile index b8aae3e4037..6e444b572ea 100644 --- a/dockerfile/anaconda-ci/Dockerfile +++ b/dockerfile/anaconda-ci/Dockerfile @@ -16,6 +16,11 @@ RUN set -ex; \ # Prepare environment and install build dependencies RUN set -e; \ dnf update -y; \ + # FIXME + # https://bugzilla.redhat.com/show_bug.cgi?id=2295428 + # https://issues.redhat.com/browse/RHEL-46558 + # Remove selinux-policy targeted when the rhbz / RHEL issue above is fixed + # Install rest of the dependencies dnf install -y \ curl-minimal \ /usr/bin/xargs \ @@ -32,7 +37,8 @@ RUN set -e; \ python3-lxml \ policycoreutils \ python3-gobject-base \ - python3-pip; \ + python3-pip \ + selinux-policy-targeted; \ curl -L https://raw.githubusercontent.com/rhinstaller/anaconda/${git_branch}/anaconda.spec.in | sed 's/@PACKAGE_VERSION@/0/; s/@PACKAGE_RELEASE@/0/; s/%{__python3}/python3/' > /tmp/anaconda.spec; \ rpmspec -q --buildrequires /tmp/anaconda.spec | xargs -d '\n' dnf install -y; \ rpmspec -q --requires /tmp/anaconda.spec | grep -v anaconda | xargs -d '\n' dnf install -y; \ diff --git a/tests/unit_tests/pyanaconda_tests/modules/payloads/payload/test_module_payload_dnf_installation.py b/tests/unit_tests/pyanaconda_tests/modules/payloads/payload/test_module_payload_dnf_installation.py index 518e4d9500e..d4ba362c33f 100644 --- a/tests/unit_tests/pyanaconda_tests/modules/payloads/payload/test_module_payload_dnf_installation.py +++ b/tests/unit_tests/pyanaconda_tests/modules/payloads/payload/test_module_payload_dnf_installation.py @@ -49,7 +49,8 @@ def test_set_rpm_macros_default(self, mock_rpm): data = PackagesConfigurationData() macros = [ - ('__dbi_htconfig', 'hash nofsync %{__dbi_other} %{__dbi_perms}') + ('__dbi_htconfig', 'hash nofsync %{__dbi_other} %{__dbi_perms}'), + ('__file_context_path', '/etc/selinux/targeted/contexts/files/file_contexts') ] task = self._run_task(data) @@ -63,6 +64,7 @@ def test_set_rpm_macros_exclude_docs(self, mock_rpm): macros = [ ('__dbi_htconfig', 'hash nofsync %{__dbi_other} %{__dbi_perms}'), ('_excludedocs', '1'), + ('__file_context_path', '/etc/selinux/targeted/contexts/files/file_contexts') ] task = self._run_task(data) @@ -76,6 +78,7 @@ def test_set_rpm_macros_install_langs(self, mock_rpm): macros = [ ('__dbi_htconfig', 'hash nofsync %{__dbi_other} %{__dbi_perms}'), ('_install_langs', 'en,es'), + ('__file_context_path', '/etc/selinux/targeted/contexts/files/file_contexts') ] task = self._run_task(data) @@ -89,6 +92,7 @@ def test_set_rpm_macros_no_install_langs(self, mock_rpm): macros = [ ('__dbi_htconfig', 'hash nofsync %{__dbi_other} %{__dbi_perms}'), ('_install_langs', '%{nil}'), + ('__file_context_path', '/etc/selinux/targeted/contexts/files/file_contexts') ] task = self._run_task(data)