about summary refs log tree commit diff
path: root/nixos/tests/lighttpd.nix
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2022-07-24 17:04:12 +0200
committerFranz Pletz <fpletz@fnordicwalking.de>2022-07-26 04:45:03 +0200
commit9b6965dcfcfc10906ee0ca955631a5a82d2a37ee (patch)
tree0ccc2e68796e3b5c5c78d001d5861e48cf87d9ff /nixos/tests/lighttpd.nix
parent85caa4e62d14a301b56509007b3804e145902c83 (diff)
nixos: add lighttpd test
Diffstat (limited to 'nixos/tests/lighttpd.nix')
-rw-r--r--nixos/tests/lighttpd.nix21
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}'"
+  '';
+})