NixOS VM tests: Difference between revisions
Remove leftover references to the perl test subsystem |
Links to Nixcademy blog posts about NixOS integration tests |
||
| (3 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
WARNING: this page is mostly outdated as https://nixos.org/manual/nixos/stable/#chap-developing-the-test-driver mentions that <code>pkgs.nixosTest</code>, <code>testing-python.nix</code> and <code>make-test-python.nix</code> are outdated. Beside the documentation, you may also like https://nix.dev/tutorials/nixos/integration-testing-using-virtual-machines.html | |||
The primary documentation for the [https://nixos.org/manual/nixos/stable/index.html#sec-nixos-tests NixOS VM testing framework] is in [https://nixos.org/manual/nixos/stable/index.html#sec-nixos-tests the NixOS manual], and in [https://nixos.org/manual/nixpkgs/unstable/#tester-runNixOSTest the Nixpkgs manual]. A tutorial can be found at [https://nix.dev/tutorials/nixos/integration-testing-using-virtual-machines]. | The primary documentation for the [https://nixos.org/manual/nixos/stable/index.html#sec-nixos-tests NixOS VM testing framework] is in [https://nixos.org/manual/nixos/stable/index.html#sec-nixos-tests the NixOS manual], and in [https://nixos.org/manual/nixpkgs/unstable/#tester-runNixOSTest the Nixpkgs manual]. A tutorial can be found at [https://nix.dev/tutorials/nixos/integration-testing-using-virtual-machines]. | ||
| Line 19: | Line 23: | ||
Add this to your test config: | Add this to your test config: | ||
interactive. | interactive.sshBackdoor.enable = true; | ||
Now you can connect to this VM via | Now you can connect to this VM via (on linux): | ||
ssh root | ssh -o User=root vsock/3 | ||
If you are on MacOS or have multiple VMs look at the shell output that do run the interactive tests: | |||
[[File:Screenshot of interactive test just started.png|none|thumb|444x444px|Screenshot of just started nixos test for meilisearch (interactive)]] | |||
== How to debug tests ? == | == How to debug tests ? == | ||
| Line 396: | Line 388: | ||
/nix/store/bx7z3imvxxpwkkza10vb23czhw7873w2-vm-test-run-unnamed | /nix/store/bx7z3imvxxpwkkza10vb23czhw7873w2-vm-test-run-unnamed | ||
== Further reading == | |||
* [https://nixcademy.com/posts/running-nixos-integration-tests-on-macos/ Run NixOS Integration Tests on macOS, Nixcademy] | |||
* [https://nixcademy.com/posts/nixos-integration-tests/ Unveiling the Power of the NixOS Integration Test Driver (Part 1), Nixcademy] | |||
* [https://nixcademy.com/posts/nixos-integration-tests-part-2/ Unveiling the Power of the NixOS Integration Test Driver (Part 2), Nixcademy] | |||
[[Category:NixOS]] | [[Category:NixOS]] | ||