Skip to content

Commit

Permalink
More test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany committed Jan 5, 2024
1 parent 9e14b6d commit 729aca1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ jobs:
run: NIXPKGS_ALLOW_UNFREE=1 nix build --impure

- name: check flake (runs tests)
run: NIXPKGS_ALLOW_UNFREE=1 nix flake check --impure --log-format internal-json
run: |
NIXPKGS_ALLOW_UNFREE=1 nix flake check --impure --log-format internal-json
ls -al
- name: show flake output attributes
run: nix flake show
Expand Down
16 changes: 13 additions & 3 deletions tests/kolide-launcher.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,22 @@ pkgs.nixosTest {
testScript = { nodes, ... }: ''
machine.start()
with subtest("launcher starts"):
machine.wait_for_file("/var/lib/kolide-k2/k2device.kolide.com/debug.json")
# TODO: currently launcher will shut itself down if its secret file doesn't exist,
# so we don't get all the way through setup and launcher doesn't stay running.
# In the future, we'll want to validate setup and that the service is running.
with subtest("kolide-launcher service starts"):
machine.wait_for_unit("kolide-launcher.service")
machine.systemctl("status kolide-launcher.service")
machine.screenshot("test.png")
machine.shutdown()
with subtest("launcher set up correctly"):
machine.wait_for_file("/var/lib/kolide-k2/k2device.kolide.com/debug.json")
machine.wait_for_file("/var/lib/kolide-k2/k2device.kolide.com/kolide.png")
# machine.wait_for_file("/var/lib/kolide-k2/k2device.kolide.com/kv.sqlite")
# machine.wait_for_file("/var/lib/kolide-k2/k2device.kolide.com/launcher.db")
# machine.wait_for_file("/var/lib/kolide-k2/k2device.kolide.com/menu.json")
# machine.wait_for_file("/var/lib/kolide-k2/k2device.kolide.com/osquery.db")
'';
}

0 comments on commit 729aca1

Please sign in to comment.