Merge pull request #156697 from marijanp/fix-146169
This commit is contained in:
commit
2774f31f40
@ -5,7 +5,7 @@ when developing or debugging a test:
|
|||||||
|
|
||||||
```ShellSession
|
```ShellSession
|
||||||
$ nix-build . -A nixosTests.login.driverInteractive
|
$ nix-build . -A nixosTests.login.driverInteractive
|
||||||
$ ./result/bin/nixos-test-driver --interactive
|
$ ./result/bin/nixos-test-driver
|
||||||
[...]
|
[...]
|
||||||
>>>
|
>>>
|
||||||
```
|
```
|
||||||
@ -28,7 +28,7 @@ You can re-use the VM states coming from a previous run by setting the
|
|||||||
`--keep-vm-state` flag.
|
`--keep-vm-state` flag.
|
||||||
|
|
||||||
```ShellSession
|
```ShellSession
|
||||||
$ ./result/bin/nixos-test-driver --interactive --keep-vm-state
|
$ ./result/bin/nixos-test-driver --keep-vm-state
|
||||||
```
|
```
|
||||||
|
|
||||||
The machine state is stored in the `$TMPDIR/vm-state-machinename`
|
The machine state is stored in the `$TMPDIR/vm-state-machinename`
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
</para>
|
</para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
$ nix-build . -A nixosTests.login.driverInteractive
|
$ nix-build . -A nixosTests.login.driverInteractive
|
||||||
$ ./result/bin/nixos-test-driver --interactive
|
$ ./result/bin/nixos-test-driver
|
||||||
[...]
|
[...]
|
||||||
>>>
|
>>>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@ -30,7 +30,7 @@ $ ./result/bin/nixos-test-driver --interactive
|
|||||||
the <literal>--keep-vm-state</literal> flag.
|
the <literal>--keep-vm-state</literal> flag.
|
||||||
</para>
|
</para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
$ ./result/bin/nixos-test-driver --interactive --keep-vm-state
|
$ ./result/bin/nixos-test-driver --keep-vm-state
|
||||||
</programlisting>
|
</programlisting>
|
||||||
<para>
|
<para>
|
||||||
The machine state is stored in the
|
The machine state is stored in the
|
||||||
|
@ -61,7 +61,7 @@ def main() -> None:
|
|||||||
"-I",
|
"-I",
|
||||||
"--interactive",
|
"--interactive",
|
||||||
help="drop into a python repl and run the tests interactively",
|
help="drop into a python repl and run the tests interactively",
|
||||||
action="store_true",
|
action=argparse.BooleanOptionalAction,
|
||||||
)
|
)
|
||||||
arg_parser.add_argument(
|
arg_parser.add_argument(
|
||||||
"--start-scripts",
|
"--start-scripts",
|
||||||
|
@ -51,6 +51,7 @@ rec {
|
|||||||
, enableOCR ? false
|
, enableOCR ? false
|
||||||
, skipLint ? false
|
, skipLint ? false
|
||||||
, passthru ? {}
|
, passthru ? {}
|
||||||
|
, interactive ? false
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
# Reifies and correctly wraps the python test driver for
|
# Reifies and correctly wraps the python test driver for
|
||||||
@ -139,7 +140,8 @@ rec {
|
|||||||
wrapProgram $out/bin/nixos-test-driver \
|
wrapProgram $out/bin/nixos-test-driver \
|
||||||
--set startScripts "''${vmStartScripts[*]}" \
|
--set startScripts "''${vmStartScripts[*]}" \
|
||||||
--set testScript "$out/test-script" \
|
--set testScript "$out/test-script" \
|
||||||
--set vlans '${toString vlans}'
|
--set vlans '${toString vlans}' \
|
||||||
|
${lib.optionalString (interactive) "--add-flags --interactive"}
|
||||||
'');
|
'');
|
||||||
|
|
||||||
# Make a full-blown test
|
# Make a full-blown test
|
||||||
@ -217,6 +219,7 @@ rec {
|
|||||||
testName = name;
|
testName = name;
|
||||||
qemu_pkg = pkgs.qemu;
|
qemu_pkg = pkgs.qemu;
|
||||||
nodes = nodes pkgs.qemu;
|
nodes = nodes pkgs.qemu;
|
||||||
|
interactive = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
test =
|
test =
|
||||||
|
Loading…
Reference in New Issue
Block a user