mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-12 05:16:25 +03:00
parent
63785f0edb
commit
89e464c751
2 changed files with 25 additions and 27 deletions
|
@ -813,7 +813,7 @@ in {
|
||||||
nginx-sso = runTest ./nginx-sso.nix;
|
nginx-sso = runTest ./nginx-sso.nix;
|
||||||
nginx-status-page = runTest ./nginx-status-page.nix;
|
nginx-status-page = runTest ./nginx-status-page.nix;
|
||||||
nginx-tmpdir = runTest ./nginx-tmpdir.nix;
|
nginx-tmpdir = runTest ./nginx-tmpdir.nix;
|
||||||
nginx-unix-socket = handleTest ./nginx-unix-socket.nix {};
|
nginx-unix-socket = runTest ./nginx-unix-socket.nix;
|
||||||
nginx-variants = handleTest ./nginx-variants.nix {};
|
nginx-variants = handleTest ./nginx-variants.nix {};
|
||||||
nifi = runTestOn ["x86_64-linux"] ./web-apps/nifi.nix;
|
nifi = runTestOn ["x86_64-linux"] ./web-apps/nifi.nix;
|
||||||
nitter = handleTest ./nitter.nix {};
|
nitter = handleTest ./nitter.nix {};
|
||||||
|
|
|
@ -1,31 +1,29 @@
|
||||||
import ./make-test-python.nix (
|
{ ... }:
|
||||||
{ pkgs, ... }:
|
let
|
||||||
let
|
nginxSocketPath = "/var/run/nginx/test.sock";
|
||||||
nginxSocketPath = "/var/run/nginx/test.sock";
|
in
|
||||||
in
|
{
|
||||||
{
|
name = "nginx-unix-socket";
|
||||||
name = "nginx-unix-socket";
|
|
||||||
|
|
||||||
nodes = {
|
nodes = {
|
||||||
webserver =
|
webserver =
|
||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
{
|
{
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
virtualHosts.localhost = {
|
virtualHosts.localhost = {
|
||||||
serverName = "localhost";
|
serverName = "localhost";
|
||||||
listen = [ { addr = "unix:${nginxSocketPath}"; } ];
|
listen = [ { addr = "unix:${nginxSocketPath}"; } ];
|
||||||
locations."/test".return = "200 'foo'";
|
locations."/test".return = "200 'foo'";
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
webserver.wait_for_unit("nginx")
|
webserver.wait_for_unit("nginx")
|
||||||
webserver.wait_for_open_unix_socket("${nginxSocketPath}")
|
webserver.wait_for_open_unix_socket("${nginxSocketPath}")
|
||||||
|
|
||||||
webserver.succeed("curl --fail --silent --unix-socket '${nginxSocketPath}' http://localhost/test | grep '^foo$'")
|
webserver.succeed("curl --fail --silent --unix-socket '${nginxSocketPath}' http://localhost/test | grep '^foo$'")
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue