about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorteutat3s <10206665+teutat3s@users.noreply.github.com>2023-05-14 18:01:58 +0200
committerteutat3s <10206665+teutat3s@users.noreply.github.com>2023-05-14 18:01:58 +0200
commitb3915bd5e2f03eb3a7f96f77a53f0bb5bfb81bd6 (patch)
tree8438febb395109d7442cf7c61ce2a9fced2787cc /nixos
parent897876e4c484f1e8f92009fd11b7d988a121a4e7 (diff)
nixosTests.prometheus-exporters.wireguard: fix test script
A newline in the public key breaks the test script, stripping it out
fixes the test.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/prometheus-exporters.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix
index 82d50da638183..adc2b467be514 100644
--- a/nixos/tests/prometheus-exporters.nix
+++ b/nixos/tests/prometheus-exporters.nix
@@ -1396,7 +1396,10 @@ let
       '';
     };
 
-    wireguard = let snakeoil = import ./wireguard/snakeoil-keys.nix; in
+    wireguard = let
+      snakeoil = import ./wireguard/snakeoil-keys.nix;
+      publicKeyWithoutNewlines = replaceStrings [ "\n" ] [ "" ] snakeoil.peer1.publicKey;
+    in
       {
         exporterConfig.enable = true;
         metricProvider = {
@@ -1418,7 +1421,7 @@ let
           wait_for_unit("prometheus-wireguard-exporter.service")
           wait_for_open_port(9586)
           wait_until_succeeds(
-              "curl -sSf http://localhost:9586/metrics | grep '${snakeoil.peer1.publicKey}'"
+              "curl -sSf http://localhost:9586/metrics | grep '${publicKeyWithoutNewlines}'"
           )
         '';
       };