Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make advanced logs error test work in all test environments #5692

Merged
merged 1 commit into from
Feb 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions tests/api/test_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,13 @@ async def test_advanced_logs_formatters(
async def test_advanced_logs_errors(api_client: TestClient):
"""Test advanced logging API errors."""
# coresys = coresys_logs_control
resp = await api_client.get("/host/logs")
assert resp.content_type == "text/plain"
assert resp.status == 400
content = await resp.text()
assert content == "No systemd-journal-gatewayd Unix socket available"
with patch("supervisor.host.logs.SYSTEMD_JOURNAL_GATEWAYD_SOCKET") as socket:
socket.is_socket.return_value = False
resp = await api_client.get("/host/logs")
assert resp.content_type == "text/plain"
assert resp.status == 400
content = await resp.text()
assert content == "No systemd-journal-gatewayd Unix socket available"

headers = {"Accept": "application/json"}
resp = await api_client.get("/host/logs", headers=headers)
Expand Down