diff options
author | Andreas Rammhold <andreas@rammhold.de> | 2018-06-08 23:41:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-08 23:41:05 +0200 |
commit | 0decee48f5832261143fbfbef4c8684cd3c787cd (patch) | |
tree | 7faaa0be1a15b138c0fec37dbcb3ebb115483c5c /nixos/tests | |
parent | 5e89ea75ba8a8609d4254327f909a94a69e1128b (diff) | |
parent | 4c9c4c0a97c175e931ef695b8de744947b237e5f (diff) |
Merge pull request #41466 from andir/haproxy-1.8.9
Haproxy 1.8.9
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/haproxy.nix | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/nixos/tests/haproxy.nix b/nixos/tests/haproxy.nix new file mode 100644 index 0000000000000..ce4094237db23 --- /dev/null +++ b/nixos/tests/haproxy.nix @@ -0,0 +1,41 @@ +import ./make-test.nix ({ pkgs, ...}: { + name = "haproxy"; + nodes = { + machine = { config, ...}: { + imports = [ ../modules/profiles/minimal.nix ]; + services.haproxy = { + enable = true; + config = '' + defaults + timeout connect 10s + + backend http_server + mode http + server httpd [::1]:8000 + + frontend http + bind *:80 + mode http + use_backend http_server + ''; + }; + services.httpd = { + enable = true; + documentRoot = pkgs.writeTextDir "index.txt" "We are all good!"; + adminAddr = "notme@yourhost.local"; + listen = [{ + ip = "::1"; + port = 8000; + }]; + }; + }; + }; + testScript = '' + startAll; + $machine->waitForUnit('multi-user.target'); + $machine->waitForUnit('haproxy.service'); + $machine->waitForUnit('httpd.service'); + $machine->succeed('curl -k http://localhost:80/index.txt | grep "We are all good!"'); + + ''; +}) |