summaryrefslogtreecommitdiffstats
path: root/nixos/tests/haproxy.nix
diff options
context:
space:
mode:
authorHugo Geoffroy <pistache@lebib.org>2020-05-20 09:29:27 +0200
committerHugo Geoffroy <pistache@lebib.org>2020-05-31 22:35:27 +0200
commitc784d3ab76e872dc28c1ea62137e9f95106e6c58 (patch)
treeca0b763edec5b2e423a29363685d00e5fcb9b852 /nixos/tests/haproxy.nix
parentfbdbe12f50ff7c40f86e956ab813c557aac25f6f (diff)
nixos/haproxy: add reloading support, use upstream service hardening
Refactor the systemd service definition for the haproxy reverse proxy, using the upstream systemd service definition. This allows the service to be reloaded on changes, preserving existing server state, and adds some hardening options.
Diffstat (limited to 'nixos/tests/haproxy.nix')
-rw-r--r--nixos/tests/haproxy.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/nixos/tests/haproxy.nix b/nixos/tests/haproxy.nix
index 79f34b07faf4..ffb77c052a24 100644
--- a/nixos/tests/haproxy.nix
+++ b/nixos/tests/haproxy.nix
@@ -43,5 +43,13 @@ import ./make-test-python.nix ({ pkgs, ...}: {
assert "haproxy_process_pool_allocated_bytes" in machine.succeed(
"curl -k http://localhost:80/metrics"
)
+
+ with subtest("reload"):
+ machine.succeed("systemctl reload haproxy")
+ # wait some time to ensure the following request hits the reloaded haproxy
+ machine.sleep(5)
+ assert "We are all good!" in machine.succeed(
+ "curl -k http://localhost:80/index.txt"
+ )
'';
})