diff options
author | Sandro <sandro.jaeckel@gmail.com> | 2024-05-02 10:25:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-02 10:25:30 +0200 |
commit | 2e9d7dca27336d8b75baa53c782e9ba94f8da2ab (patch) | |
tree | a9ed30af1c86c4a652c87b951623fd886a89b94c /nixos/tests/jotta-cli.nix | |
parent | bafcff9b1556f7e06399104d99768aa0f80030e5 (diff) | |
parent | 021a0ffe57d5d378c4075efe0af15f344d1b0604 (diff) |
Merge pull request #302570 from evenbrenden/jottad-service
Diffstat (limited to 'nixos/tests/jotta-cli.nix')
-rw-r--r-- | nixos/tests/jotta-cli.nix | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/nixos/tests/jotta-cli.nix b/nixos/tests/jotta-cli.nix new file mode 100644 index 0000000000000..5eefe65c1d385 --- /dev/null +++ b/nixos/tests/jotta-cli.nix @@ -0,0 +1,25 @@ +import ./make-test-python.nix ({ pkgs, ... }: { + + name = "jotta-cli"; + meta.maintainers = with pkgs.lib.maintainers; [ evenbrenden ]; + + nodes.machine = { pkgs, ... }: { + user.services.jotta-cli.enable = true; + imports = [ ./common/user-account.nix ]; + }; + + testScript = { nodes, ... }: + let uid = toString nodes.machine.users.users.alice.uid; + in '' + machine.start() + + machine.succeed("loginctl enable-linger alice") + machine.wait_for_unit("user@${uid}.service") + + machine.wait_for_unit("jottad.service", "alice") + machine.wait_for_open_unix_socket("/run/user/${uid}/jottad/jottad.socket") + + # "jotta-cli version" should fail if jotta-cli cannot connect to jottad + machine.succeed('XDG_RUNTIME_DIR=/run/user/${uid} su alice -c "jotta-cli version"') + ''; +}) |