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