summaryrefslogtreecommitdiffstats
path: root/src/osmo_gsm_tester/process.py
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-04-09 22:01:16 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-04-09 22:01:16 +0200
commit85eb324165a8f4076fdd58f9d84b6c0443b5beb9 (patch)
treecb8da57dbaf55f463be4138c809b150e9f430635 /src/osmo_gsm_tester/process.py
parentb02c21115d1f2c76aa134ce7447998e9b26cc0b7 (diff)
make prematurely exited processes fail the test
Diffstat (limited to 'src/osmo_gsm_tester/process.py')
-rw-r--r--src/osmo_gsm_tester/process.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py
index 4cf1b8d..8152ff0 100644
--- a/src/osmo_gsm_tester/process.py
+++ b/src/osmo_gsm_tester/process.py
@@ -133,8 +133,20 @@ class Process(log.Origin):
self.log('Terminated', rc=self.result)
else:
self.err('Terminated: ERROR', rc=self.result)
- #self.err('stdout:\n', self.get_stdout_tail(prefix='| '), '\n')
- self.err('stderr:\n', self.get_stderr_tail(prefix='| '), '\n')
+ #self.log_stdout_tail()
+ self.log_stderr_tail()
+
+ def log_stdout_tail(self):
+ m = self.get_stdout_tail(prefix='| ')
+ if not m:
+ return
+ self.log('stdout:\n', m, '\n')
+
+ def log_stderr_tail(self):
+ m = self.get_stderr_tail(prefix='| ')
+ if not m:
+ return
+ self.log('stderr:\n', m, '\n')
def close_output_logs(self):
self.dbg('Cleanup')
@@ -154,6 +166,9 @@ class Process(log.Origin):
if self.result is not None:
self.cleanup()
+ def is_running(self):
+ return self.process_obj is not None and self.result is None
+
def get_output(self, which):
v = self.outputs.get(which)
if not v: