osmo-gsm-tester[master]: Use a subdir of run_dir for each test

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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Jun 15 00:35:26 UTC 2017


Patch Set 1: Code-Review-1

(1 comment)

I am not that sure that we should tie each process to a test script instead of a suite_run. When I wrote the code the intention was to allow processes to run for the duration of a suite, across several tests, and we will probably do so in the future. But I welcome having a run dir structure that reflects which test started the process, in fact wanted to add this every time I read logs. So I want this, but a bit differently...

This patch changes many lines to insert 'test' before 'suite_run' ("self.test.suite_run..."). The only reason to need the 'Test' instance in each process class like OsmoNitb is to get its run_dir. Otherwise suite_run provides everything those classes need.

So let's still pass suite_run instead of test. In each process class let's still store self.suite_run, not self.test, and hence make this patch a lot shorter. (Even if we were storing self.test, I'd also store self.suite_run to avoid the numerous code changes inserting 'test'.) But since the process classes need nothing from the Test() class except the run_dir, let's not store a Test() reference at all.

I would rather put the change here: each process class like OsmoNitb() calls so far suite_run.get_run_dir(). Let's have a new suite_run.new_run_dir(name) function, which creates a new run dir using suite_run.current_test.get_run_dir().new_dir(). Change all self.suite_run.get_run_dir() to self.suite_run.new_run_dir(name_str). This way we don't even need to change the signature of classes like OsmoNitb(). And still the run dirs per test are only created when we are actually going to put something inside, i.e. when calling suite_run.new_run_dir(), so that we're not creating empty run dirs if a test doesn't use it.

Makes sense?

https://gerrit.osmocom.org/#/c/2915/1/src/osmo_gsm_tester/suite.py
File src/osmo_gsm_tester/suite.py:

Line 94:             self._run_dir = util.Dir(self.suite_run.get_run_dir().new_dir(self._name))
rather self.name()


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I06be2dd21710e14c1337d13b1fe6c2f68f037957
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-HasComments: Yes



More information about the gerrit-log mailing list