Unverified Commit 70ec3b9f authored by Robert Hensing's avatar Robert Hensing Committed by GitHub
Browse files

Merge pull request #193498 from hercules-ci/nixos-doc-disambiguate-test-options

nixos/doc: disambiguate test option ids
parents 603bdef4 216c5dc1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ let
      };
      documentType = "none";
      variablelistId = "test-options-list";
      optionIdPrefix = "test-opt-";
    };

  sources = lib.sourceFilesBySuffices ./. [".xml"];
+2 −2
Original line number Diff line number Diff line
@@ -39,11 +39,11 @@ directory.
## Interactive-only test configuration {#sec-nixos-test-interactive-configuration}

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.

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
instead, and call it with the flag `result/bin/nixos-test-driver --interactive`.
+6 −6
Original line number Diff line number Diff line
@@ -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
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
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
[`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.

    ::: {.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`
@@ -180,7 +180,7 @@ The following methods are available on machine objects:
    machine\'s screen using optical character recognition.

    ::: {.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`
@@ -291,7 +291,7 @@ The following methods are available on machine objects:
    `get_screen_text` and `get_screen_text_variants`).

    ::: {.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`
+2 −2
Original line number Diff line number Diff line
@@ -44,14 +44,14 @@ $ ./result/bin/nixos-test-driver --keep-vm-state
    <para>
      The <literal>.driverInteractive</literal> attribute combines 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
      slightly different configuration.
    </para>
    <para>
      You can add your own interactive-only test configuration by adding
      extra configuration to the
      <link linkend="opt-interactive"><literal>interactive</literal>
      <link linkend="test-opt-interactive"><literal>interactive</literal>
      submodule</link>.
    </para>
    <para>
+6 −6
Original line number Diff line number Diff line
@@ -24,16 +24,16 @@
  <para>
    We refer to the whole test above as a test module, whereas the
    values in
    <link linkend="opt-nodes"><literal>nodes.&lt;name&gt;</literal></link>
    <link linkend="test-opt-nodes"><literal>nodes.&lt;name&gt;</literal></link>
    are NixOS modules themselves.
  </para>
  <para>
    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).
    During the test, it will start one or more virtual machines, the
    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>
    An example of a single-node test is
@@ -263,7 +263,7 @@ start_all()
          <note>
            <para>
              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>.
            </para>
          </note>
@@ -281,7 +281,7 @@ start_all()
          <note>
            <para>
              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>.
            </para>
          </note>
@@ -522,7 +522,7 @@ start_all()
          <note>
            <para>
              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>.
            </para>
          </note>
Loading