1import ./make-test-python.nix ({ lib, ... }:
2
3with lib;
4
5{
6 name = "polaris";
7 meta.maintainers = with maintainers; [ pbsds ];
8
9 nodes.machine =
10 { pkgs, ... }: {
11 environment.systemPackages = [ pkgs.jq ];
12 services.polaris = {
13 enable = true;
14 port = 5050;
15 settings.users = [
16 {
17 name = "test_user";
18 password = "very_secret_password";
19 admin = true;
20 }
21 ];
22 };
23 };
24
25 testScript = ''
26 machine.wait_for_unit("polaris.service")
27 machine.wait_for_open_port(5050)
28 machine.succeed("curl http://localhost:5050/api/version")
29 machine.succeed("curl -X GET http://localhost:5050/api/initial_setup -H 'accept: application/json' | jq -e '.has_any_users == true'")
30 '';
31})