2019-12-16 21:02:36 +00:00
|
|
|
import ../make-test-python.nix ({ pkgs, ... }:
|
2018-05-01 10:36:36 +01:00
|
|
|
{
|
|
|
|
name = "hitch";
|
2021-01-10 19:08:30 +00:00
|
|
|
meta = with pkgs.lib.maintainers; {
|
2018-05-01 10:36:36 +01:00
|
|
|
maintainers = [ jflanglois ];
|
|
|
|
};
|
2018-07-20 21:56:59 +01:00
|
|
|
machine = { pkgs, ... }: {
|
2018-05-01 10:36:36 +01:00
|
|
|
environment.systemPackages = [ pkgs.curl ];
|
|
|
|
services.hitch = {
|
|
|
|
enable = true;
|
|
|
|
backend = "[127.0.0.1]:80";
|
|
|
|
pem-files = [
|
|
|
|
./example.pem
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
services.httpd = {
|
|
|
|
enable = true;
|
2019-11-04 21:24:55 +00:00
|
|
|
virtualHosts.localhost.documentRoot = ./example;
|
2018-05-01 10:36:36 +01:00
|
|
|
adminAddr = "noone@testing.nowhere";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript =
|
|
|
|
''
|
2019-12-16 21:02:36 +00:00
|
|
|
start_all()
|
2018-05-01 10:36:36 +01:00
|
|
|
|
2019-12-16 21:02:36 +00:00
|
|
|
machine.wait_for_unit("multi-user.target")
|
|
|
|
machine.wait_for_unit("hitch.service")
|
|
|
|
machine.wait_for_open_port(443)
|
2020-09-16 16:55:42 +01:00
|
|
|
assert "We are all good!" in machine.succeed("curl -fk https://localhost:443/index.txt")
|
2018-05-01 10:36:36 +01:00
|
|
|
'';
|
|
|
|
})
|