summary refs log tree commit diff
path: root/nixos/doc/manual/development/writing-nixos-tests.section.md
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2021-11-05 01:41:32 +0100
committerRobert Hensing <robert@roberthensing.nl>2021-11-05 02:41:25 +0100
commit698fb089d8276ac6907ae3a13ee1933a59e12112 (patch)
treeffde097c8a1a01bc0d2832423ac2e7accacca73e /nixos/doc/manual/development/writing-nixos-tests.section.md
parentbce05e3b6adab06eedff7cf5813d0936c4f9c5d2 (diff)
downloadnixpkgs-698fb089d8276ac6907ae3a13ee1933a59e12112.tar
nixpkgs-698fb089d8276ac6907ae3a13ee1933a59e12112.tar.gz
nixpkgs-698fb089d8276ac6907ae3a13ee1933a59e12112.tar.bz2
nixpkgs-698fb089d8276ac6907ae3a13ee1933a59e12112.tar.lz
nixpkgs-698fb089d8276ac6907ae3a13ee1933a59e12112.tar.xz
nixpkgs-698fb089d8276ac6907ae3a13ee1933a59e12112.tar.zst
nixpkgs-698fb089d8276ac6907ae3a13ee1933a59e12112.zip
nixosTest: Document stdout waiting behavior
Diffstat (limited to 'nixos/doc/manual/development/writing-nixos-tests.section.md')
-rw-r--r--nixos/doc/manual/development/writing-nixos-tests.section.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/nixos/doc/manual/development/writing-nixos-tests.section.md b/nixos/doc/manual/development/writing-nixos-tests.section.md
index bf80099f1a2..a8c54aa6676 100644
--- a/nixos/doc/manual/development/writing-nixos-tests.section.md
+++ b/nixos/doc/manual/development/writing-nixos-tests.section.md
@@ -159,6 +159,10 @@ The following methods are available on machine objects:
 `execute`
 
 :   Execute a shell command, returning a list `(status, stdout)`.
+    If the command detaches, it must close stdout, as `execute` will wait
+    for this to consume all output reliably. This can be achieved by
+    redirecting stdout to stderr `>&2`, to `/dev/console`, `/dev/null` or
+    a file.
     Takes an optional parameter `check_return` that defaults to `True`.
     Setting this parameter to `False` will not check for the return code
     and return -1 instead. This can be used for commands that shut down
@@ -179,6 +183,8 @@ The following methods are available on machine objects:
 
     -   Dereferencing unset variables fail the command.
 
+    -   It will wait for stdout to be closed. See `execute`.
+
 `fail`
 
 :   Like `succeed`, but raising an exception if the command returns a zero