about summary refs log tree commit diff
path: root/nixos/tests/adguardhome.nix
diff options
context:
space:
mode:
authorCarl Richard Theodor Schneider <dev.github@crtified.me>2022-10-30 18:34:01 +0100
committerWinter <winter@winter.cafe>2022-11-15 23:43:15 -0500
commit647ed242dcfbebd62b5f5e6880da347ac705544f (patch)
treeb55452ef13720619659935bf89478dced133b07d /nixos/tests/adguardhome.nix
parent9d1ebafb7b23cd446d774ebfbb88533df66d5de2 (diff)
nixos/adguardhome: allow for empty/unmanaged configs
This commit fixes broken non-declarative configs by
making the assertions more relaxed.
It also allows to remove the forced configuration merge by making
`settings` `null`able (now the default).

Both cases (trivial non-declarative config and `null`able config) are
verified with additional tests.

Fixes #198665
Diffstat (limited to 'nixos/tests/adguardhome.nix')
-rw-r--r--nixos/tests/adguardhome.nix16
1 files changed, 16 insertions, 0 deletions
diff --git a/nixos/tests/adguardhome.nix b/nixos/tests/adguardhome.nix
index 5be69e22e5329..ec1cc1e497b50 100644
--- a/nixos/tests/adguardhome.nix
+++ b/nixos/tests/adguardhome.nix
@@ -2,6 +2,15 @@
   name = "adguardhome";
 
   nodes = {
+    nullConf = { ... }: { services.adguardhome = { enable = true; }; };
+
+    emptyConf = { lib, ... }: {
+      services.adguardhome = {
+        enable = true;
+        settings = {};
+      };
+    };
+
     declarativeConf = { ... }: {
       services.adguardhome = {
         enable = true;
@@ -34,6 +43,13 @@
   };
 
   testScript = ''
+    with subtest("Minimal (settings = null) config test"):
+        nullConf.wait_for_unit("adguardhome.service")
+
+    with subtest("Default config test"):
+        emptyConf.wait_for_unit("adguardhome.service")
+        emptyConf.wait_for_open_port(3000)
+
     with subtest("Declarative config test, DNS will be reachable"):
         declarativeConf.wait_for_unit("adguardhome.service")
         declarativeConf.wait_for_open_port(53)