summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatrick Hilhorst <git@hilhorst.be>2021-06-02 14:49:59 +0200
committerPatrick Hilhorst <git@hilhorst.be>2021-06-02 14:49:59 +0200
commit9469433e341f7337308468bb4b9ccfff84b2951b (patch)
treee8e2d2939f3014e2e66e1ca9793b405caf129475
parent5a589b5ba8941d734e9c3aebbf2be2f50d7c32a5 (diff)
downloadnixpkgs-9469433e341f7337308468bb4b9ccfff84b2951b.tar
nixpkgs-9469433e341f7337308468bb4b9ccfff84b2951b.tar.gz
nixpkgs-9469433e341f7337308468bb4b9ccfff84b2951b.tar.bz2
nixpkgs-9469433e341f7337308468bb4b9ccfff84b2951b.tar.lz
nixpkgs-9469433e341f7337308468bb4b9ccfff84b2951b.tar.xz
nixpkgs-9469433e341f7337308468bb4b9ccfff84b2951b.tar.zst
nixpkgs-9469433e341f7337308468bb4b9ccfff84b2951b.zip
nixos/tests/test-driver: document shell_interact
-rw-r--r--nixos/doc/manual/development/writing-nixos-tests.xml11
-rw-r--r--nixos/lib/test-driver/test-driver.py2
2 files changed, 12 insertions, 1 deletions
diff --git a/nixos/doc/manual/development/writing-nixos-tests.xml b/nixos/doc/manual/development/writing-nixos-tests.xml
index 5a95436915f..c29f2b01064 100644
--- a/nixos/doc/manual/development/writing-nixos-tests.xml
+++ b/nixos/doc/manual/development/writing-nixos-tests.xml
@@ -436,6 +436,17 @@ machine.systemctl("list-jobs --no-pager", "any-user") # spawns a shell for `any-
      </para>
     </listitem>
    </varlistentry>
+   <varlistentry>
+    <term>
+     <methodname>shell_interact</methodname>
+    </term>
+    <listitem>
+     <para>
+      Allows you to directly interact with the guest shell.
+      This should only be used during test development, not in production tests.
+     </para>
+    </listitem>
+   </varlistentry>
   </variablelist>
  </para>
 
diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py
index 90ae2e558ef..6669c914f76 100644
--- a/nixos/lib/test-driver/test-driver.py
+++ b/nixos/lib/test-driver/test-driver.py
@@ -459,7 +459,7 @@ class Machine:
     def shell_interact(self) -> None:
         """Allows you to interact with the guest shell
 
-        Should only be used during testing, not in the production test."""
+        Should only be used during test development, not in the production test."""
         self.connect()
         telnet = telnetlib.Telnet()
         telnet.sock = self.shell  # type: ignore