summary refs log tree commit diff
path: root/nixos/tests/prometheus-exporters.nix
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2021-04-29 06:00:45 +0200
committerSandro Jäckel <sandro.jaeckel@gmail.com>2021-04-29 06:19:30 +0200
commitda858b16b88cad1ed67662b0fa6f483bb665d498 (patch)
tree0a10c601194e4cfd46b07122ea7964991994d430 /nixos/tests/prometheus-exporters.nix
parentba13dc0652697b6bb05d6977d94271ea0d110de9 (diff)
downloadnixpkgs-da858b16b88cad1ed67662b0fa6f483bb665d498.tar
nixpkgs-da858b16b88cad1ed67662b0fa6f483bb665d498.tar.gz
nixpkgs-da858b16b88cad1ed67662b0fa6f483bb665d498.tar.bz2
nixpkgs-da858b16b88cad1ed67662b0fa6f483bb665d498.tar.lz
nixpkgs-da858b16b88cad1ed67662b0fa6f483bb665d498.tar.xz
nixpkgs-da858b16b88cad1ed67662b0fa6f483bb665d498.tar.zst
nixpkgs-da858b16b88cad1ed67662b0fa6f483bb665d498.zip
nixos/tests/prometheus-exporters: add unbound test
Author: WilliButz <willibutz@posteo.de>
Diffstat (limited to 'nixos/tests/prometheus-exporters.nix')
-rw-r--r--nixos/tests/prometheus-exporters.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix
index 62c0080dd51..55fe7db4db3 100644
--- a/nixos/tests/prometheus-exporters.nix
+++ b/nixos/tests/prometheus-exporters.nix
@@ -1000,6 +1000,29 @@ let
       '';
     };
 
+    unbound = {
+      exporterConfig = {
+        enable = true;
+        fetchType = "uds";
+        controlInterface = "/run/unbound/unbound.ctl";
+      };
+      metricProvider = {
+        services.unbound = {
+          enable = true;
+          localControlSocketPath = "/run/unbound/unbound.ctl";
+        };
+        systemd.services.prometheus-unbound-exporter.serviceConfig = {
+          SupplementaryGroups = [ "unbound" ];
+        };
+      };
+      exporterTest = ''
+        wait_for_unit("unbound.service")
+        wait_for_unit("prometheus-unbound-exporter.service")
+        wait_for_open_port(9167)
+        succeed("curl -sSf localhost:9167/metrics | grep -q 'unbound_up 1'")
+      '';
+    };
+
     varnish = {
       exporterConfig = {
         enable = true;