diff options
Diffstat (limited to 'nixpkgs/nixos/tests/polaris.nix')
-rw-r--r-- | nixpkgs/nixos/tests/polaris.nix | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/nixpkgs/nixos/tests/polaris.nix b/nixpkgs/nixos/tests/polaris.nix new file mode 100644 index 000000000000..bb105d600032 --- /dev/null +++ b/nixpkgs/nixos/tests/polaris.nix @@ -0,0 +1,29 @@ +import ./make-test-python.nix ({ lib, ... }: + +{ + name = "polaris"; + meta.maintainers = with lib.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'") + ''; +}) |