diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-10-21 17:25:23 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-10-21 17:25:23 +0000 |
commit | 2a87a287685e127797106ffe684015a2371729fd (patch) | |
tree | 86f3180cc4eea397d9741a530593682404e94627 /nixpkgs/nixos/tests | |
parent | 53533fd13b70e6e78e9a63c7dad027b116335a2d (diff) | |
parent | 83b8726e5f6f85a28405c7772f75093fd9a399a3 (diff) | |
download | nixlib-2a87a287685e127797106ffe684015a2371729fd.tar nixlib-2a87a287685e127797106ffe684015a2371729fd.tar.gz nixlib-2a87a287685e127797106ffe684015a2371729fd.tar.bz2 nixlib-2a87a287685e127797106ffe684015a2371729fd.tar.lz nixlib-2a87a287685e127797106ffe684015a2371729fd.tar.xz nixlib-2a87a287685e127797106ffe684015a2371729fd.tar.zst nixlib-2a87a287685e127797106ffe684015a2371729fd.zip |
Merge commit '83b8726e5f6f85a28405c7772f75093fd9a399a3'
Diffstat (limited to 'nixpkgs/nixos/tests')
-rw-r--r-- | nixpkgs/nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixpkgs/nixos/tests/installer.nix | 3 | ||||
-rw-r--r-- | nixpkgs/nixos/tests/nginx-unix-socket.nix | 27 |
3 files changed, 31 insertions, 0 deletions
diff --git a/nixpkgs/nixos/tests/all-tests.nix b/nixpkgs/nixos/tests/all-tests.nix index 33f8abf6ccd4..88fcbd59a1e7 100644 --- a/nixpkgs/nixos/tests/all-tests.nix +++ b/nixpkgs/nixos/tests/all-tests.nix @@ -559,6 +559,7 @@ in { nginx-sso = handleTest ./nginx-sso.nix {}; nginx-status-page = handleTest ./nginx-status-page.nix {}; nginx-tmpdir = handleTest ./nginx-tmpdir.nix {}; + nginx-unix-socket = handleTest ./nginx-unix-socket.nix {}; nginx-variants = handleTest ./nginx-variants.nix {}; nifi = handleTestOn ["x86_64-linux"] ./web-apps/nifi.nix {}; nitter = handleTest ./nitter.nix {}; diff --git a/nixpkgs/nixos/tests/installer.nix b/nixpkgs/nixos/tests/installer.nix index 3268a16967d7..5111cedf9256 100644 --- a/nixpkgs/nixos/tests/installer.nix +++ b/nixpkgs/nixos/tests/installer.nix @@ -690,6 +690,9 @@ in { "zpool create rpool /dev/vda2", "zfs create -o mountpoint=legacy rpool/root", "mount -t zfs rpool/root /mnt", + "zfs create -o mountpoint=legacy rpool/root/usr", + "mkdir /mnt/usr", + "mount -t zfs rpool/root/usr /mnt/usr", "udevadm settle", ) ''; diff --git a/nixpkgs/nixos/tests/nginx-unix-socket.nix b/nixpkgs/nixos/tests/nginx-unix-socket.nix new file mode 100644 index 000000000000..4640eaa171bd --- /dev/null +++ b/nixpkgs/nixos/tests/nginx-unix-socket.nix @@ -0,0 +1,27 @@ +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$'") + ''; +}) |