at 23.11-pre 884 B view raw
1import ./make-test-python.nix ({ pkgs, ... }: 2let 3 port = 81; 4in 5{ 6 name = "keter"; 7 meta = with pkgs.lib.maintainers; { 8 maintainers = [ jappie ]; 9 }; 10 11 12 nodes.machine = { config, pkgs, ... }: { 13 services.keter = { 14 enable = true; 15 16 globalKeterConfig = { 17 listeners = [{ 18 host = "*4"; 19 inherit port; 20 }]; 21 }; 22 bundle = { 23 appName = "test-bundle"; 24 domain = "localhost"; 25 executable = pkgs.writeShellScript "run" '' 26 ${pkgs.python3}/bin/python -m http.server $PORT 27 ''; 28 }; 29 }; 30 }; 31 32 testScript = 33 '' 34 machine.wait_for_unit("keter.service") 35 36 machine.wait_for_open_port(${toString port}) 37 machine.wait_for_console_text("Activating app test-bundle with hosts: localhost") 38 39 40 machine.succeed("curl --fail http://localhost:${toString port}/") 41 ''; 42})