diff options
author | Bobby Rong <rjl931189261@126.com> | 2021-07-02 20:23:38 +0800 |
---|---|---|
committer | Bobby Rong <rjl931189261@126.com> | 2021-07-02 20:23:38 +0800 |
commit | 8fafcfa3ea8730b9e265fd0d4f605fd86897b116 (patch) | |
tree | 0438c3a07fe3a2fd97b00d4054a3ebf992081c93 /nixos/doc/manual/from_md/development/running-nixos-tests.section.xml | |
parent | 163976c296a3ba07680b524855b1762c77a15249 (diff) | |
download | nixpkgs-8fafcfa3ea8730b9e265fd0d4f605fd86897b116.tar nixpkgs-8fafcfa3ea8730b9e265fd0d4f605fd86897b116.tar.gz nixpkgs-8fafcfa3ea8730b9e265fd0d4f605fd86897b116.tar.bz2 nixpkgs-8fafcfa3ea8730b9e265fd0d4f605fd86897b116.tar.lz nixpkgs-8fafcfa3ea8730b9e265fd0d4f605fd86897b116.tar.xz nixpkgs-8fafcfa3ea8730b9e265fd0d4f605fd86897b116.tar.zst nixpkgs-8fafcfa3ea8730b9e265fd0d4f605fd86897b116.zip |
nixos: nixos/doc/manual/development/running-nixos-tests.xml to CommonMark
Diffstat (limited to 'nixos/doc/manual/from_md/development/running-nixos-tests.section.xml')
-rw-r--r-- | nixos/doc/manual/from_md/development/running-nixos-tests.section.xml | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/nixos/doc/manual/from_md/development/running-nixos-tests.section.xml b/nixos/doc/manual/from_md/development/running-nixos-tests.section.xml new file mode 100644 index 00000000000..7159b95b22b --- /dev/null +++ b/nixos/doc/manual/from_md/development/running-nixos-tests.section.xml @@ -0,0 +1,34 @@ +<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-running-nixos-tests"> + <title>Running Tests</title> + <para> + You can run tests using <literal>nix-build</literal>. For example, + to run the test + <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix"><literal>login.nix</literal></link>, + you just do: + </para> + <programlisting> +$ nix-build '<nixpkgs/nixos/tests/login.nix>' +</programlisting> + <para> + or, if you don’t want to rely on <literal>NIX_PATH</literal>: + </para> + <programlisting> +$ cd /my/nixpkgs/nixos/tests +$ nix-build login.nix +… +running the VM test script +machine: QEMU running (pid 8841) +… +6 out of 6 tests succeeded +</programlisting> + <para> + 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 pretty-printed log of the test: + </para> + <programlisting> +$ firefox result/log.html +</programlisting> +</section> |