mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/doc: Disambiguate test option ids
Changing this later on would break external links into the manual.
This commit is contained in:
parent
91879ce160
commit
216c5dc10d
9 changed files with 27 additions and 26 deletions
|
@ -63,6 +63,7 @@ let
|
||||||
};
|
};
|
||||||
documentType = "none";
|
documentType = "none";
|
||||||
variablelistId = "test-options-list";
|
variablelistId = "test-options-list";
|
||||||
|
optionIdPrefix = "test-opt-";
|
||||||
};
|
};
|
||||||
|
|
||||||
sources = lib.sourceFilesBySuffices ./. [".xml"];
|
sources = lib.sourceFilesBySuffices ./. [".xml"];
|
||||||
|
|
|
@ -39,11 +39,11 @@ directory.
|
||||||
## Interactive-only test configuration {#sec-nixos-test-interactive-configuration}
|
## Interactive-only test configuration {#sec-nixos-test-interactive-configuration}
|
||||||
|
|
||||||
The `.driverInteractive` attribute combines the regular test configuration with
|
The `.driverInteractive` attribute combines the regular test configuration with
|
||||||
definitions from the [`interactive` submodule](#opt-interactive). This gives you
|
definitions from the [`interactive` submodule](#test-opt-interactive). This gives you
|
||||||
a more usable, graphical, but slightly different configuration.
|
a more usable, graphical, but slightly different configuration.
|
||||||
|
|
||||||
You can add your own interactive-only test configuration by adding extra
|
You can add your own interactive-only test configuration by adding extra
|
||||||
configuration to the [`interactive` submodule](#opt-interactive).
|
configuration to the [`interactive` submodule](#test-opt-interactive).
|
||||||
|
|
||||||
To interactively run only the regular configuration, build the `<test>.driver` attribute
|
To interactively run only the regular configuration, build the `<test>.driver` attribute
|
||||||
instead, and call it with the flag `result/bin/nixos-test-driver --interactive`.
|
instead, and call it with the flag `result/bin/nixos-test-driver --interactive`.
|
||||||
|
|
|
@ -22,12 +22,12 @@ A NixOS test is a module that has the following structure:
|
||||||
```
|
```
|
||||||
|
|
||||||
We refer to the whole test above as a test module, whereas the values
|
We refer to the whole test above as a test module, whereas the values
|
||||||
in [`nodes.<name>`](#opt-nodes) are NixOS modules themselves.
|
in [`nodes.<name>`](#test-opt-nodes) are NixOS modules themselves.
|
||||||
|
|
||||||
The option [`testScript`](#opt-testScript) is a piece of Python code that executes the
|
The option [`testScript`](#test-opt-testScript) is a piece of Python code that executes the
|
||||||
test (described below). During the test, it will start one or more
|
test (described below). During the test, it will start one or more
|
||||||
virtual machines, the configuration of which is described by
|
virtual machines, the configuration of which is described by
|
||||||
the option [`nodes`](#opt-nodes).
|
the option [`nodes`](#test-opt-nodes).
|
||||||
|
|
||||||
An example of a single-node test is
|
An example of a single-node test is
|
||||||
[`login.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix).
|
[`login.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix).
|
||||||
|
@ -171,7 +171,7 @@ The following methods are available on machine objects:
|
||||||
least one will be returned.
|
least one will be returned.
|
||||||
|
|
||||||
::: {.note}
|
::: {.note}
|
||||||
This requires [`enableOCR`](#opt-enableOCR) to be set to `true`.
|
This requires [`enableOCR`](#test-opt-enableOCR) to be set to `true`.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
`get_screen_text`
|
`get_screen_text`
|
||||||
|
@ -180,7 +180,7 @@ The following methods are available on machine objects:
|
||||||
machine\'s screen using optical character recognition.
|
machine\'s screen using optical character recognition.
|
||||||
|
|
||||||
::: {.note}
|
::: {.note}
|
||||||
This requires [`enableOCR`](#opt-enableOCR) to be set to `true`.
|
This requires [`enableOCR`](#test-opt-enableOCR) to be set to `true`.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
`send_monitor_command`
|
`send_monitor_command`
|
||||||
|
@ -291,7 +291,7 @@ The following methods are available on machine objects:
|
||||||
`get_screen_text` and `get_screen_text_variants`).
|
`get_screen_text` and `get_screen_text_variants`).
|
||||||
|
|
||||||
::: {.note}
|
::: {.note}
|
||||||
This requires [`enableOCR`](#opt-enableOCR) to be set to `true`.
|
This requires [`enableOCR`](#test-opt-enableOCR) to be set to `true`.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
`wait_for_console_text`
|
`wait_for_console_text`
|
||||||
|
|
|
@ -44,14 +44,14 @@ $ ./result/bin/nixos-test-driver --keep-vm-state
|
||||||
<para>
|
<para>
|
||||||
The <literal>.driverInteractive</literal> attribute combines the
|
The <literal>.driverInteractive</literal> attribute combines the
|
||||||
regular test configuration with definitions from the
|
regular test configuration with definitions from the
|
||||||
<link linkend="opt-interactive"><literal>interactive</literal>
|
<link linkend="test-opt-interactive"><literal>interactive</literal>
|
||||||
submodule</link>. This gives you a more usable, graphical, but
|
submodule</link>. This gives you a more usable, graphical, but
|
||||||
slightly different configuration.
|
slightly different configuration.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
You can add your own interactive-only test configuration by adding
|
You can add your own interactive-only test configuration by adding
|
||||||
extra configuration to the
|
extra configuration to the
|
||||||
<link linkend="opt-interactive"><literal>interactive</literal>
|
<link linkend="test-opt-interactive"><literal>interactive</literal>
|
||||||
submodule</link>.
|
submodule</link>.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
|
|
|
@ -24,16 +24,16 @@
|
||||||
<para>
|
<para>
|
||||||
We refer to the whole test above as a test module, whereas the
|
We refer to the whole test above as a test module, whereas the
|
||||||
values in
|
values in
|
||||||
<link linkend="opt-nodes"><literal>nodes.<name></literal></link>
|
<link linkend="test-opt-nodes"><literal>nodes.<name></literal></link>
|
||||||
are NixOS modules themselves.
|
are NixOS modules themselves.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
The option
|
The option
|
||||||
<link linkend="opt-testScript"><literal>testScript</literal></link>
|
<link linkend="test-opt-testScript"><literal>testScript</literal></link>
|
||||||
is a piece of Python code that executes the test (described below).
|
is a piece of Python code that executes the test (described below).
|
||||||
During the test, it will start one or more virtual machines, the
|
During the test, it will start one or more virtual machines, the
|
||||||
configuration of which is described by the option
|
configuration of which is described by the option
|
||||||
<link linkend="opt-nodes"><literal>nodes</literal></link>.
|
<link linkend="test-opt-nodes"><literal>nodes</literal></link>.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
An example of a single-node test is
|
An example of a single-node test is
|
||||||
|
@ -263,7 +263,7 @@ start_all()
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
This requires
|
This requires
|
||||||
<link linkend="opt-enableOCR"><literal>enableOCR</literal></link>
|
<link linkend="test-opt-enableOCR"><literal>enableOCR</literal></link>
|
||||||
to be set to <literal>true</literal>.
|
to be set to <literal>true</literal>.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
@ -281,7 +281,7 @@ start_all()
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
This requires
|
This requires
|
||||||
<link linkend="opt-enableOCR"><literal>enableOCR</literal></link>
|
<link linkend="test-opt-enableOCR"><literal>enableOCR</literal></link>
|
||||||
to be set to <literal>true</literal>.
|
to be set to <literal>true</literal>.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
@ -522,7 +522,7 @@ start_all()
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
This requires
|
This requires
|
||||||
<link linkend="opt-enableOCR"><literal>enableOCR</literal></link>
|
<link linkend="test-opt-enableOCR"><literal>enableOCR</literal></link>
|
||||||
to be set to <literal>true</literal>.
|
to be set to <literal>true</literal>.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
|
|
@ -120,7 +120,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
qemu.package = mkOption {
|
qemu.package = mkOption {
|
||||||
description = mdDoc "Which qemu package to use for the virtualisation of [{option}`nodes`](#opt-nodes).";
|
description = mdDoc "Which qemu package to use for the virtualisation of [{option}`nodes`](#test-opt-nodes).";
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default = hostPkgs.qemu_test;
|
default = hostPkgs.qemu_test;
|
||||||
defaultText = "hostPkgs.qemu_test";
|
defaultText = "hostPkgs.qemu_test";
|
||||||
|
@ -152,7 +152,7 @@ in
|
||||||
description = mdDoc ''
|
description = mdDoc ''
|
||||||
Extra arguments to pass to the test driver.
|
Extra arguments to pass to the test driver.
|
||||||
|
|
||||||
They become part of [{option}`driver`](#opt-driver) via `wrapProgram`.
|
They become part of [{option}`driver`](#test-opt-driver) via `wrapProgram`.
|
||||||
'';
|
'';
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
default = [];
|
default = [];
|
||||||
|
@ -172,7 +172,7 @@ in
|
||||||
description = mdDoc ''
|
description = mdDoc ''
|
||||||
Disable type checking. This must not be enabled for new NixOS tests.
|
Disable type checking. This must not be enabled for new NixOS tests.
|
||||||
|
|
||||||
This may speed up your iteration cycle, unless you're working on the [{option}`testScript`](#opt-testScript).
|
This may speed up your iteration cycle, unless you're working on the [{option}`testScript`](#test-opt-testScript).
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,14 +24,14 @@ in
|
||||||
type = types.nullOr types.int;
|
type = types.nullOr types.int;
|
||||||
default = null; # NOTE: null values are filtered out by `meta`.
|
default = null; # NOTE: null values are filtered out by `meta`.
|
||||||
description = mdDoc ''
|
description = mdDoc ''
|
||||||
The [{option}`test`](#opt-test)'s [`meta.timeout`](https://nixos.org/manual/nixpkgs/stable/#var-meta-timeout) in seconds.
|
The [{option}`test`](#test-opt-test)'s [`meta.timeout`](https://nixos.org/manual/nixpkgs/stable/#var-meta-timeout) in seconds.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
broken = lib.mkOption {
|
broken = lib.mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = mdDoc ''
|
description = mdDoc ''
|
||||||
Sets the [`meta.broken`](https://nixos.org/manual/nixpkgs/stable/#var-meta-broken) attribute on the [{option}`test`](#opt-test) derivation.
|
Sets the [`meta.broken`](https://nixos.org/manual/nixpkgs/stable/#var-meta-broken) attribute on the [{option}`test`](#test-opt-test) derivation.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,7 +7,7 @@ in
|
||||||
description = mdDoc ''
|
description = mdDoc ''
|
||||||
The name of the test.
|
The name of the test.
|
||||||
|
|
||||||
This is used in the derivation names of the [{option}`driver`](#opt-driver) and [{option}`test`](#opt-test) runner.
|
This is used in the derivation names of the [{option}`driver`](#test-opt-driver) and [{option}`test`](#test-opt-test) runner.
|
||||||
'';
|
'';
|
||||||
type = types.str;
|
type = types.str;
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,7 +44,7 @@ in
|
||||||
description = mdDoc ''
|
description = mdDoc ''
|
||||||
An attribute set of NixOS configuration modules.
|
An attribute set of NixOS configuration modules.
|
||||||
|
|
||||||
The configurations are augmented by the [`defaults`](#opt-defaults) option.
|
The configurations are augmented by the [`defaults`](#test-opt-defaults) option.
|
||||||
|
|
||||||
They are assigned network addresses according to the `nixos/lib/testing/network.nix` module.
|
They are assigned network addresses according to the `nixos/lib/testing/network.nix` module.
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ in
|
||||||
|
|
||||||
defaults = mkOption {
|
defaults = mkOption {
|
||||||
description = mdDoc ''
|
description = mdDoc ''
|
||||||
NixOS configuration that is applied to all [{option}`nodes`](#opt-nodes).
|
NixOS configuration that is applied to all [{option}`nodes`](#test-opt-nodes).
|
||||||
'';
|
'';
|
||||||
type = types.deferredModule;
|
type = types.deferredModule;
|
||||||
default = { };
|
default = { };
|
||||||
|
@ -62,7 +62,7 @@ in
|
||||||
|
|
||||||
extraBaseModules = mkOption {
|
extraBaseModules = mkOption {
|
||||||
description = mdDoc ''
|
description = mdDoc ''
|
||||||
NixOS configuration that, like [{option}`defaults`](#opt-defaults), is applied to all [{option}`nodes`](#opt-nodes) and can not be undone with [`specialisation.<name>.inheritParentConfig`](https://search.nixos.org/options?show=specialisation.%3Cname%3E.inheritParentConfig&from=0&size=50&sort=relevance&type=packages&query=specialisation).
|
NixOS configuration that, like [{option}`defaults`](#test-opt-defaults), is applied to all [{option}`nodes`](#test-opt-nodes) and can not be undone with [`specialisation.<name>.inheritParentConfig`](https://search.nixos.org/options?show=specialisation.%3Cname%3E.inheritParentConfig&from=0&size=50&sort=relevance&type=packages&query=specialisation).
|
||||||
'';
|
'';
|
||||||
type = types.deferredModule;
|
type = types.deferredModule;
|
||||||
default = { };
|
default = { };
|
||||||
|
@ -82,7 +82,7 @@ in
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = mdDoc ''
|
description = mdDoc ''
|
||||||
Enable to configure all [{option}`nodes`](#opt-nodes) to run with a minimal kernel.
|
Enable to configure all [{option}`nodes`](#test-opt-nodes) to run with a minimal kernel.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue