summaryrefslogtreecommitdiffstats
path: root/src/osmo_gsm_tester/process.py
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-05-22 20:32:30 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-05-25 12:31:20 +0200
commitb1526b9979ae1b04819cc6130a7fb36e97c82811 (patch)
treef5e0172870336d986debe2443979248cb327d165 /src/osmo_gsm_tester/process.py
parent06ada458cfbd0cec5aec8ec12122af4dfd77a177 (diff)
Add option to expect bts/pcu failures and respawn its processes
Some tests may want to reproduce some scenarios in which it is expected that a BTS process is stopped, for instance if the BSC link is dropped. Provide a keepalive parameter to start() for bts and pcu objects to inform suite that failures are expected and that it should keep them alive in case that ocurrs by respawning the BTS process. Change-Id: Ia2a7539f9fad457125ac9b60a52a52999e885ba8
Diffstat (limited to 'src/osmo_gsm_tester/process.py')
-rw-r--r--src/osmo_gsm_tester/process.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py
index 477a096..c13ded0 100644
--- a/src/osmo_gsm_tester/process.py
+++ b/src/osmo_gsm_tester/process.py
@@ -79,6 +79,13 @@ class Process(log.Origin):
self.set_name(self.name_str, pid=self.process_obj.pid)
self.log('Launched')
+ def respawn(self):
+ self.dbg('respawn')
+ assert not self.is_running()
+ self.result = None
+ self.killed = None
+ self.launch()
+
def _poll_termination(self, time_to_wait_for_term=5):
wait_step = 0.001
waited_time = 0