2022-06-17 21:04:54 +03:00
|
|
|
import ./make-test-python.nix ({ lib, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
name = "polaris";
|
2023-04-30 17:26:19 +03:00
|
|
|
meta.maintainers = with lib.maintainers; [ pbsds ];
|
2022-06-17 21:04:54 +03:00
|
|
|
|
|
|
|
nodes.machine =
|
|
|
|
{ pkgs, ... }: {
|
|
|
|
environment.systemPackages = [ pkgs.jq ];
|
|
|
|
services.polaris = {
|
|
|
|
enable = true;
|
|
|
|
port = 5050;
|
|
|
|
settings.users = [
|
|
|
|
{
|
|
|
|
name = "test_user";
|
|
|
|
password = "very_secret_password";
|
|
|
|
admin = true;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
machine.wait_for_unit("polaris.service")
|
2022-07-19 22:12:14 +03:00
|
|
|
machine.wait_for_open_port(5050)
|
2022-06-17 21:04:54 +03:00
|
|
|
machine.succeed("curl http://localhost:5050/api/version")
|
|
|
|
machine.succeed("curl -X GET http://localhost:5050/api/initial_setup -H 'accept: application/json' | jq -e '.has_any_users == true'")
|
|
|
|
'';
|
|
|
|
})
|