laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/38544?usp=email )
Change subject: pySim-shell_test/utils: enumerate pySim-shell logs ......................................................................
pySim-shell_test/utils: enumerate pySim-shell logs
When pySim-shell is called by a testcase, a logfile is createted. The logfile filename contains the testcase name. However, a testcase may run pySim-shell multiple times. In this case we overwrite the log from previous run. Let's use a counter to generate unique file names for each run, so that we won't lose logs from previous runs.
Related: OS#6601 Change-Id: Ib2195d9b2231f74d0a6c4fb28f4889b6c45efb1e --- M tests/pySim-shell_test/utils.py 1 file changed, 3 insertions(+), 1 deletion(-)
Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve laforge: Looks good to me, approved
diff --git a/tests/pySim-shell_test/utils.py b/tests/pySim-shell_test/utils.py index 943eb48..6acbd70 100644 --- a/tests/pySim-shell_test/utils.py +++ b/tests/pySim-shell_test/utils.py @@ -170,6 +170,7 @@ testcasepath = inspect.getfile(self.__class__) testcasename = testcasepath.split("/")[-2] + "." + self._testMethodName print(boxed_heading_str("testcase: " + testcasename)) + self.pysim_shell_log_counter = 0
# Find directories self.test_dir = os.path.dirname(testcasepath) @@ -240,7 +241,8 @@ no_exceptions : fail the testcase in case any exceptions occurred while running pySim_shell """
- logfile_name = "pySim-shell_" + self._testMethodName + ".log" + logfile_name = "pySim-shell_" + self._testMethodName + "_" + str(self.pysim_shell_log_counter) + ".log" + self.pysim_shell_log_counter+=1
# Make sure the script file is available if not os.access(script, os.R_OK):