diff options
author | Martin Weinelt <hexa@darmstadt.ccc.de> | 2023-04-17 23:49:13 +0200 |
---|---|---|
committer | Martin Weinelt <hexa@darmstadt.ccc.de> | 2023-11-10 22:00:38 +0100 |
commit | c85cecedf1716044bb67bf1b7b4d36b47a3cc75a (patch) | |
tree | 597dbbbae8a9fe47e37ef651b08cfa333f90ba57 /nixos/tests | |
parent | 8108ce0a4f9af0d50100ddc9fcbbc8db704ca677 (diff) | |
download | nixpkgs-c85cecedf1716044bb67bf1b7b4d36b47a3cc75a.tar nixpkgs-c85cecedf1716044bb67bf1b7b4d36b47a3cc75a.tar.gz nixpkgs-c85cecedf1716044bb67bf1b7b4d36b47a3cc75a.tar.bz2 nixpkgs-c85cecedf1716044bb67bf1b7b4d36b47a3cc75a.tar.lz nixpkgs-c85cecedf1716044bb67bf1b7b4d36b47a3cc75a.tar.xz nixpkgs-c85cecedf1716044bb67bf1b7b4d36b47a3cc75a.tar.zst nixpkgs-c85cecedf1716044bb67bf1b7b4d36b47a3cc75a.zip |
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.
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/home-assistant.nix | 15 |
1 files changed, 15 insertions, 0 deletions
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") |