about summary refs log tree commit diff
path: root/nixpkgs/nixos/tests/hitch/default.nix
blob: cb24c4dcffc246a76d0ead143c4b541c95e18483 (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
31
32
33
import ../make-test.nix ({ pkgs, ... }:
{
  name = "hitch";
  meta = with pkgs.stdenv.lib.maintainers; {
    maintainers = [ jflanglois ];
  };
  machine = { pkgs, ... }: {
    environment.systemPackages = [ pkgs.curl ];
    services.hitch = {
      enable = true;
      backend = "[127.0.0.1]:80";
      pem-files = [
        ./example.pem
      ];
    };

    services.httpd = {
      enable = true;
      documentRoot = ./example;
      adminAddr = "noone@testing.nowhere";
    };
  };

  testScript =
    ''
      startAll;

      $machine->waitForUnit('multi-user.target');
      $machine->waitForUnit('hitch.service');
      $machine->waitForOpenPort(443);
      $machine->succeed('curl -k https://localhost:443/index.txt | grep "We are all good!"');
    '';
})