summaryrefslogtreecommitdiffstats
path: root/src/osmo_gsm_tester/bts_sysmo.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/bts_sysmo.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/bts_sysmo.py')
-rw-r--r--src/osmo_gsm_tester/bts_sysmo.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py
index d0f6ff3..65c9279 100644
--- a/src/osmo_gsm_tester/bts_sysmo.py
+++ b/src/osmo_gsm_tester/bts_sysmo.py
@@ -54,9 +54,9 @@ class SysmoBts(bts_osmo.OsmoBts):
log.ctx(proc)
raise log.Error('Exited in error')
- def launch_remote(self, name, popen_args, remote_cwd=None):
+ def launch_remote(self, name, popen_args, remote_cwd=None, keepalive=False):
proc = self._process_remote(name, popen_args, remote_cwd)
- self.suite_run.remember_to_stop(proc)
+ self.suite_run.remember_to_stop(proc, keepalive)
proc.launch()
return proc
@@ -110,7 +110,7 @@ class SysmoBts(bts_osmo.OsmoBts):
###################
# PUBLIC (test API included)
###################
- def start(self):
+ def start(self, keepalive=False):
if self.bsc is None:
raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started')
log.log('Starting sysmoBTS to connect to', self.bsc)
@@ -151,6 +151,6 @@ class SysmoBts(bts_osmo.OsmoBts):
if self._direct_pcu_enabled():
args += ('-M',)
- self.proc_bts = self.launch_remote('osmo-bts-sysmo', args, remote_cwd=remote_run_dir)
+ self.proc_bts = self.launch_remote('osmo-bts-sysmo', args, remote_cwd=remote_run_dir, keepalive=keepalive)
# vim: expandtab tabstop=4 shiftwidth=4