[PATCH] osmo-gsm-tester[master]: cosmetic: bts_osmotrx: Sort members according to scope

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
Thu Dec 14 18:19:17 UTC 2017


Review at  https://gerrit.osmocom.org/5371

cosmetic: bts_osmotrx: Sort members according to scope

Change-Id: I2a0771331a98b377a79aa0770c753d04a1e88db1
---
M src/osmo_gsm_tester/bts_osmotrx.py
1 file changed, 35 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/71/5371/1

diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py
index fb13545..ea644f1 100644
--- a/src/osmo_gsm_tester/bts_osmotrx.py
+++ b/src/osmo_gsm_tester/bts_osmotrx.py
@@ -23,6 +23,9 @@
 from . import log, config, util, template, process, event_loop, pcu_osmo, bts_osmo
 
 class OsmoBtsTrx(bts_osmo.OsmoBtsMainUnit):
+##############
+# PROTECTED
+##############
     run_dir = None
     inst = None
     env = None
@@ -46,32 +49,6 @@
 
     def launch_trx_enabled(self):
         return util.str2bool(self.conf.get('launch_trx'))
-
-    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()
-
-        if self.launch_trx_enabled():
-            self.trx = OsmoTrx(self.suite_run, self.trx_remote_ip(), self.remote_addr())
-            self.trx.start()
-            self.log('Waiting for osmo-trx to start up...')
-            event_loop.wait(self, self.trx.trx_ready)
-
-        self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-bts')))
-        lib = self.inst.child('lib')
-        if not os.path.isdir(lib):
-            raise RuntimeError('No lib/ in %r' % self.inst)
-        self.env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
-
-        self.proc_bts = self.launch_process(OsmoBtsTrx.BIN_BTS_TRX, '-r', '1',
-                            '-c', os.path.abspath(self.config_file),
-                            '-i', self.bsc.addr())
-        self.suite_run.poll()
 
     def launch_process(self, binary_name, *args):
         binary = os.path.abspath(self.inst.child('bin', binary_name))
@@ -110,6 +87,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_trx'))
@@ -129,6 +109,35 @@
         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()
+
+        if self.launch_trx_enabled():
+            self.trx = OsmoTrx(self.suite_run, self.trx_remote_ip(), self.remote_addr())
+            self.trx.start()
+            self.log('Waiting for osmo-trx to start up...')
+            event_loop.wait(self, self.trx.trx_ready)
+
+        self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-bts')))
+        lib = self.inst.child('lib')
+        if not os.path.isdir(lib):
+            raise RuntimeError('No lib/ in %r' % self.inst)
+        self.env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
+
+        self.proc_bts = self.launch_process(OsmoBtsTrx.BIN_BTS_TRX, '-r', '1',
+                            '-c', os.path.abspath(self.config_file),
+                            '-i', self.bsc.addr())
+        self.suite_run.poll()
+
 class OsmoTrx(log.Origin):
     suite_run = None
     run_dir = None

-- 
To view, visit https://gerrit.osmocom.org/5371
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a0771331a98b377a79aa0770c753d04a1e88db1
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list