at 18.09-beta 768 B view raw
1import ../make-test.nix ({ pkgs, ... }: 2{ 3 name = "hitch"; 4 meta = with pkgs.stdenv.lib.maintainers; { 5 maintainers = [ jflanglois ]; 6 }; 7 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 documentRoot = ./example; 20 adminAddr = "noone@testing.nowhere"; 21 }; 22 }; 23 24 testScript = 25 '' 26 startAll; 27 28 $machine->waitForUnit('multi-user.target'); 29 $machine->waitForUnit('hitch.service'); 30 $machine->waitForOpenPort(443); 31 $machine->succeed('curl -k https://localhost:443/index.txt | grep "We are all good!"'); 32 ''; 33})