summaryrefslogtreecommitdiffstats
path: root/src/osmo_gsm_tester/bts_sysmo.py
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-11-28 12:15:10 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2017-12-05 11:09:10 +0000
commitd0a01117dfa5c0c0f9947c3f095e40f61fe6884d (patch)
tree4923bf1984f42985dcb492dd78533132f7a3a075 /src/osmo_gsm_tester/bts_sysmo.py
parent4796b359bd2da1e40f55851aca7704ce058dd811 (diff)
bts_*: Add ready_for_pcu API
This is required to start osmo-pcu after osmo-bts is already setup and activated. Otherwise osmo-pcu ends after connecting to socket with: "pcu_l1_if.cpp:416 BTS not available" Change-Id: I7209589f60bda63094336e417638906be5e273c4
Diffstat (limited to 'src/osmo_gsm_tester/bts_sysmo.py')
-rw-r--r--src/osmo_gsm_tester/bts_sysmo.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py
index fc546ae..1a7b139 100644
--- a/src/osmo_gsm_tester/bts_sysmo.py
+++ b/src/osmo_gsm_tester/bts_sysmo.py
@@ -31,6 +31,7 @@ class SysmoBts(log.Origin):
remote_dir = None
lac = None
cellid = None
+ proc_bts = None
REMOTE_DIR = '/osmo-gsm-tester'
BTS_SYSMO_BIN = 'osmo-bts-sysmo'
@@ -76,11 +77,11 @@ class SysmoBts(log.Origin):
remote_lib = self.remote_inst.child('lib')
remote_binary = self.remote_inst.child('bin', 'osmo-bts-sysmo')
- self.launch_remote('osmo-bts-sysmo',
- ('LD_LIBRARY_PATH=%s' % remote_lib,
- remote_binary, '-c', remote_config_file, '-r', '1',
- '-i', self.bsc.addr()),
- remote_cwd=remote_run_dir)
+ self.proc_bts = self.launch_remote('osmo-bts-sysmo',
+ ('LD_LIBRARY_PATH=%s' % remote_lib,
+ remote_binary, '-c', remote_config_file, '-r', '1',
+ '-i', self.bsc.addr()),
+ remote_cwd=remote_run_dir)
def cleanup(self):
pass
@@ -105,6 +106,7 @@ class SysmoBts(log.Origin):
proc = self._process_remote(name, popen_args, remote_cwd)
self.suite_run.remember_to_stop(proc)
proc.launch()
+ return proc
def run_local(self, name, popen_args):
run_dir = self.run_dir.new_dir(name)
@@ -153,6 +155,11 @@ class SysmoBts(log.Origin):
self.dbg(conf=values)
return values
+ def ready_for_pcu(self):
+ if not self.proc_bts or not self.proc_bts.is_running:
+ return False
+ return 'BTS is up' in (self.proc_bts.get_stderr() or '')
+
def set_bsc(self, bsc):
self.bsc = bsc