aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo_gsm_tester/bts_sysmo.py
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-11-23 11:01:24 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-12-05 13:36:46 +0000
commitce35d915922a7275298bfcb646832f08cff33362 (patch)
tree276b0df8367a5f02c313cf8f35e19cb0e62669f6 /src/osmo_gsm_tester/bts_sysmo.py
parente85f5c9009f44efa3fbe79450f2fabe8fa25b344 (diff)
OsmoPcuSysmo: Integrate with Sysmobts and OsmoSgsn
Diffstat (limited to 'src/osmo_gsm_tester/bts_sysmo.py')
-rw-r--r--src/osmo_gsm_tester/bts_sysmo.py38
1 files changed, 31 insertions, 7 deletions
diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py
index 1a7b139..812a247 100644
--- a/src/osmo_gsm_tester/bts_sysmo.py
+++ b/src/osmo_gsm_tester/bts_sysmo.py
@@ -19,11 +19,12 @@
import os
import pprint
-from . import log, config, util, template, process
+from . import log, config, util, template, process, pcu_sysmo
class SysmoBts(log.Origin):
suite_run = None
bsc = None
+ sgsn = None
run_dir = None
inst = None
remote_inst = None
@@ -32,8 +33,9 @@ class SysmoBts(log.Origin):
lac = None
cellid = None
proc_bts = None
+ _pcu = None
- REMOTE_DIR = '/osmo-gsm-tester'
+ REMOTE_DIR = '/osmo-gsm-tester-bts'
BTS_SYSMO_BIN = 'osmo-bts-sysmo'
BTS_SYSMO_CFG = 'osmo-bts-sysmo.cfg'
@@ -77,15 +79,22 @@ class SysmoBts(log.Origin):
remote_lib = self.remote_inst.child('lib')
remote_binary = self.remote_inst.child('bin', 'osmo-bts-sysmo')
- 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)
+
+ args = ('LD_LIBRARY_PATH=%s' % remote_lib,
+ remote_binary, '-c', remote_config_file, '-r', '1',
+ '-i', self.bsc.addr())
+
+ if self._direct_pcu_enabled():
+ args += ('-M',)
+
+ self.proc_bts = self.launch_remote('osmo-bts-sysmo', args, remote_cwd=remote_run_dir)
def cleanup(self):
pass
+ def _direct_pcu_enabled(self):
+ return util.str2bool(self.conf.get('direct_pcu'))
+
def pcu_socket_path(self):
return os.path.join(SysmoBts.REMOTE_DIR, 'pcu_bts')
@@ -117,9 +126,17 @@ class SysmoBts(log.Origin):
log.ctx(proc)
raise log.Error('Exited in error')
+ def pcu(self):
+ if self._pcu is None:
+ self._pcu = pcu_sysmo.OsmoPcuSysmo(self.suite_run, self, self.conf)
+ return self._pcu
+
def remote_addr(self):
return self.conf.get('addr')
+ def pcu_socket_path(self):
+ return os.path.join(SysmoBts.REMOTE_DIR, 'pcu_bts')
+
def configure(self):
if self.bsc is None:
raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be configured')
@@ -152,6 +169,10 @@ class SysmoBts(log.Origin):
if self.cellid is not None:
config.overlay(values, { 'cell_identity': self.cellid })
config.overlay(values, self.conf)
+
+ sgsn_conf = {} if self.sgsn is None else self.sgsn.conf_for_client()
+ config.overlay(values, sgsn_conf)
+
self.dbg(conf=values)
return values
@@ -163,6 +184,9 @@ class SysmoBts(log.Origin):
def set_bsc(self, bsc):
self.bsc = bsc
+ def set_sgsn(self, sgsn):
+ self.sgsn = sgsn
+
def set_lac(self, lac):
self.lac = lac