From c85cecedf1716044bb67bf1b7b4d36b47a3cc75a Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 17 Apr 2023 23:49:13 +0200 Subject: nixos/tests/home-assistant: test custom things cleanup Make sure we properly remove custom components and custom lovelace modules, when they're not configured anymore. --- nixos/tests/home-assistant.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'nixos/tests') diff --git a/nixos/tests/home-assistant.nix b/nixos/tests/home-assistant.nix index 0fa0d498738..e97e8a467b1 100644 --- a/nixos/tests/home-assistant.nix +++ b/nixos/tests/home-assistant.nix @@ -124,6 +124,14 @@ in { inheritParentConfig = true; configuration.services.home-assistant.config.backup = {}; }; + + specialisation.removeCustomThings = { + inheritParentConfig = true; + configuration.services.home-assistant = { + customComponents = lib.mkForce []; + customLovelaceModules = lib.mkForce []; + }; + }; }; testScript = { nodes, ... }: let @@ -218,6 +226,13 @@ in { for domain in ["backup"]: assert f"Setup of domain {domain} took" in journal, f"{domain} setup missing" + with subtest("Check custom components and custom lovelace modules get removed"): + cursor = get_journal_cursor() + hass.succeed("${system}/specialisation/removeCustomThings/bin/switch-to-configuration test") + hass.fail("grep -q 'mini-graph-card-bundle.js' '${configDir}/ui-lovelace.yaml'") + hass.fail("test -f ${configDir}/custom_components/prometheus_sensor/manifest.json") + wait_for_homeassistant(cursor) + with subtest("Check that no errors were logged"): hass.fail("journalctl -u home-assistant -o cat | grep -q ERROR") -- cgit 1.4.1