nixpkgs/nixos/tests/mollysocket.nix

29 lines
564 B
Nix
Raw Permalink Normal View History

{ pkgs, lib, ... }:
2024-01-05 03:10:12 -08:00
let
port = 1234;
in
{
name = "mollysocket";
meta.maintainers = with lib.maintainers; [ dotlambda ];
2024-01-05 03:10:12 -08:00
nodes.mollysocket =
{ ... }:
{
services.mollysocket = {
enable = true;
settings = {
inherit port;
};
2024-01-05 03:10:12 -08:00
};
};
2024-01-05 03:10:12 -08:00
testScript = ''
mollysocket.wait_for_unit("mollysocket.service")
mollysocket.wait_for_open_port(${toString port})
2024-01-05 03:10:12 -08:00
out = mollysocket.succeed("curl --fail http://127.0.0.1:${toString port}")
assert "Version ${pkgs.mollysocket.version}" in out
'';
}