Skip to content

Commit

Permalink
See if we can get a cooler screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany committed Jan 5, 2024
1 parent 746aa7d commit 8369e72
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
- name: upload test screenshot
uses: actions/upload-artifact@v4
with:
name: test-screenshot
path: ${{ steps.test-derivation.outputs.drvpath }}/test.png
retention-days: 1

Expand Down
32 changes: 27 additions & 5 deletions tests/kolide-launcher.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,27 @@ pkgs.nixosTest {
imports = [
flake.nixosModules.kolide-launcher
];
config = {
services.kolide-launcher.enable = true;
system.stateVersion = "23.05";

users.users.alice = {
isNormalUser = true;
description = "Alice Test";
password = "alicetest";
uid = 1000;
};

services.xserver.enable = true;
services.xserver.displayManager = {
lightdm.enable = true;
autoLogin = {
enable = true;
user = "alice";
};
};
services.xserver.desktopManager.gnome.enable = true;
services.xserver.displayManager.defaultSession = "gnome-xorg";

services.kolide-launcher.enable = true;
system.stateVersion = "23.05";
};

testScript = { nodes, ... }: ''
Expand All @@ -32,11 +49,16 @@ pkgs.nixosTest {
machine.wait_for_unit("kolide-launcher.service")
machine.systemctl("status kolide-launcher.service")
machine.screenshot("test.png")
with subtest("launcher set up correctly"):
machine.wait_for_file("/var/lib/kolide-k2/k2device.kolide.com/debug.json")
with subtest("get a screenshot"):
machine.wait_for_x()
machine.wait_for_unit("default.target", "alice")
machine.wait_for_file("/run/user/1000/gdm/Xauthority")
machine.succeed("xauth merge /run/user/1000/gdm/Xauthority")
machine.screenshot("test.png")
machine.shutdown()
'';
}

0 comments on commit 8369e72

Please sign in to comment.