mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-27 08:04:14 +00:00
cc7791cfd9
Allow reloading the webserver, which is useful when e.g there are new certificates available that we want lighttpd to use, but don't want to completely shut down the server.
23 lines
645 B
Nix
23 lines
645 B
Nix
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}'"
|
|
server.succeed("systemctl reload lighttpd")
|
|
'';
|
|
})
|