depot/third_party/nixpkgs/nixos/tests/polaris.nix
Default email 02cf88bb76 Project import generated by Copybara.
GitOrigin-RevId: c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d
2022-08-12 15:06:08 +03:00

31 lines
782 B
Nix

import ./make-test-python.nix ({ lib, ... }:
with lib;
{
name = "polaris";
meta.maintainers = with maintainers; [ pbsds ];
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")
machine.wait_for_open_port(5050)
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'")
'';
})