1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 03:30:45 +00:00
nixpkgs/nixos/tests/web-servers/agate.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
687 B
Nix
Raw Normal View History

{ pkgs, lib, ... }:
{
name = "agate";
meta = with lib.maintainers; { maintainers = [ jk ]; };
2022-02-07 16:03:58 +00:00
nodes = {
geminiserver = { pkgs, ... }: {
services.agate = {
enable = true;
hostnames = [ "localhost" ];
contentDir = pkgs.writeTextDir "index.gmi" ''
# Hello NixOS!
'';
2022-02-07 16:03:58 +00:00
};
};
};
2022-02-07 16:03:58 +00:00
testScript = { nodes, ... }: ''
geminiserver.wait_for_unit("agate")
geminiserver.wait_for_open_port(1965)
2022-02-07 16:03:58 +00:00
with subtest("check is serving over gemini"):
response = geminiserver.succeed("${pkgs.gemget}/bin/gemget --header -o - gemini://localhost:1965")
print(response)
assert "Hello NixOS!" in response
'';
}