depot/third_party/nixpkgs/nixos/tests/keter.nix
Default email 13da32182d Project import generated by Copybara.
GitOrigin-RevId: a7855f2235a1876f97473a76151fec2afa02b287
2022-08-21 15:32:41 +02:00

42 lines
884 B
Nix

import ./make-test-python.nix ({ pkgs, ... }:
let
port = 81;
in
{
name = "keter";
meta = with pkgs.lib.maintainers; {
maintainers = [ jappie ];
};
nodes.machine = { config, pkgs, ... }: {
services.keter = {
enable = true;
globalKeterConfig = {
listeners = [{
host = "*4";
inherit port;
}];
};
bundle = {
appName = "test-bundle";
domain = "localhost";
executable = pkgs.writeShellScript "run" ''
${pkgs.python3}/bin/python -m http.server $PORT
'';
};
};
};
testScript =
''
machine.wait_for_unit("keter.service")
machine.wait_for_open_port(${toString port})
machine.wait_for_console_text("Activating app test-bundle with hosts: localhost")
machine.succeed("curl --fail http://localhost:${toString port}/")
'';
})