Skip to content

Commit

Permalink
Try out launcher interactive
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany committed Jan 25, 2024
1 parent 750323c commit e415809
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- name: check flake (runs tests)
run: NIXPKGS_ALLOW_UNFREE=1 nix flake check --impure --log-format internal-json
timeout-minutes: 15
timeout-minutes: 20
env:
CI: "true"

Expand Down
23 changes: 22 additions & 1 deletion tests/kolide-launcher.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ pkgs.nixosTest {
user = nodes.machine.users.users.alice;
uid = toString user.uid;
xauthority = "${user.home}/.Xauthority";
launcherpath = "${flake.packages.x86_64-linux.kolide-launcher}/bin/launcher";
ci = builtins.getEnv "CI";
in
''
Expand Down Expand Up @@ -114,13 +115,33 @@ pkgs.nixosTest {
machine.screenshot("test-screen2.png")
with subtest("osquery runs"):
# Confirm launcher has started osqueryd
machine.wait_until_succeeds("pgrep osqueryd", timeout=30)
machine.screenshot("test-screen3.png")
# Try running launcher interactive
machine.succeed("su - ${user.name} -c 'DISPLAY=:0.0 mate-terminal >&2 &'")
machine.wait_for_window("Terminal", timeout=30)
# Window doesn't actually show up right away, so wait a bit before screenshotting and proceeding
machine.sleep(30)
machine.screenshot("test-screen3a.png")
machine.send_chars("${launcherpath} interactive\n")
machine.sleep(5)
machine.screenshot("test-screen3b.png")
machine.send_chars("select * from system_info;\n")
machine.sleep(5)
machine.screenshot("test-screen3c.png")
machine.send_chars(".exit\n")
machine.sleep(5)
machine.screenshot("test-screen3d.png")
with subtest("launcher desktop runs"):
machine.wait_for_file("/var/kolide-k2/k2device.kolide.com/kolide.png")
machine.wait_for_file("/var/kolide-k2/k2device.kolide.com/menu.json")
machine.screenshot("test-screen4.png")
# Confirm that a launcher desktop process is spawned for the user
machine.wait_until_succeeds("pgrep -U ${uid} launcher", timeout=120)
machine.screenshot("test-screen5.png")
Expand Down

0 comments on commit e415809

Please sign in to comment.