···11+<section xmlns="http://docbook.org/ns/docbook"
22+ xmlns:xlink="http://www.w3.org/1999/xlink"
33+ xmlns:xi="http://www.w3.org/2001/XInclude"
44+ version="5.0"
55+ xml:id="sec-running-nixos-tests">
66+<title>Running Tests interactively</title>
77+88+<para>The test itself can be run interactively. This is
99+particularly useful when developing or debugging a test:
1010+1111+<screen>
1212+$ nix-build nixos/tests/login.nix -A driver
1313+$ ./result/bin/nixos-test-driver
1414+starting VDE switch for network 1
1515+>
1616+</screen>
1717+1818+You can then take any Perl statement, e.g.
1919+2020+<screen>
2121+> startAll
2222+> testScript
2323+> $machine->succeed("touch /tmp/foo")
2424+</screen>
2525+2626+The function <command>testScript</command> executes the entire test
2727+script and drops you back into the test driver command line upon its
2828+completion. This allows you to inspect the state of the VMs after the
2929+test (e.g. to debug the test script).</para>
3030+3131+<para>To just start and experiment with the VMs, run:
3232+3333+<screen>
3434+$ nix-build nixos/tests/login.nix -A driver
3535+$ ./result/bin/nixos-run-vms
3636+</screen>
3737+3838+The script <command>nixos-run-vms</command> starts the virtual
3939+machines defined by test. The root file system of the VMs is created
4040+on the fly and kept across VM restarts in
4141+<filename>./</filename><varname>hostname</varname><filename>.qcow2</filename>.</para>
4242+4343+</section>
···22 xmlns:xlink="http://www.w3.org/1999/xlink"
33 xmlns:xi="http://www.w3.org/2001/XInclude"
44 version="5.0"
55- xml:id="sec-running-nixos-tests">
55+ xml:id="sec-running-nixos-tests-interactively">
6677<title>Running Tests</title>
88···3838</screen>
39394040</para>
4141-4242-<title>Running Tests interactively</title>
4343-4444-<para>The test itself can be run interactively. This is
4545-particularly useful when developing or debugging a test:
4646-4747-<screen>
4848-$ nix-build nixos/tests/login.nix -A driver
4949-$ ./result/bin/nixos-test-driver
5050-starting VDE switch for network 1
5151->
5252-</screen>
5353-5454-You can then take any Perl statement, e.g.
5555-5656-<screen>
5757-> startAll
5858-> testScript
5959-> $machine->succeed("touch /tmp/foo")
6060-</screen>
6161-6262-The function <command>testScript</command> executes the entire test
6363-script and drops you back into the test driver command line upon its
6464-completion. This allows you to inspect the state of the VMs after the
6565-test (e.g. to debug the test script).</para>
6666-6767-<para>To just start and experiment with the VMs, run:
6868-6969-<screen>
7070-$ nix-build nixos/tests/login.nix -A driver
7171-$ ./result/bin/nixos-run-vms
7272-</screen>
7373-7474-The script <command>nixos-run-vms</command> starts the virtual
7575-machines defined by test. The root file system of the VMs is created
7676-on the fly and kept across VM restarts in
7777-<filename>./</filename><varname>hostname</varname><filename>.qcow2</filename>.</para>
7878-7941</section>