aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/osmo_gsm_tester/bts_osmotrx.py2
-rw-r--r--src/osmo_gsm_tester/bts_sysmo.py2
-rw-r--r--src/osmo_gsm_tester/osmo_bsc.py2
-rw-r--r--src/osmo_gsm_tester/osmo_hlr.py2
-rw-r--r--src/osmo_gsm_tester/osmo_mgcpgw.py2
-rw-r--r--src/osmo_gsm_tester/osmo_msc.py2
-rw-r--r--src/osmo_gsm_tester/osmo_nitb.py2
-rw-r--r--src/osmo_gsm_tester/osmo_stp.py2
-rw-r--r--src/osmo_gsm_tester/suite.py19
9 files changed, 27 insertions, 8 deletions
diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py
index c8fa594..46daf71 100644
--- a/src/osmo_gsm_tester/bts_osmotrx.py
+++ b/src/osmo_gsm_tester/bts_osmotrx.py
@@ -51,7 +51,7 @@ class OsmoBtsTrx(log.Origin):
self.suite_run.poll()
self.log('Starting to connect to', self.bsc)
- self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name()))
+ 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(OsmoBtsTrx.BIN_BTS_TRX)))
diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py
index 30fff0e..eab0bdb 100644
--- a/src/osmo_gsm_tester/bts_sysmo.py
+++ b/src/osmo_gsm_tester/bts_sysmo.py
@@ -45,7 +45,7 @@ class SysmoBts(log.Origin):
if self.bsc is None:
raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started')
log.log('Starting sysmoBTS to connect to', self.bsc)
- self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name()))
+ 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(SysmoBts.BTS_SYSMO_BIN)))
diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py
index 5447118..efbda1f 100644
--- a/src/osmo_gsm_tester/osmo_bsc.py
+++ b/src/osmo_gsm_tester/osmo_bsc.py
@@ -39,7 +39,7 @@ class OsmoBsc(log.Origin):
def start(self):
self.log('Starting osmo-bsc')
- self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name()))
+ self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name()))
self.configure()
# NOTE: While OsmoMSC and OsmoBSC live in the same git repository, the
diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py
index 110faa5..19241cc 100644
--- a/src/osmo_gsm_tester/osmo_hlr.py
+++ b/src/osmo_gsm_tester/osmo_hlr.py
@@ -39,7 +39,7 @@ class OsmoHlr(log.Origin):
def start(self):
self.log('Starting osmo-hlr')
- self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name()))
+ self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name()))
self.configure()
inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-hlr')))
diff --git a/src/osmo_gsm_tester/osmo_mgcpgw.py b/src/osmo_gsm_tester/osmo_mgcpgw.py
index b385274..db41dff 100644
--- a/src/osmo_gsm_tester/osmo_mgcpgw.py
+++ b/src/osmo_gsm_tester/osmo_mgcpgw.py
@@ -38,7 +38,7 @@ class OsmoMgcpgw(log.Origin):
def start(self):
self.log('Starting osmo-mgcpgw')
- self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name()))
+ self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name()))
self.configure()
inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-msc')))
binary = inst.child('bin', 'osmo-bsc_mgcp')
diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py
index 443b254..063b477 100644
--- a/src/osmo_gsm_tester/osmo_msc.py
+++ b/src/osmo_gsm_tester/osmo_msc.py
@@ -40,7 +40,7 @@ class OsmoMsc(log.Origin):
def start(self):
self.log('Starting osmo-msc')
- self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name()))
+ self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name()))
self.configure()
inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-msc')))
binary = inst.child('bin', 'osmo-msc')
diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py
index 3104842..484358e 100644
--- a/src/osmo_gsm_tester/osmo_nitb.py
+++ b/src/osmo_gsm_tester/osmo_nitb.py
@@ -39,7 +39,7 @@ class OsmoNitb(log.Origin):
def start(self):
self.log('Starting osmo-nitb')
- self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name()))
+ self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name()))
self.configure()
inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-nitb')))
binary = inst.child('bin', 'osmo-nitb')
diff --git a/src/osmo_gsm_tester/osmo_stp.py b/src/osmo_gsm_tester/osmo_stp.py
index f1ad6fc..1aeb879 100644
--- a/src/osmo_gsm_tester/osmo_stp.py
+++ b/src/osmo_gsm_tester/osmo_stp.py
@@ -36,7 +36,7 @@ class OsmoStp(log.Origin):
def start(self):
self.log('Starting osmo-stp')
- self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name()))
+ self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name()))
self.configure()
# NOTE: libosmo-sccp provides osmo-stp and is built as a dependency of
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index 5c567f8..c78c9fc 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -76,6 +76,8 @@ class Test(log.Origin):
PASS = 'pass'
FAIL = 'FAIL'
+ _run_dir = None
+
def __init__(self, suite_run, test_basename):
self.basename = test_basename
super().__init__(log.C_TST, self.basename)
@@ -87,6 +89,11 @@ class Test(log.Origin):
self.fail_type = None
self.fail_message = None
+ def get_run_dir(self):
+ if self._run_dir is None:
+ self._run_dir = util.Dir(self.suite_run.get_run_dir().new_dir(self._name))
+ return self._run_dir
+
def run(self):
try:
log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3)
@@ -165,6 +172,7 @@ class SuiteRun(log.Origin):
_resource_requirements = None
_config = None
_processes = None
+ _run_dir = None
def __init__(self, trial, suite_scenario_str, suite_definition, scenarios=[]):
super().__init__(log.C_TST, suite_scenario_str)
@@ -209,6 +217,16 @@ class SuiteRun(log.Origin):
config.combine(combination, c)
return combination
+ def get_run_dir(self):
+ if self._run_dir is None:
+ self._run_dir = util.Dir(self.trial.get_run_dir().new_dir(self.name()))
+ return self._run_dir
+
+ def get_test_run_dir(self):
+ if self.current_test:
+ return self.current_test.get_run_dir()
+ return self.get_run_dir()
+
def resource_requirements(self):
if self._resource_requirements is None:
self._resource_requirements = self.combined('resources')
@@ -236,6 +254,7 @@ class SuiteRun(log.Origin):
if names and not test.name() in names:
test.set_skip()
continue
+ self.current_test = test
test.run()
except Exception:
log.log_exn()