nixos/keepassxc: fix test (#353938)

This commit is contained in:
Peder Bergebakken Sundt 2024-11-09 00:10:04 +01:00 committed by GitHub
commit dcc6e1558c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 25 additions and 2 deletions

View File

@ -17,6 +17,11 @@ import ./make-test-python.nix ({ pkgs, ...} :
services.xserver.enable = true;
# for better OCR
environment.etc."icewm/prefoverride".text = ''
ColorActiveTitleBar = "rgb:FF/FF/FF"
'';
# Regression test for https://github.com/NixOS/nixpkgs/issues/163482
qt = {
enable = true;
@ -41,7 +46,7 @@ import ./make-test-python.nix ({ pkgs, ...} :
machine.wait_for_x()
with subtest("Can create database and entry with CLI"):
${aliceDo "keepassxc-cli db-create -k foo.keyfile foo.kdbx"}
${aliceDo "keepassxc-cli db-create --set-key-file foo.keyfile foo.kdbx"}
${aliceDo "keepassxc-cli add --no-password -k foo.keyfile foo.kdbx bar"}
with subtest("Ensure KeePassXC starts"):
@ -62,10 +67,21 @@ import ./make-test-python.nix ({ pkgs, ...} :
# Wait for the enter password screen to appear.
machine.wait_for_text("/home/alice/foo.kdbx")
# Click on "Browse" button to select keyfile
# Click on "I have key file" button to open keyfile dialog
machine.send_key("tab")
machine.send_key("tab")
machine.send_key("tab")
machine.send_key("ret")
# Select keyfile
machine.wait_for_text("Select key file")
machine.send_chars("/home/alice/foo.keyfile")
machine.send_key("ret")
# Open database
machine.wait_for_text("foo.kdbx \\[Locked] - KeePassXC")
machine.send_key("ret")
# Database is unlocked (doesn't have "[Locked]" in the title anymore)
machine.wait_for_text("foo.kdbx - KeePassXC")
'';

View File

@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, cmake
, qttools
@ -61,6 +62,12 @@ stdenv.mkDerivation rec {
patches = [
./darwin.patch
# https://github.com/keepassxreboot/keepassxc/issues/10391
(fetchpatch {
url = "https://github.com/keepassxreboot/keepassxc/commit/6a9ed210792ac60d9ed35cc702500e5ebbb95622.patch";
hash = "sha256-CyaVMfJ0O+5vgvmwI6rYbf0G7ryKFcLv3p4b/D6Pzw8=";
})
];
cmakeFlags = [