summaryrefslogtreecommitdiffstats
path: root/nixos/tests/go-camo.nix
blob: d68bbde537b591525fb08bc502682add6b63a8f4 (plain)
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
{ lib, ... }:
let
  key_val = "12345678";
in
{
  name = "go-camo-file-key";
  meta = {
    maintainers = [ lib.maintainers.viraptor ];
  };

  nodes.machine =
    { pkgs, ... }:
    {
      services.go-camo = {
        enable = true;
        keyFile = pkgs.writeText "foo" key_val;
      };
    };

  # go-camo responds to http requests
  testScript = ''
    machine.wait_for_unit("go-camo.service")
    machine.wait_for_open_port(8080)
    machine.succeed("curl http://localhost:8080")
  '';
}