Luke Granger-Brown
57725ef3ec
git-subtree-dir: third_party/nixpkgs git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
27 lines
691 B
Nix
27 lines
691 B
Nix
import ./make-test-python.nix ({ pkgs, ... }:
|
|
let
|
|
nginxSocketPath = "/var/run/nginx/test.sock";
|
|
in
|
|
{
|
|
name = "nginx-unix-socket";
|
|
|
|
nodes = {
|
|
webserver = { pkgs, lib, ... }: {
|
|
services.nginx = {
|
|
enable = true;
|
|
virtualHosts.localhost = {
|
|
serverName = "localhost";
|
|
listen = [{ addr = "unix:${nginxSocketPath}"; }];
|
|
locations."/test".return = "200 'foo'";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
testScript = ''
|
|
webserver.wait_for_unit("nginx")
|
|
webserver.wait_for_open_unix_socket("${nginxSocketPath}")
|
|
|
|
webserver.succeed("curl --fail --silent --unix-socket '${nginxSocketPath}' http://localhost/test | grep '^foo$'")
|
|
'';
|
|
})
|