path: root/src/osmo_gsm_tester/bts_sysmo.py
diff options
authorNeels Hofmeyr <neels@hofmeyr.de>2017-05-22 19:58:41 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-05-29 00:18:43 +0200
commitd41dae9820b519351845e56bc60795901bb0c64f (patch)
tree21ce30fd7e19bd5327578c5768b5dc46571fd03f /src/osmo_gsm_tester/bts_sysmo.py
parent4f59ba6e68f94c230e8e80bcdc29c03f22607a09 (diff)
bts: add remote_addr() function
To start an MGCPGW, we so far need the BTS address in advance (should get fixed at some point, but so far we do). The sysmoBTS has a fixed IP address configured. The osmo-bts-trx so far always uses (should also be fixed at some point). Both now return this address with the remote_addr() function. This also replaces a SysmoBts.remote_addr member variable (which is not sufficient because it is only populated during configure()). Change-Id: I7af9275914f34808cb60ae16b65ecd3688fd6b5b
Diffstat (limited to 'src/osmo_gsm_tester/bts_sysmo.py')
1 files changed, 6 insertions, 6 deletions
diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py
index 5cc304f..2da0396 100644
--- a/src/osmo_gsm_tester/bts_sysmo.py
+++ b/src/osmo_gsm_tester/bts_sysmo.py
@@ -26,7 +26,6 @@ class SysmoBts(log.Origin):
bsc = None
run_dir = None
inst = None
- remote_addr = None
remote_inst = None
remote_env = None
remote_dir = None
@@ -64,14 +63,14 @@ class SysmoBts(log.Origin):
self.run_remote('rm-remote-dir', ('test', '!', '-d', SysmoBts.REMOTE_DIR, '||', 'rm', '-rf', SysmoBts.REMOTE_DIR))
self.run_remote('mk-remote-dir', ('mkdir', '-p', SysmoBts.REMOTE_DIR))
- ('scp', '-r', str(self.inst), '%s@%s:%s' % (self.remote_user, self.remote_addr, str(self.remote_inst))))
+ ('scp', '-r', str(self.inst), '%s@%s:%s' % (self.remote_user, self.remote_addr(), str(self.remote_inst))))
remote_run_dir = self.remote_dir.child(SysmoBts.BTS_SYSMO_BIN)
self.run_remote('mk-remote-run-dir', ('mkdir', '-p', remote_run_dir))
remote_config_file = self.remote_dir.child(SysmoBts.BTS_SYSMO_CFG)
- ('scp', '-r', self.config_file, '%s@%s:%s' % (self.remote_user, self.remote_addr, remote_config_file)))
+ ('scp', '-r', self.config_file, '%s@%s:%s' % (self.remote_user, self.remote_addr(), remote_config_file)))
self.run_remote('reload-dsp-firmware', ('/bin/sh', '-c', '"cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0"'))
@@ -85,7 +84,7 @@ class SysmoBts(log.Origin):
def _process_remote(self, name, popen_args, remote_cwd=None):
run_dir = self.run_dir.new_dir(name)
- return process.RemoteProcess(name, run_dir, self.remote_user, self.remote_addr, remote_cwd,
+ return process.RemoteProcess(name, run_dir, self.remote_user, self.remote_addr(), remote_cwd,
def run_remote(self, name, popen_args, remote_cwd=None):
@@ -108,12 +107,13 @@ class SysmoBts(log.Origin):
if proc.result != 0:
proc.raise_exn('Exited in error')
+ def remote_addr(self):
+ return self.conf.get('addr')
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')
- self.remote_addr = self.conf.get('addr')
self.config_file = self.run_dir.new_file(SysmoBts.BTS_SYSMO_CFG)