From 65234f091107959952095e2e45f5a4dd1d087004 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 15 Apr 2021 03:18:07 +0200 Subject: [PATCH 1/2] nixos/test/prometheus-exporters/bird: fix race condition The bird socket would not always be instantly present, when the exporter was queried, leading to the test sometimes failing in its entirety. --- nixos/tests/prometheus-exporters.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix index 62c0080dd516..cf3518286fdd 100644 --- a/nixos/tests/prometheus-exporters.nix +++ b/nixos/tests/prometheus-exporters.nix @@ -132,7 +132,9 @@ let exporterTest = '' wait_for_unit("prometheus-bird-exporter.service") wait_for_open_port(9324) - succeed("curl -sSf http://localhost:9324/metrics | grep -q 'MyObviousTestString'") + wait_until_succeeds( + "curl -sSf http://localhost:9324/metrics | grep -q 'MyObviousTestString'" + ) ''; }; From fc55a1bdd4a863e354c3b7fa8bf19fb874949124 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 23 Apr 2021 23:34:26 +0200 Subject: [PATCH 2/2] nixos/tests/prometheus-exporters/bird: set router id Previously bird would refuse to start up because the router id wasn't set. > bird[682]: Cannot determine router ID, please configure it manually --- nixos/tests/prometheus-exporters.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix index cf3518286fdd..9aa430c25a4f 100644 --- a/nixos/tests/prometheus-exporters.nix +++ b/nixos/tests/prometheus-exporters.nix @@ -118,6 +118,8 @@ let metricProvider = { services.bird2.enable = true; services.bird2.config = '' + router id 127.0.0.1; + protocol kernel MyObviousTestString { ipv4 { import all;