From e6c57dfc80219854f03fbf538e519daec5ffd16b Mon Sep 17 00:00:00 2001 From: Mike Degatano Date: Thu, 25 Mar 2021 06:43:34 -0400 Subject: [PATCH] Fix typo in journald location (#2751) * Fix typo in journal location * Patch pathlib.Path.exists to ensure false return for test --- supervisor/const.py | 2 +- tests/docker/test_addon.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/supervisor/const.py b/supervisor/const.py index 9e69a7aec..b757d8218 100644 --- a/supervisor/const.py +++ b/supervisor/const.py @@ -27,7 +27,7 @@ MACHINE_ID = Path("/etc/machine-id") SOCKET_DBUS = Path("/run/dbus/system_bus_socket") SOCKET_DOCKER = Path("/run/docker.sock") RUN_SUPERVISOR_STATE = Path("/run/supervisor") -SYSTEMD_JOURNAL_PERSISTENT = Path("/var/logs/journal") +SYSTEMD_JOURNAL_PERSISTENT = Path("/var/log/journal") SYSTEMD_JOURNAL_VOLATILE = Path("/run/log/journal") DOCKER_NETWORK = "hassio" diff --git a/tests/docker/test_addon.py b/tests/docker/test_addon.py index 82054be25..51076f437 100644 --- a/tests/docker/test_addon.py +++ b/tests/docker/test_addon.py @@ -99,10 +99,11 @@ def test_addon_map_folder_defaults( def test_journald_addon_volatile(coresys: CoreSys, addonsdata_system: Dict[str, Data]): """Validate volume for journald option, with volatile logs.""" - docker_addon = get_docker_addon( - coresys, addonsdata_system, "journald-addon-config.json" - ) - volumes = docker_addon.volumes + with patch("pathlib.Path.exists", return_value=False): + docker_addon = get_docker_addon( + coresys, addonsdata_system, "journald-addon-config.json" + ) + volumes = docker_addon.volumes assert str(SYSTEMD_JOURNAL_PERSISTENT) in volumes assert volumes.get(str(SYSTEMD_JOURNAL_PERSISTENT)).get("bind") == str(