summaryrefslogtreecommitdiffstats
path: root/src/osmo_gsm_tester/process.py
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-05-06 16:05:33 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-05-08 10:10:03 +0000
commitacf0c937e7d12a3e389b722a246a7d95e511c523 (patch)
tree134afdb4882f89ac29985017e123c64ff15b570b /src/osmo_gsm_tester/process.py
parentf2d279c62115df49aec8bde998b9805492b1c6fa (diff)
fix prompt()
The prompt() is useful for supervisor (user) interaction during tests. However it had numerous problems: - closed stdin, so second prompt() didn't work - no editing - no utf-8 multichar - unflexible poll interval (poll often to stay responsive to input) and unrelated: - stdin was hijacked by subprocess.Popen Firstly pass stdin=PIPE to all subprocesses to leave the tester's stdin untouched. Secondly use python input() to read the user entry (instead of mucking about with the stdin fd), and import readline for history and editing features. The old approach was put in place to allow polling DBus and processes regularly. Instead, allow this by running input() in a separate thread while polling regularly and slowly in the main thread. The prompt code is now simpler, cleaner and works better. Will be used in the upcoming 'debug' suite. Change-Id: I580aca52cd038b59418055259d0d09e9aab49124
Diffstat (limited to 'src/osmo_gsm_tester/process.py')
-rw-r--r--src/osmo_gsm_tester/process.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py
index 16f7905..a687de6 100644
--- a/src/osmo_gsm_tester/process.py
+++ b/src/osmo_gsm_tester/process.py
@@ -73,6 +73,7 @@ class Process(log.Origin):
self.popen_args,
stdout=self.make_output_log('stdout'),
stderr=self.make_output_log('stderr'),
+ stdin=subprocess.PIPE,
shell=False,
cwd=self.run_dir.path,
**self.popen_kwargs)