about summary refs log tree commit diff
path: root/nixos/tests/zeronet-conservancy.nix
blob: 8cb649cbdaabc97745536219a71af0a9dcccf7bf (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
let
  port = 43110;
in
import ./make-test-python.nix ({ pkgs, ... }: {
  name = "zeronet-conservancy";
  meta = with pkgs.lib.maintainers; {
    maintainers = [ fgaz ];
  };

  nodes.machine = { config, pkgs, ... }: {
    services.zeronet = {
      enable = true;
      package = pkgs.zeronet-conservancy;
      inherit port;
    };
  };

  testScript = ''
    machine.wait_for_unit("zeronet.service")

    machine.wait_for_open_port(${toString port})

    machine.succeed("curl --fail -H 'Accept: text/html, application/xml, */*' localhost:${toString port}/Stats")
  '';
})