This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Review at https://gerrit.osmocom.org/5370
cosmetic: bts_octphy: Sort members according to scope
Change-Id: I42c19bf6f5a2f9d13d60e6ce8f1bbc1cad159b4b
---
M src/osmo_gsm_tester/bts_octphy.py
1 file changed, 37 insertions(+), 27 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/70/5370/1
diff --git a/src/osmo_gsm_tester/bts_octphy.py b/src/osmo_gsm_tester/bts_octphy.py
index fd8d078..f5fa90b 100644
--- a/src/osmo_gsm_tester/bts_octphy.py
+++ b/src/osmo_gsm_tester/bts_octphy.py
@@ -23,6 +23,10 @@
from . import log, config, util, template, process, event_loop, pcu_osmo, bts_osmo
class OsmoBtsOctphy(bts_osmo.OsmoBtsMainUnit):
+
+##############
+# PROTECTED
+##############
run_dir = None
inst = None
env = None
@@ -35,33 +39,6 @@
super().__init__(suite_run, conf, OsmoBtsOctphy.BIN_BTS_OCTPHY)
self.env = {}
self.values = {}
-
- def start(self):
- if self.bsc is None:
- raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started')
- self.suite_run.poll()
-
- self.log('Starting to connect to', self.bsc)
- 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('osmo-bts')))
- btsoct_path = self.inst.child('bin', OsmoBtsOctphy.BIN_BTS_OCTPHY)
- lib = self.inst.child('lib')
- if not os.path.isdir(lib):
- raise RuntimeError('No lib/ in %r' % self.inst)
-
- # setting capabilities will later disable use of LD_LIBRARY_PATH from ELF loader -> modify RPATH instead.
- self.log('Setting RPATH for', OsmoBtsOctphy.BIN_BTS_OCTPHY)
- util.change_elf_rpath(btsoct_path, util.prepend_library_path(lib), self.run_dir.new_dir('patchelf'))
- # osmo-bty-octphy requires CAP_NET_RAW to open AF_PACKET socket:
- self.log('Applying CAP_NET_RAW capability to', OsmoBtsOctphy.BIN_BTS_OCTPHY)
- util.setcap_net_raw(btsoct_path, self.run_dir.new_dir('setcap_net_raw'))
-
- self.proc_bts = self.launch_process(OsmoBtsOctphy.BIN_BTS_OCTPHY, '-r', '1',
- '-c', os.path.abspath(self.config_file),
- '-i', self.bsc.addr(), '-t', str(self.num_trx()))
- self.suite_run.poll()
def launch_process(self, binary_name, *args):
binary = os.path.abspath(self.inst.child('bin', binary_name))
@@ -131,6 +108,9 @@
self.dbg(r)
f.write(r)
+########################
+# PUBLIC - INTERNAL API
+########################
def conf_for_bsc(self):
values = config.get_defaults('bsc_bts')
config.overlay(values, config.get_defaults('osmo_bts_octphy'))
@@ -150,4 +130,34 @@
self.dbg(conf=values)
return values
+###################
+# PUBLIC (test API included)
+###################
+ def start(self):
+ if self.bsc is None:
+ raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started')
+ self.suite_run.poll()
+
+ self.log('Starting to connect to', self.bsc)
+ 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('osmo-bts')))
+ btsoct_path = self.inst.child('bin', OsmoBtsOctphy.BIN_BTS_OCTPHY)
+ lib = self.inst.child('lib')
+ if not os.path.isdir(lib):
+ raise RuntimeError('No lib/ in %r' % self.inst)
+
+ # setting capabilities will later disable use of LD_LIBRARY_PATH from ELF loader -> modify RPATH instead.
+ self.log('Setting RPATH for', OsmoBtsOctphy.BIN_BTS_OCTPHY)
+ util.change_elf_rpath(btsoct_path, util.prepend_library_path(lib), self.run_dir.new_dir('patchelf'))
+ # osmo-bty-octphy requires CAP_NET_RAW to open AF_PACKET socket:
+ self.log('Applying CAP_NET_RAW capability to', OsmoBtsOctphy.BIN_BTS_OCTPHY)
+ util.setcap_net_raw(btsoct_path, self.run_dir.new_dir('setcap_net_raw'))
+
+ self.proc_bts = self.launch_process(OsmoBtsOctphy.BIN_BTS_OCTPHY, '-r', '1',
+ '-c', os.path.abspath(self.config_file),
+ '-i', self.bsc.addr(), '-t', str(self.num_trx()))
+ self.suite_run.poll()
+
# vim: expandtab tabstop=4 shiftwidth=4
--
To view, visit https://gerrit.osmocom.org/5370
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I42c19bf6f5a2f9d13d60e6ce8f1bbc1cad159b4b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>