2022-05-18 15:41:54 +02:00
|
|
|
import ./make-test-python.nix ({ pkgs, ... }:
|
2023-04-11 15:38:34 +02:00
|
|
|
let
|
|
|
|
port = 81;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
name = "keter";
|
|
|
|
meta = with pkgs.lib.maintainers; {
|
|
|
|
maintainers = [ jappie ];
|
|
|
|
};
|
2022-05-18 15:41:54 +02:00
|
|
|
|
|
|
|
|
2023-04-11 15:38:34 +02:00
|
|
|
nodes.machine = { config, pkgs, ... }: {
|
|
|
|
services.keter = {
|
|
|
|
enable = true;
|
2022-05-18 15:41:54 +02:00
|
|
|
|
2023-04-11 15:38:34 +02:00
|
|
|
globalKeterConfig = {
|
|
|
|
cli-port = 123; # just adding this to test the freeform
|
|
|
|
listeners = [{
|
|
|
|
host = "*4";
|
|
|
|
inherit port;
|
|
|
|
}];
|
|
|
|
};
|
|
|
|
bundle = {
|
|
|
|
appName = "test-bundle";
|
|
|
|
domain = "localhost";
|
|
|
|
executable = pkgs.writeShellScript "run" ''
|
|
|
|
${pkgs.python3}/bin/python -m http.server $PORT
|
|
|
|
'';
|
|
|
|
};
|
2022-05-18 15:41:54 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-04-11 15:38:34 +02:00
|
|
|
testScript =
|
|
|
|
''
|
|
|
|
machine.wait_for_unit("keter.service")
|
2022-05-18 15:41:54 +02:00
|
|
|
|
2023-04-11 15:38:34 +02:00
|
|
|
machine.wait_for_open_port(${toString port})
|
|
|
|
machine.wait_for_console_text("Activating app test-bundle with hosts: localhost")
|
2022-05-18 15:41:54 +02:00
|
|
|
|
|
|
|
|
2023-04-11 15:38:34 +02:00
|
|
|
machine.succeed("curl --fail http://localhost:${toString port}/")
|
|
|
|
'';
|
|
|
|
})
|