From af31b1f5daf5245045f973e598d007b693f4b32d Mon Sep 17 00:00:00 2001 From: Matteo Stifano Date: Tue, 8 Oct 2024 08:47:28 +0200 Subject: [PATCH] Remove references to Centos-* distros in 'tests' modules Tests do not run on Centos-* distros anymore within the CI. Change-Id: I52950000f97d803f0e8c12d7cb56d5887ccebb2c --- tests/composition/conftest.py | 2 +- tests/composition/test_automatic_host_removal.py | 2 +- tests/integration/omd/test_linked_libraries.py | 2 +- tests/testlib/utils.py | 4 ++-- tests/testlib/version.py | 6 ------ 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/tests/composition/conftest.py b/tests/composition/conftest.py index 82ec1d91468..c67a5da2ade 100644 --- a/tests/composition/conftest.py +++ b/tests/composition/conftest.py @@ -125,7 +125,7 @@ def _run_cron() -> Iterator[None]: for cron_cmd in ( cron_cmds := ( "cron", # Ubuntu, Debian, ... - "crond", # RHEL (CentOS, AlmaLinux) + "crond", # RHEL (AlmaLinux) ) ): try: diff --git a/tests/composition/test_automatic_host_removal.py b/tests/composition/test_automatic_host_removal.py index 1a191329ee2..8441c6d2780 100644 --- a/tests/composition/test_automatic_host_removal.py +++ b/tests/composition/test_automatic_host_removal.py @@ -17,7 +17,7 @@ @skip_if_saas_edition @pytest.mark.xfail( - condition=os.getenv("DISTRO") in ("almalinux-9", "centos-8"), + condition=os.getenv("DISTRO") == "almalinux-9", reason="May fail on EL* systems, investigating.", ) def test_automatic_host_removal( diff --git a/tests/integration/omd/test_linked_libraries.py b/tests/integration/omd/test_linked_libraries.py index a49f804c43a..da1937fb0dc 100644 --- a/tests/integration/omd/test_linked_libraries.py +++ b/tests/integration/omd/test_linked_libraries.py @@ -160,7 +160,7 @@ def test_linked_libraries(site: Site) -> None: # libs found in the seccli directory continue if lib.name == "libnsl.so.1": - # This link is also broken, at least on centos 8. To be investigated. + # This link is also broken. To be investigated. continue assert False, f"seccli file {file} linked to a non-existing library" diff --git a/tests/testlib/utils.py b/tests/testlib/utils.py index 0c3af0abcda..0008cef27fd 100644 --- a/tests/testlib/utils.py +++ b/tests/testlib/utils.py @@ -431,7 +431,7 @@ def makedirs(path: str | Path, sudo: bool = True, substitute_user: str | None = def restart_httpd() -> None: """Restart Apache manually on RHEL-based containers. - On RHEL-based containers, such as CentOS and AlmaLinux, the system Apache is not running. + On RHEL-based containers, such as AlmaLinux, the system Apache is not running. OMD will not start Apache, if it is not running already. If a distro uses an `INIT_CMD`, which is not available inside of docker, then the system @@ -445,7 +445,7 @@ def restart_httpd() -> None: """ # When executed locally and un-dockerized, DISTRO may not be set - if os.environ.get("DISTRO") in {"centos-8", "almalinux-9"}: + if os.environ.get("DISTRO") == "almalinux-9": run(["httpd", "-k", "restart"], sudo=True) diff --git a/tests/testlib/version.py b/tests/testlib/version.py index e3c4d1fe1df..88831f5ccb1 100644 --- a/tests/testlib/version.py +++ b/tests/testlib/version.py @@ -273,12 +273,6 @@ def get_omd_distro_name() -> str: rh = Path("/etc/redhat-release") if rh.exists(): content = rh.read_text() - if content.startswith("CentOS release 6"): - return "el6" - if content.startswith("CentOS Linux release 7"): - return "el7" - if content.startswith("CentOS Linux release 8"): - return "el8" if content.startswith("AlmaLinux release 9"): return "el9" raise NotImplementedError()