depot/third_party/nixpkgs/nixos/doc/manual/development/running-nixos-tests.section.md
Default email 5083ee08a2 Project import generated by Copybara.
GitOrigin-RevId: 10ecda252ce1b3b1d6403caeadbcc8f30d5ab796
2022-09-30 06:47:45 -05:00

652 B

Running Tests

You can run tests using nix-build. For example, to run the test login.nix, you do:

$ cd /my/git/clone/of/nixpkgs
$ nix-build -A nixosTests.login

After building/downloading all required dependencies, this will perform a build that starts a QEMU/KVM virtual machine containing a NixOS system. The virtual machine mounts the Nix store of the host; this makes VM creation very fast, as no disk image needs to be created. Afterwards, you can view a log of the test:

$ nix-store --read-log result