summary refs log tree commit diff
path: root/nixos/tests/sway.nix
diff options
context:
space:
mode:
authorMichael Weiss <dev.primeos@gmail.com>2021-05-13 20:35:45 +0200
committerMichael Weiss <dev.primeos@gmail.com>2021-05-13 20:51:31 +0200
commit03808546e54b3e94d2eb3b4fdeb38864cb43dc0f (patch)
tree024295bf773738f0a396f1d0b9cab863658574e7 /nixos/tests/sway.nix
parent60f2af59385bb58b57df3e0df621dbb216fcd39e (diff)
downloadnixpkgs-03808546e54b3e94d2eb3b4fdeb38864cb43dc0f.tar
nixpkgs-03808546e54b3e94d2eb3b4fdeb38864cb43dc0f.tar.gz
nixpkgs-03808546e54b3e94d2eb3b4fdeb38864cb43dc0f.tar.bz2
nixpkgs-03808546e54b3e94d2eb3b4fdeb38864cb43dc0f.tar.lz
nixpkgs-03808546e54b3e94d2eb3b4fdeb38864cb43dc0f.tar.xz
nixpkgs-03808546e54b3e94d2eb3b4fdeb38864cb43dc0f.tar.zst
nixpkgs-03808546e54b3e94d2eb3b4fdeb38864cb43dc0f.zip
nixos/tests/sway: test GPG's pinentry pop-up
This test is important to confirm that $WAYLAND_DISPLAY is correctly
imported via "dbus-update-activation-environment --systemd" which is
done by default since #122605 (00e8e5b123f).
It ensures that the gnome3-pinentry pop-ups work as expected to avoid
regressions like #119445 (which also broke screen sharing).
Diffstat (limited to 'nixos/tests/sway.nix')
-rw-r--r--nixos/tests/sway.nix14
1 files changed, 14 insertions, 0 deletions
diff --git a/nixos/tests/sway.nix b/nixos/tests/sway.nix
index fad7f7dc4e6..1d23b0e9431 100644
--- a/nixos/tests/sway.nix
+++ b/nixos/tests/sway.nix
@@ -38,6 +38,9 @@ import ./make-test-python.nix ({ pkgs, lib, ...} :
 
     programs.sway.enable = true;
 
+    # To test pinentry via gpg-agent:
+    programs.gnupg.agent.enable = true;
+
     virtualisation.memorySize = 1024;
     # Need to switch to a different VGA card / GPU driver than the default one (std) so that Sway can launch:
     virtualisation.qemu.options = [ "-vga virtio" ];
@@ -80,6 +83,17 @@ import ./make-test-python.nix ({ pkgs, lib, ...} :
     machine.send_key("alt-shift-q")
     machine.wait_until_fails("pgrep alacritty")
 
+    # Test gpg-agent starting pinentry-gnome3 via D-Bus (tests if
+    # $WAYLAND_DISPLAY is correctly imported into the D-Bus user env):
+    machine.succeed(
+        "su - alice -c 'swaymsg -- exec gpg --no-tty --yes --quick-generate-key test'"
+    )
+    machine.wait_until_succeeds("pgrep --exact gpg")
+    machine.wait_for_text("Passphrase")
+    machine.screenshot("gpg_pinentry")
+    machine.send_key("alt-shift-q")
+    machine.wait_until_fails("pgrep --exact gpg")
+
     # Test swaynag:
     machine.send_key("alt-shift-e")
     machine.wait_for_text("You pressed the exit shortcut.")