diff options
author | Peder Bergebakken Sundt <pbsds@hotmail.com> | 2022-06-17 20:04:54 +0200 |
---|---|---|
committer | Yt <happysalada@proton.me> | 2022-07-08 12:27:48 -0400 |
commit | 50dd61a9ba21cd7c0394942b4e9dbac9b498e41a (patch) | |
tree | 0661827067e2b62bfa4e9be7f229eda894d7fa4f /nixos/tests/polaris.nix | |
parent | 50ba995a1c1a1a6403d3bd45f99d09d02492ff56 (diff) |
nixos/polaris: init
Diffstat (limited to 'nixos/tests/polaris.nix')
-rw-r--r-- | nixos/tests/polaris.nix | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/nixos/tests/polaris.nix b/nixos/tests/polaris.nix new file mode 100644 index 0000000000000..62f0fb6a9c207 --- /dev/null +++ b/nixos/tests/polaris.nix @@ -0,0 +1,31 @@ +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'") + ''; +}) |