at 23.11-beta 798 B view raw
1import ../make-test-python.nix ({ pkgs, ... }: 2{ 3 name = "hitch"; 4 meta = with pkgs.lib.maintainers; { 5 maintainers = [ jflanglois ]; 6 }; 7 nodes.machine = { pkgs, ... }: { 8 environment.systemPackages = [ pkgs.curl ]; 9 services.hitch = { 10 enable = true; 11 backend = "[127.0.0.1]:80"; 12 pem-files = [ 13 ./example.pem 14 ]; 15 }; 16 17 services.httpd = { 18 enable = true; 19 virtualHosts.localhost.documentRoot = ./example; 20 adminAddr = "noone@testing.nowhere"; 21 }; 22 }; 23 24 testScript = 25 '' 26 start_all() 27 28 machine.wait_for_unit("multi-user.target") 29 machine.wait_for_unit("hitch.service") 30 machine.wait_for_open_port(443) 31 assert "We are all good!" in machine.succeed("curl -fk https://localhost:443/index.txt") 32 ''; 33})