diff options
author | Bjørn Forsman <bjorn.forsman@gmail.com> | 2022-07-24 17:04:12 +0200 |
---|---|---|
committer | Franz Pletz <fpletz@fnordicwalking.de> | 2022-07-26 04:45:03 +0200 |
commit | 9b6965dcfcfc10906ee0ca955631a5a82d2a37ee (patch) | |
tree | 0ccc2e68796e3b5c5c78d001d5861e48cf87d9ff /nixos/tests/lighttpd.nix | |
parent | 85caa4e62d14a301b56509007b3804e145902c83 (diff) |
nixos: add lighttpd test
Diffstat (limited to 'nixos/tests/lighttpd.nix')
-rw-r--r-- | nixos/tests/lighttpd.nix | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/nixos/tests/lighttpd.nix b/nixos/tests/lighttpd.nix new file mode 100644 index 0000000000000..36e2745c55c15 --- /dev/null +++ b/nixos/tests/lighttpd.nix @@ -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}'" + ''; +}) |