Testing#
Tests use the NixOS VM test framework (testers.runNixOSTest). Test files
in tests/ are auto-discovered and exposed as checks in the flake.
See also
Relevant decisions:
Running the tests#
Run a specific test:
nix build .#checks.aarch64-darwin.profile-base -L
Disable the sandbox for tests which need network access:
nix build .#checks.aarch64-darwin.k0s-profile -L --option sandbox false
Interactive debugging with a Python REPL (runs outside the sandbox):
nix build .#checks.aarch64-darwin.k0s-profile.driver
./result/bin/nixos-test-driver --interactive
Test network layout#
Multi-node tests share the 192.168.1.0/24 subnet on eth1. Addresses
are grouped by role:
Range |
Purpose |
|---|---|
|
Infrastructure (router, DNS, DHCP, …) |
|
Kubernetes nodes (controllers, workers) |
|
Utility nodes (ansible control node, …) |