Skip to content

Commit

Permalink
tests/lomiri: Add polkit agent test
Browse files Browse the repository at this point in the history
  • Loading branch information
OPNA2608 committed Jul 6, 2024
1 parent 916ba54 commit 3a78809
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion nixos/tests/lomiri.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,24 @@ in {

inherit (alacritty) meta;
})

# Polkit requests eventually time out.
# Keep triggering them until we signal detection success
(writeShellApplication {
name = "lpa-check";
text = ''
while [ ! -f /tmp/lpa-checked ]; do
pkexec echo a
done
'';
})
# Signal detection success
(writeShellApplication {
name = "lpa-signal";
text = ''
touch /tmp/lpa-checked
'';
})
];
};

Expand Down Expand Up @@ -201,7 +219,15 @@ in {
machine.wait_for_text(r"(/build/source|hub.cpp|handler.cpp|void|virtual|const)") # awaiting log messages from content-hub
machine.send_key("ctrl-c")
machine.send_key("alt-f4")
# Doing this here, since we need an in-session shell & separately starting a terminal again wastes time
with subtest("polkit agent works"):
machine.send_chars("exec lpa-check\n")
machine.wait_for_text(r"(Elevated permissions|Login)")
machine.screenshot("polkit_agent")
machine.execute("lpa-signal")
# polkit test will quit terminal when agent request times out after OCR success
machine.wait_until_fails("pgrep -u ${user} -f lomiri-terminal-app")
# We want the ability to launch applications
with subtest("starter menu works"):
Expand Down

0 comments on commit 3a78809

Please sign in to comment.