depot/third_party/nixpkgs/nixos/tests/hitch/default.nix
Default email d56f44df06 Project import generated by Copybara.
GitOrigin-RevId: bc4b9eef3ce3d5a90d8693e8367c9cbfc9fc1e13
2022-04-03 20:54:34 +02:00

33 lines
798 B
Nix

import ../make-test-python.nix ({ pkgs, ... }:
{
name = "hitch";
meta = with pkgs.lib.maintainers; {
maintainers = [ jflanglois ];
};
nodes.machine = { pkgs, ... }: {
environment.systemPackages = [ pkgs.curl ];
services.hitch = {
enable = true;
backend = "[127.0.0.1]:80";
pem-files = [
./example.pem
];
};
services.httpd = {
enable = true;
virtualHosts.localhost.documentRoot = ./example;
adminAddr = "noone@testing.nowhere";
};
};
testScript =
''
start_all()
machine.wait_for_unit("multi-user.target")
machine.wait_for_unit("hitch.service")
machine.wait_for_open_port(443)
assert "We are all good!" in machine.succeed("curl -fk https://localhost:443/index.txt")
'';
})