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