@@ -1,49 +0,0 @@
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-interactively">
6− <title>Running Tests interactively</title>
7−
8− <para>
9− The test itself can be run interactively. This is particularly useful when
10− developing or debugging a test:
11−<screen>
12−<prompt>$ </prompt>nix-build nixos/tests/login.nix -A driverInteractive
13−<prompt>$ </prompt>./result/bin/nixos-test-driver
14−starting VDE switch for network 1
15−<prompt>></prompt>
16−</screen>
17− You can then take any Python statement, e.g.
18−<screen>
19−<prompt>></prompt> start_all()
20−<prompt>></prompt> test_script()
21−<prompt>></prompt> machine.succeed("touch /tmp/foo")
22−<prompt>></prompt> print(machine.succeed("pwd")) # Show stdout of command
23−</screen>
24− The function <command>test_script</command> executes the entire test script
25− and drops you back into the test driver command line upon its completion.
26− This allows you to inspect the state of the VMs after the test (e.g. to debug
27− the test script).
28− </para>
29−
30− <para>
31− To just start and experiment with the VMs, run:
32−<screen>
33−<prompt>$ </prompt>nix-build nixos/tests/login.nix -A driverInteractive
34−<prompt>$ </prompt>./result/bin/nixos-run-vms
35−</screen>
36− The script <command>nixos-run-vms</command> starts the virtual machines
37− defined by test.
38− </para>
39−
40− <para>
41− You can re-use the VM states coming from a previous run
42− by setting the <command>--keep-vm-state</command> flag.
43−<screen>
44−<prompt>$ </prompt>./result/bin/nixos-run-vms --keep-vm-state
45−</screen>
46− The machine state is stored in the
47− <filename>$TMPDIR/vm-state-</filename><varname>machinename</varname> directory.
48− </para>
49−</section>