Review at https://gerrit.osmocom.org/7074
osmo-trx: Add cfg template Since commit 3da1f8352e337fb032bf7a58c2909d3ba918e237, osmo-trx requires a cfg file to start successfully. Change-Id: I8f0e0d0a9fa849f41c3cccc4059431f62f956eac --- M src/osmo_gsm_tester/bts_osmotrx.py A src/osmo_gsm_tester/templates/osmo-trx.cfg.tmpl 2 files changed, 40 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/74/7074/1 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index ea644f1..046f024 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -146,6 +146,7 @@ proc_trx = None BIN_TRX = 'osmo-trx' + CONF_OSMO_TRX = 'osmo-trx.cfg' def __init__(self, suite_run, listen_ip, bts_ip): super().__init__(log.C_RUN, OsmoTrx.BIN_TRX) @@ -154,12 +155,35 @@ self.listen_ip = listen_ip self.bts_ip = bts_ip + def configure(self): + self.config_file = self.run_dir.new_file(OsmoTrx.CONF_OSMO_TRX) + self.dbg(config_file=self.config_file) + + values = dict(osmo_bts_trx=config.get_defaults('osmo_trx')) + config.overlay(values, self.suite_run.config()) + config.overlay(values, { + 'osmo_trx': { + 'ip_address' : self.listen_ip, + } + }) + config.overlay(values, { 'osmo_trx': self.conf }) + + self.dbg('OSMO-TRX CONFIG:\n' + pprint.pformat(values)) + + with open(self.config_file, 'w') as f: + r = template.render(OsmoTrx.CONF_OSMO_TRX, values) + self.dbg(r) + f.write(r) + def start(self): self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) + self.configure() self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoTrx.BIN_TRX))) lib = self.inst.child('lib') self.env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } - self.proc_trx = self.launch_process(OsmoTrx.BIN_TRX, '-x', '-j', self.listen_ip, '-i', self.bts_ip) + self.proc_trx = self.launch_process(OsmoTrx.BIN_TRX, '-x', + '-j', self.listen_ip, '-i', self.bts_ip, + '-C', os.path.abspath(self.config_file)) def launch_process(self, binary_name, *args): binary = os.path.abspath(self.inst.child('bin', binary_name)) diff --git a/src/osmo_gsm_tester/templates/osmo-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-trx.cfg.tmpl new file mode 100644 index 0000000..2f03347 --- /dev/null +++ b/src/osmo_gsm_tester/templates/osmo-trx.cfg.tmpl @@ -0,0 +1,15 @@ +! +! OsmoHLR example configuration +! +log stderr + logging filter all 1 + logging color 1 + logging print category 1 + logging timestamp 1 + logging print extended-timestamp 1 + logging level all info +! +line vty + bind ${osmo_trx.ip_address.addr} +ctrl + bind ${osmo_trx.ip_address.addr} -- To view, visit https://gerrit.osmocom.org/7074 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8f0e0d0a9fa849f41c3cccc4059431f62f956eac Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol <pes...@sysmocom.de>