[XS] Change in pysim[master]: pySim-shell_test/utils: enumerate pySim-shell logs
dexter has uploaded this change for review. ( 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(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/44/38544/1 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): -- To view, visit https://gerrit.osmocom.org/c/pysim/+/38544?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ib2195d9b2231f74d0a6c4fb28f4889b6c45efb1e Gerrit-Change-Number: 38544 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier@sysmocom.de>
participants (1)
-
dexter