nixos: add lighttpd test

This commit is contained in:
Bjørn Forsman 2022-07-24 17:04:12 +02:00 committed by Franz Pletz
parent 85caa4e62d
commit 9b6965dcfc
2 changed files with 22 additions and 0 deletions

View file

@ -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
View 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}'"
'';
})