1 import ./make-test-python.nix ({ pkgs, ...} :
5 meta = with pkgs.lib.maintainers; {
6 maintainers = [ turion ];
10 nodes.machine = { ... }:
14 ./common/user-account.nix
18 services.xserver.enable = true;
20 # Regression test for https://github.com/NixOS/nixpkgs/issues/163482
23 platformTheme = "gnome";
24 style = "adwaita-dark";
27 test-support.displayManager.auto.user = "alice";
28 environment.systemPackages = with pkgs; [
36 testScript = { nodes, ... }: let
37 aliceDo = cmd: ''machine.succeed("su - alice -c '${cmd}' >&2 &");'';
39 with subtest("Ensure X starts"):
43 with subtest("Can create database and entry with CLI"):
44 ${aliceDo "keepassxc-cli db-create -k foo.keyfile foo.kdbx"}
45 ${aliceDo "keepassxc-cli add --no-password -k foo.keyfile foo.kdbx bar"}
47 with subtest("Ensure KeePassXC starts"):
48 # start KeePassXC window
49 ${aliceDo "keepassxc >&2 &"}
51 machine.wait_for_text("KeePassXC ${pkgs.keepassxc.version}")
52 machine.screenshot("KeePassXC")
54 with subtest("Can open existing database"):
55 machine.send_key("ctrl-o")
57 # Regression #163482: keepassxc did not crash
58 machine.succeed("ps -e | grep keepassxc")
59 machine.wait_for_text("Open database")
60 machine.send_key("ret")
62 # Wait for the enter password screen to appear.
63 machine.wait_for_text("/home/alice/foo.kdbx")
65 # Click on "Browse" button to select keyfile
66 machine.send_key("tab")
67 machine.send_chars("/home/alice/foo.keyfile")
68 machine.send_key("ret")
69 # Database is unlocked (doesn't have "[Locked]" in the title anymore)
70 machine.wait_for_text("foo.kdbx - KeePassXC")