diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix index 82d50da63818..adc2b467be51 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}'" ) ''; };