mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-15 05:59:17 +03:00
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.
This commit is contained in:
parent
8108ce0a4f
commit
c85cecedf1
1 changed files with 15 additions and 0 deletions
|
@ -124,6 +124,14 @@ in {
|
||||||
inheritParentConfig = true;
|
inheritParentConfig = true;
|
||||||
configuration.services.home-assistant.config.backup = {};
|
configuration.services.home-assistant.config.backup = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
specialisation.removeCustomThings = {
|
||||||
|
inheritParentConfig = true;
|
||||||
|
configuration.services.home-assistant = {
|
||||||
|
customComponents = lib.mkForce [];
|
||||||
|
customLovelaceModules = lib.mkForce [];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
testScript = { nodes, ... }: let
|
testScript = { nodes, ... }: let
|
||||||
|
@ -218,6 +226,13 @@ in {
|
||||||
for domain in ["backup"]:
|
for domain in ["backup"]:
|
||||||
assert f"Setup of domain {domain} took" in journal, f"{domain} setup missing"
|
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"):
|
with subtest("Check that no errors were logged"):
|
||||||
hass.fail("journalctl -u home-assistant -o cat | grep -q ERROR")
|
hass.fail("journalctl -u home-assistant -o cat | grep -q ERROR")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue