about summary refs log tree commit diff
path: root/nixpkgs/nixos/doc/manual/development/running-nixos-tests.section.md
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/doc/manual/development/running-nixos-tests.section.md')
-rw-r--r--nixpkgs/nixos/doc/manual/development/running-nixos-tests.section.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/nixpkgs/nixos/doc/manual/development/running-nixos-tests.section.md b/nixpkgs/nixos/doc/manual/development/running-nixos-tests.section.md
new file mode 100644
index 000000000000..33076f5dc2a7
--- /dev/null
+++ b/nixpkgs/nixos/doc/manual/development/running-nixos-tests.section.md
@@ -0,0 +1,20 @@
+# Running Tests {#sec-running-nixos-tests}
+
+You can run tests using `nix-build`. For example, to run the test
+[`login.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix),
+you do:
+
+```ShellSession
+$ 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:
+
+```ShellSession
+$ nix-store --read-log result
+```