about summary refs log tree commit diff
path: root/nixos/tests/isso.nix
blob: 4ec8b5ec3593dd19e5bf7d75cd84b4a82f88bdd8 (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 ({ pkgs, ... }: {
  name = "isso";
  meta = with pkgs.lib.maintainers; {
    maintainers = [ ];
  };

  nodes.machine = { config, pkgs, ... }: {
    services.isso = {
      enable = true;
      settings = {
        general = {
          dbpath = "/var/lib/isso/comments.db";
          host = "http://localhost";
        };
      };
    };
  };

  testScript = let
    port = 8080;
  in
  ''
    machine.wait_for_unit("isso.service")

    machine.wait_for_open_port(${toString port})

    machine.succeed("curl --fail http://localhost:${toString port}/?uri")
    machine.succeed("curl --fail http://localhost:${toString port}/js/embed.min.js")
  '';
})