git.iko.soy/typeable/nixpkgs
on master help sign in
manual: re-add running nixos tests sections
commitf39b1ead2a5fba63be7cd77dd70c00c09d7f6aba authorDomen Kožar <domen@dev.si> dateTue 21 Apr 2015, 02:27 (12 years ago) parentdbaeb7c
4 files changed+47−40
nixos/doc/manual/development/development.xml+1 nixos/doc/manual/development/nixos-tests.xml+2−1 nixos/doc/manual/development/running-nixos-tests-interactively.xml+43 nixos/doc/manual/development/running-nixos-tests.xml+1−39
nixos/doc/manual/development/development.xml+1
@@ -15,6 +15,7 @@ NixOS.</para>
1515<xi:include href="writing-modules.xml" />
1616<xi:include href="building-parts.xml" />
1717<xi:include href="building-nixos.xml" />
18+<xi:include href="nixos-tests.xml" />
1819<xi:include href="testing-installer.xml" />
1920
2021</part>
nixos/doc/manual/development/nixos-tests.xml+2−1
@@ -15,5 +15,6 @@ required for the test.</para>
1515
1616<xi:include href="writing-nixos-tests.xml" />
1717<xi:include href="running-nixos-tests.xml" />
18+<xi:include href="running-nixos-tests-interactively.xml" />
1819
19−</chapter>
20+</chapter>
nixos/doc/manual/development/running-nixos-tests-interactively.xmlnew file+43
@@ -0,0 +1,43 @@
1+<section xmlns="http://docbook.org/ns/docbook"
2+ xmlns:xlink="http://www.w3.org/1999/xlink"
3+ xmlns:xi="http://www.w3.org/2001/XInclude"
4+ version="5.0"
5+ xml:id="sec-running-nixos-tests">
6+<title>Running Tests interactively</title>
7+
8+<para>The test itself can be run interactively. This is
9+particularly useful when developing or debugging a test:
10+
11+<screen>
12+$ nix-build nixos/tests/login.nix -A driver
13+$ ./result/bin/nixos-test-driver
14+starting VDE switch for network 1
15+&gt;
16+</screen>
17+
18+You can then take any Perl statement, e.g.
19+
20+<screen>
21+&gt; startAll
22+&gt; testScript
23+&gt; $machine->succeed("touch /tmp/foo")
24+</screen>
25+
26+The function <command>testScript</command> executes the entire test
27+script and drops you back into the test driver command line upon its
28+completion. This allows you to inspect the state of the VMs after the
29+test (e.g. to debug the test script).</para>
30+
31+<para>To just start and experiment with the VMs, run:
32+
33+<screen>
34+$ nix-build nixos/tests/login.nix -A driver
35+$ ./result/bin/nixos-run-vms
36+</screen>
37+
38+The script <command>nixos-run-vms</command> starts the virtual
39+machines defined by test. The root file system of the VMs is created
40+on the fly and kept across VM restarts in
41+<filename>./</filename><varname>hostname</varname><filename>.qcow2</filename>.</para>
42+
43+</section>
nixos/doc/manual/development/running-nixos-tests.xml+1−39
@@ -2,7 +2,7 @@
22 xmlns:xlink="http://www.w3.org/1999/xlink"
33 xmlns:xi="http://www.w3.org/2001/XInclude"
44 version="5.0"
5− xml:id="sec-running-nixos-tests">
5+ xml:id="sec-running-nixos-tests-interactively">
66
77<title>Running Tests</title>
88
@@ -38,42 +38,4 @@ $ firefox result/log.html
3838</screen>
3939
4040</para>
41−
42−<title>Running Tests interactively</title>
43−
44−<para>The test itself can be run interactively. This is
45−particularly useful when developing or debugging a test:
46−
47−<screen>
48−$ nix-build nixos/tests/login.nix -A driver
49−$ ./result/bin/nixos-test-driver
50−starting VDE switch for network 1
51−&gt;
52−</screen>
53−
54−You can then take any Perl statement, e.g.
55−
56−<screen>
57−&gt; startAll
58−&gt; testScript
59−&gt; $machine->succeed("touch /tmp/foo")
60−</screen>
61−
62−The function <command>testScript</command> executes the entire test
63−script and drops you back into the test driver command line upon its
64−completion. This allows you to inspect the state of the VMs after the
65−test (e.g. to debug the test script).</para>
66−
67−<para>To just start and experiment with the VMs, run:
68−
69−<screen>
70−$ nix-build nixos/tests/login.nix -A driver
71−$ ./result/bin/nixos-run-vms
72−</screen>
73−
74−The script <command>nixos-run-vms</command> starts the virtual
75−machines defined by test. The root file system of the VMs is created
76−on the fly and kept across VM restarts in
77−<filename>./</filename><varname>hostname</varname><filename>.qcow2</filename>.</para>
78−
7941</section>