Skip to content

Commit

Permalink
Fix tests for amazonlinux by installing rsyslog
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeShirnia committed Apr 29, 2024
1 parent 9624979 commit 569037e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ ARG PIP
ARG PYTHON_VERSION

RUN if echo ${IMAGE} | grep -q "amazon"; then \
yum update -y && yum install -y python3-pip; \
# Amazon Linux doesn't have rsyslog installed by default
yum update -y && yum install -y python3-pip rsyslog; \
elif echo ${IMAGE} | grep -q "centos"; then \
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py && \
python get-pip.py; \
Expand Down
2 changes: 1 addition & 1 deletion tests/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_file_processing(self, capsys):

out, _ = capsys.readouterr()
assert "Using Log File: \x1b[0m\x1b[1;32mtests/assets/logs/messages" in out
assert "OOM Incidents: \x1b[0m\x1b[1;31m19\x1b[0m\n" in out
assert "OOM Incidents: \x1b[0m\x1b[1;31m19\x1b[0m" in out
assert "OOM Incident: \x1b[0m\x1b[0;96m19\x1b[0m" in out
assert "Displaying all OOM incidents:" in out

Expand Down
2 changes: 1 addition & 1 deletion tests/test_validate_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TestSystem:

# Skip tests on Amazon Linux and CentOS because they don't have dmesg
@pytest.mark.skipif(
System().get_distro_info()[0] in ["amzn", "centos"],
System().get_distro_info()[0] in ["centos"],
reason="No dmesg in arch container",
)
def test_dmesg(self, capsys):
Expand Down

0 comments on commit 569037e

Please sign in to comment.