From 9b0044edd6cc32ff608e59294aa6b0aa73d9a532 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 30 Apr 2025 19:59:09 +0200 Subject: [PATCH] Avoid using host system socket for systemd journald tests (#5858) Similar to #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. --- .../resolution/evaluation/test_evaluate_systemd_journal.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/resolution/evaluation/test_evaluate_systemd_journal.py b/tests/resolution/evaluation/test_evaluate_systemd_journal.py index ddf4a7d90..947cdeb7a 100644 --- a/tests/resolution/evaluation/test_evaluate_systemd_journal.py +++ b/tests/resolution/evaluation/test_evaluate_systemd_journal.py @@ -22,7 +22,11 @@ async def test_evaluation_unsupported(coresys: CoreSys): systemd_journal = EvaluateSystemdJournal(coresys) await coresys.core.set_state(CoreState.SETUP) - await systemd_journal() + with patch("supervisor.host.logs.SYSTEMD_JOURNAL_GATEWAYD_SOCKET") as socket: + socket.is_socket.return_value = False + await coresys.host.logs.post_init() + await systemd_journal() + assert systemd_journal.reason in coresys.resolution.unsupported