From 21a671c1acd2225c3d4defcdd6298d83b6b89b40 Mon Sep 17 00:00:00 2001 From: Thomas Gerbet Date: Sun, 18 Feb 2024 19:09:06 +0100 Subject: [PATCH] nixosTests.prometheus-exporters.dnsmasq: wait for DNSMasq before testing the exporter When DNSMasq is not yet completly started trying to call the exporter fails. --- nixos/tests/prometheus-exporters.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix index 7e74f27174ec..632656ad5795 100644 --- a/nixos/tests/prometheus-exporters.nix +++ b/nixos/tests/prometheus-exporters.nix @@ -218,6 +218,9 @@ let services.dnsmasq.enable = true; }; exporterTest = '' + wait_for_unit("dnsmasq.service") + wait_for_open_port(53) + wait_for_file("/var/lib/dnsmasq/dnsmasq.leases") wait_for_unit("prometheus-dnsmasq-exporter.service") wait_for_open_port(9153) succeed("curl -sSf http://localhost:9153/metrics | grep 'dnsmasq_leases 0'")