Skip to content

Commit

Permalink
nixos/tests/sway: test GPG's pinentry pop-up
Browse files Browse the repository at this point in the history
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 (00e8e5b).
It ensures that the gnome3-pinentry pop-ups work as expected to avoid
regressions like #119445 (which also broke screen sharing).
  • Loading branch information
primeos committed May 13, 2021
1 parent 60f2af5 commit 0380854
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions nixos/tests/sway.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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" ];
Expand Down Expand Up @@ -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.")
Expand Down

0 comments on commit 0380854

Please sign in to comment.