about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorLuke Granger-Brown <git@lukegb.com>2021-06-07 01:59:41 +0100
committerGitHub <noreply@github.com>2021-06-07 01:59:41 +0100
commit91fb672b21186518df838c61d2614d765b12f6eb (patch)
treef71439232ff10d7d4c6e8f8d58a94b2037599d52 /nixos/tests
parentdb6597edf4c6148b9c6dd9b34de816a4930ef8de (diff)
parent3bcf4e31ef70e2d6ec3fd387c174673aa01ef736 (diff)
Merge pull request #125573 from Flakebi/prometheus-script-exporter
prometheus-script-exporter: init at 1.2.0
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/prometheus-exporters.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix
index 17b71e82ed21d..69a9a6b232181 100644
--- a/nixos/tests/prometheus-exporters.nix
+++ b/nixos/tests/prometheus-exporters.nix
@@ -964,6 +964,24 @@ let
       '';
     };
 
+    script = {
+      exporterConfig = {
+        enable = true;
+        settings.scripts = [
+          { name = "success"; script = "sleep 1"; }
+        ];
+      };
+      exporterTest = ''
+        wait_for_unit("prometheus-script-exporter.service")
+        wait_for_open_port(9172)
+        wait_until_succeeds(
+            "curl -sSf 'localhost:9172/probe?name=success' | grep -q '{}'".format(
+                'script_success{script="success"} 1'
+            )
+        )
+      '';
+    };
+
     smokeping = {
       exporterConfig = {
         enable = true;