[Patchew-devel] [PATCH] testing: do not pass /dev/null stdin to script(1)

Paolo Bonzini pbonzini at redhat.com
Sun Jan 13 14:04:30 UTC 2019


The script tool exits immediately if it encounters an EOF on stdin.
Therefore, we must pass a pipe or the testers' cron jobs will exit
immediately and incorrectly.

The script is still run with /dev/null as stdin, to avoid hangs
on input.

Fixes: eaad26f749f349e182fc360e707ab4deb74f62bd
Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
---
 patchew-cli | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/patchew-cli b/patchew-cli
index 6a78f81..8012955 100755
--- a/patchew-cli
+++ b/patchew-cli
@@ -539,8 +539,8 @@ class TesterCommand(SubCommand):
             logf.write("=== OUTPUT BEGIN ===\n")
             logf.flush()
             start_time = time.time()
-            tp = subprocess.Popen(["/usr/bin/script", "-qefc", test_script, "/dev/null"],
-                                  cwd=clone, stdout=logf, stderr=logf)
+            tp = subprocess.Popen(["/usr/bin/script", "-qefc", test_script + "< /dev/null", "/dev/null"],
+                                  cwd=clone, stdin=subprocess.PIPE, stdout=logf, stderr=logf)
             rc = None
             timeout = r["test"]["timeout"]
             while timeout <= 0 or time.time() - start_time < timeout:
-- 
2.20.1




More information about the Patchew-devel mailing list