Skip to content

Commit 6fad7d1

Browse files
authored
Avoid using host system socket for logs tests (#5825)
Make sure we mock the systemd journal gateway socket for tests. This makes the test work on systems which have systemd-journal-gatewayd installed.
1 parent f731713 commit 6fad7d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/api/test_host.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,11 @@ async def test_advanced_logs_formatters(
355355
journal_logs_reader.assert_called_once_with(ANY, LogFormatter.VERBOSE)
356356

357357

358-
async def test_advanced_logs_errors(api_client: TestClient):
358+
async def test_advanced_logs_errors(coresys: CoreSys, api_client: TestClient):
359359
"""Test advanced logging API errors."""
360-
# coresys = coresys_logs_control
361360
with patch("supervisor.host.logs.SYSTEMD_JOURNAL_GATEWAYD_SOCKET") as socket:
362361
socket.is_socket.return_value = False
362+
await coresys.host.logs.post_init()
363363
resp = await api_client.get("/host/logs")
364364
assert resp.content_type == "text/plain"
365365
assert resp.status == 400

0 commit comments

Comments
 (0)