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