1import ./make-test-python.nix ({ lib, pkgs, ... }: {
2 name = "lighttpd";
3 meta.maintainers = with lib.maintainers; [ bjornfor ];
4
5 nodes = {
6 server = {
7 services.lighttpd.enable = true;
8 services.lighttpd.document-root = pkgs.runCommand "document-root" {} ''
9 mkdir -p "$out"
10 echo "hello nixos test" > "$out/file.txt"
11 '';
12 };
13 };
14
15 testScript = ''
16 start_all()
17 server.wait_for_unit("lighttpd.service")
18 res = server.succeed("curl --fail http://localhost/file.txt")
19 assert "hello nixos test" in res, f"bad server response: '{res}'"
20 '';
21})