1 import ./make-test-python.nix ({ pkgs, ...}: {
5 imports = [ ../modules/profiles/minimal.nix ];
14 server httpd [::1]:8000
19 http-request use-service prometheus-exporter if { path /metrics }
20 use_backend http_server
25 virtualHosts.localhost = {
26 documentRoot = pkgs.writeTextDir "index.txt" "We are all good!";
27 adminAddr = "notme@yourhost.local";
38 machine.wait_for_unit("multi-user.target")
39 machine.wait_for_unit("haproxy.service")
40 machine.wait_for_unit("httpd.service")
41 assert "We are all good!" in machine.succeed("curl -fk http://localhost:80/index.txt")
42 assert "haproxy_process_pool_allocated_bytes" in machine.succeed(
43 "curl -fk http://localhost:80/metrics"
46 with subtest("reload"):
47 machine.succeed("systemctl reload haproxy")
48 # wait some time to ensure the following request hits the reloaded haproxy
50 assert "We are all good!" in machine.succeed(
51 "curl -fk http://localhost:80/index.txt"