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.
This commit is contained in:
Stefan Agner 2025-04-30 19:59:09 +02:00 committed by GitHub
parent 9915c21243
commit 9b0044edd6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,7 +22,11 @@ async def test_evaluation_unsupported(coresys: CoreSys):
systemd_journal = EvaluateSystemdJournal(coresys) systemd_journal = EvaluateSystemdJournal(coresys)
await coresys.core.set_state(CoreState.SETUP) await coresys.core.set_state(CoreState.SETUP)
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() await systemd_journal()
assert systemd_journal.reason in coresys.resolution.unsupported assert systemd_journal.reason in coresys.resolution.unsupported