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;
21 environment.etc."icewm/prefoverride".text = ''
22 ColorActiveTitleBar = "rgb:FF/FF/FF"
25 # Regression test for https://github.com/NixOS/nixpkgs/issues/163482
28 platformTheme = "gnome";
29 style = "adwaita-dark";
32 test-support.displayManager.auto.user = "alice";
33 environment.systemPackages = with pkgs; [
41 testScript = { nodes, ... }: let
42 aliceDo = cmd: ''machine.succeed("su - alice -c '${cmd}' >&2 &");'';
44 with subtest("Ensure X starts"):
48 with subtest("Can create database and entry with CLI"):
49 ${aliceDo "keepassxc-cli db-create --set-key-file foo.keyfile foo.kdbx"}
50 ${aliceDo "keepassxc-cli add --no-password -k foo.keyfile foo.kdbx bar"}
52 with subtest("Ensure KeePassXC starts"):
53 # start KeePassXC window
54 ${aliceDo "keepassxc >&2 &"}
56 machine.wait_for_text("KeePassXC ${pkgs.keepassxc.version}")
57 machine.screenshot("KeePassXC")
59 with subtest("Can open existing database"):
60 machine.send_key("ctrl-o")
62 # Regression #163482: keepassxc did not crash
63 machine.succeed("ps -e | grep keepassxc")
64 machine.wait_for_text("Open database")
65 machine.send_key("ret")
67 # Wait for the enter password screen to appear.
68 machine.wait_for_text("/home/alice/foo.kdbx")
70 # Click on "I have key file" button to open keyfile dialog
71 machine.send_key("tab")
72 machine.send_key("tab")
73 machine.send_key("tab")
74 machine.send_key("ret")
77 machine.wait_for_text("Select key file")
78 machine.send_chars("/home/alice/foo.keyfile")
79 machine.send_key("ret")
82 machine.wait_for_text("foo.kdbx \\[Locked] - KeePassXC")
83 machine.send_key("ret")
85 # Database is unlocked (doesn't have "[Locked]" in the title anymore)
86 machine.wait_for_text("foo.kdbx - KeePassXC")