depot/third_party/nixpkgs/nixos/tests/web-servers/agate.nix
Default email 5083ee08a2 Project import generated by Copybara.
GitOrigin-RevId: 10ecda252ce1b3b1d6403caeadbcc8f30d5ab796
2022-09-30 06:47:45 -05:00

27 lines
683 B
Nix

{ pkgs, lib, ... }:
{
name = "agate";
meta = with lib.maintainers; { maintainers = [ jk ]; };
nodes = {
geminiserver = { pkgs, ... }: {
services.agate = {
enable = true;
hostnames = [ "localhost" ];
contentDir = pkgs.writeTextDir "index.gmi" ''
# Hello NixOS!
'';
};
};
};
testScript = { nodes, ... }: ''
geminiserver.wait_for_unit("agate")
geminiserver.wait_for_open_port(1965)
with subtest("check is serving over gemini"):
response = geminiserver.succeed("${pkgs.gmni}/bin/gmni -j once -i -N gemini://localhost:1965")
print(response)
assert "Hello NixOS!" in response
'';
}