Update obj classes in obj/ to use testenv instead of suite_run
Change-Id: Idf41243a497de7bc507b9f1cd1b38640f456f815
diff --git a/src/osmo_gsm_tester/obj/mgw_osmo.py b/src/osmo_gsm_tester/obj/mgw_osmo.py
index 3798b2d..70572a1 100644
--- a/src/osmo_gsm_tester/obj/mgw_osmo.py
+++ b/src/osmo_gsm_tester/obj/mgw_osmo.py
@@ -25,20 +25,20 @@
class OsmoMgw(log.Origin):
- def __init__(self, suite_run, ip_address):
+ def __init__(self, testenv, ip_address):
super().__init__(log.C_RUN, 'osmo-mgw_%s' % ip_address.get('addr'))
self.run_dir = None
self.config_file = None
self.process = None
- self.suite_run = suite_run
+ self.testenv = testenv
self.ip_address = ip_address
self.use_osmux = "off"
def start(self):
self.log('Starting osmo-mgw')
- self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name()))
+ self.run_dir = util.Dir(self.testenv.suite().get_run_dir().new_dir(self.name()))
self.configure()
- inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-mgw')))
+ inst = util.Dir(os.path.abspath(self.testenv.suite().trial().get_inst('osmo-mgw')))
binary = inst.child('bin', 'osmo-mgw')
if not os.path.isfile(binary):
raise RuntimeError('Binary missing: %r' % binary)
@@ -46,7 +46,7 @@
if not os.path.isdir(lib):
raise RuntimeError('No lib/ in %r' % inst)
- pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), None,
+ pcap_recorder.PcapRecorder(self.testenv, self.run_dir.new_dir('pcap'), None,
'host %s and port not 22' % self.addr())
env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
@@ -56,7 +56,7 @@
(binary, '-c',
os.path.abspath(self.config_file)),
env=env)
- self.suite_run.remember_to_stop(self.process)
+ self.testenv.remember_to_stop(self.process)
self.process.launch()
def configure(self):
@@ -64,7 +64,7 @@
self.dbg(config_file=self.config_file)
values = dict(mgw=config.get_defaults('mgw'))
- config.overlay(values, self.suite_run.config())
+ config.overlay(values, self.testenv.suite().config())
config.overlay(values, { 'mgw': {
'ip_address': self.ip_address,
'use_osmux': self.use_osmux