1import ./make-test-python.nix (
2 { lib, ... }:
3
4 {
5 name = "polaris";
6 meta.maintainers = with lib.maintainers; [ pbsds ];
7
8 nodes.machine =
9 { pkgs, ... }:
10 {
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 }
32)