Skip to content

Commit

Permalink
Remove references to Centos-* distros in 'tests' modules
Browse files Browse the repository at this point in the history
Tests do not run on Centos-* distros anymore within the CI.

Change-Id: I52950000f97d803f0e8c12d7cb56d5887ccebb2c
  • Loading branch information
MatteoStifano committed Oct 9, 2024
1 parent 5cfc612 commit af31b1f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tests/composition/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/composition/test_automatic_host_removal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/omd/test_linked_libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions tests/testlib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)


Expand Down
6 changes: 0 additions & 6 deletions tests/testlib/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit af31b1f

Please sign in to comment.