at 25.11-pre 887 B view raw
1import ./make-test-python.nix ( 2 { pkgs, ... }: 3 { 4 5 name = "jotta-cli"; 6 meta.maintainers = with pkgs.lib.maintainers; [ evenbrenden ]; 7 8 nodes.machine = 9 { pkgs, ... }: 10 { 11 services.jotta-cli.enable = true; 12 imports = [ ./common/user-account.nix ]; 13 }; 14 15 testScript = 16 { nodes, ... }: 17 let 18 uid = toString nodes.machine.users.users.alice.uid; 19 in 20 '' 21 machine.start() 22 23 machine.succeed("loginctl enable-linger alice") 24 machine.wait_for_unit("user@${uid}.service") 25 26 machine.wait_for_unit("jottad.service", "alice") 27 machine.wait_for_open_unix_socket("/run/user/${uid}/jottad/jottad.socket") 28 29 # "jotta-cli version" should fail if jotta-cli cannot connect to jottad 30 machine.succeed('XDG_RUNTIME_DIR=/run/user/${uid} su alice -c "jotta-cli version"') 31 ''; 32 } 33)