1 import ../make-test-python.nix (
9 # These tests need a little more juice
16 environment.systemPackages = with pkgs; [ immich-cli ];
20 environment.IMMICH_LOG_LEVEL = "verbose";
27 machine.wait_for_unit("immich-server.service")
29 machine.wait_for_open_port(3001) # Server
30 machine.wait_for_open_port(3003) # Machine learning
31 machine.succeed("curl --fail http://localhost:3001/")
34 curl -H 'Content-Type: application/json' --data '{ "email": "test@example.com", "name": "Admin", "password": "admin" }' -X POST http://localhost:3001/api/auth/admin-sign-up
36 res = machine.succeed("""
37 curl -H 'Content-Type: application/json' --data '{ "email": "test@example.com", "password": "admin" }' -X POST http://localhost:3001/api/auth/login
39 token = json.loads(res)['accessToken']
41 res = machine.succeed("""
42 curl -H 'Content-Type: application/json' -H 'Cookie: immich_access_token=%s' --data '{ "name": "API Key", "permissions": ["all"] }' -X POST http://localhost:3001/api/api-keys
44 key = json.loads(res)['secret']
46 machine.succeed(f"immich login http://localhost:3001/api {key}")
47 res = machine.succeed("immich server-info")