From 8fafcfa3ea8730b9e265fd0d4f605fd86897b116 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Fri, 2 Jul 2021 20:23:38 +0800 Subject: [PATCH] nixos: nixos/doc/manual/development/running-nixos-tests.xml to CommonMark --- nixos/doc/manual/development/nixos-tests.xml | 2 +- .../running-nixos-tests.section.md | 31 ++++++++++++++++ .../development/running-nixos-tests.xml | 36 ------------------- .../running-nixos-tests.section.xml | 34 ++++++++++++++++++ 4 files changed, 66 insertions(+), 37 deletions(-) create mode 100644 nixos/doc/manual/development/running-nixos-tests.section.md delete mode 100644 nixos/doc/manual/development/running-nixos-tests.xml create mode 100644 nixos/doc/manual/from_md/development/running-nixos-tests.section.xml diff --git a/nixos/doc/manual/development/nixos-tests.xml b/nixos/doc/manual/development/nixos-tests.xml index 77b7595431ea..834a321ec4c6 100644 --- a/nixos/doc/manual/development/nixos-tests.xml +++ b/nixos/doc/manual/development/nixos-tests.xml @@ -14,6 +14,6 @@ xlink:href="https://github.com/NixOS/nixpkgs/tree/master/nixos/tests">nixos/test test. - + diff --git a/nixos/doc/manual/development/running-nixos-tests.section.md b/nixos/doc/manual/development/running-nixos-tests.section.md new file mode 100644 index 000000000000..d6a456f01883 --- /dev/null +++ b/nixos/doc/manual/development/running-nixos-tests.section.md @@ -0,0 +1,31 @@ +# 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 just do: + +```ShellSession +$ nix-build '' +``` + +or, if you don't want to rely on `NIX_PATH`: + +```ShellSession +$ 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 +``` + +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: + +```ShellSession +$ firefox result/log.html +``` diff --git a/nixos/doc/manual/development/running-nixos-tests.xml b/nixos/doc/manual/development/running-nixos-tests.xml deleted file mode 100644 index e9257c907daf..000000000000 --- a/nixos/doc/manual/development/running-nixos-tests.xml +++ /dev/null @@ -1,36 +0,0 @@ -
- Running Tests - - - You can run tests using nix-build. For example, to run the - test - login.nix, - you just do: - -$ nix-build '<nixpkgs/nixos/tests/login.nix>' - - or, if you don’t want to rely on NIX_PATH: - -$ 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 - - 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: - -$ firefox result/log.html - - -
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 000000000000..7159b95b22b0 --- /dev/null +++ b/nixos/doc/manual/from_md/development/running-nixos-tests.section.xml @@ -0,0 +1,34 @@ +
+ Running Tests + + You can run tests using nix-build. For example, + to run the test + login.nix, + you just do: + + +$ nix-build '<nixpkgs/nixos/tests/login.nix>' + + + or, if you don’t want to rely on NIX_PATH: + + +$ 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 + + + 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: + + +$ firefox result/log.html + +