forked from mirrors/nixpkgs
nixos: add lighttpd test
This commit is contained in:
parent
85caa4e62d
commit
9b6965dcfc
|
@ -282,6 +282,7 @@ in {
|
|||
libuiohook = handleTest ./libuiohook.nix {};
|
||||
lidarr = handleTest ./lidarr.nix {};
|
||||
lightdm = handleTest ./lightdm.nix {};
|
||||
lighttpd = handleTest ./lighttpd.nix {};
|
||||
limesurvey = handleTest ./limesurvey.nix {};
|
||||
litestream = handleTest ./litestream.nix {};
|
||||
locate = handleTest ./locate.nix {};
|
||||
|
|
21
nixos/tests/lighttpd.nix
Normal file
21
nixos/tests/lighttpd.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
||||
name = "lighttpd";
|
||||
meta.maintainers = with lib.maintainers; [ bjornfor ];
|
||||
|
||||
nodes = {
|
||||
server = {
|
||||
services.lighttpd.enable = true;
|
||||
services.lighttpd.document-root = pkgs.runCommand "document-root" {} ''
|
||||
mkdir -p "$out"
|
||||
echo "hello nixos test" > "$out/file.txt"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
server.wait_for_unit("lighttpd.service")
|
||||
res = server.succeed("curl --fail http://localhost/file.txt")
|
||||
assert "hello nixos test" in res, f"bad server response: '{res}'"
|
||||
'';
|
||||
})
|
Loading…
Reference in a new issue