summary refs log tree commit diff
path: root/nixos/tests/convos.nix
blob: a13870d1708432e6fc33db3b1d526005c217657e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import ./make-test-python.nix ({ lib, pkgs, ... }:

with lib;
let
  port = 3333;
in
{
  name = "convos";
  meta = with pkgs.lib.maintainers; {
    maintainers = [ sgo ];
  };

  nodes = {
    machine =
      { pkgs, ... }:
      {
        services.convos = {
          enable = true;
          listenPort = port;
        };
      };
  };

  testScript = ''
    machine.wait_for_unit("convos")
    machine.wait_for_open_port("${toString port}")
    machine.succeed("journalctl -u convos | grep -q 'Listening at.*${toString port}'")
    machine.succeed("curl -f http://localhost:${toString port}/")
  '';
})