From 30c59fce42714ac122bfa003d87f30c4908e641c Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Mon, 4 Nov 2024 14:55:29 +0100 Subject: [PATCH] pySim-shell_test/utils: treat cmd2 error "not a recognized command... as exception When a pySim-shell command is not recognized, cmd2 prints "xyz is not a recognized command, alias, or macro." This string is a normal print out and not an exception, but during tests, it may point out a severe problem and therefore it should be tread like an exception. Related: OS#6367 Change-Id: I17be6af1547b31170622e17b9cfb9c492597670d --- tests/pySim-shell_test/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pySim-shell_test/utils.py b/tests/pySim-shell_test/utils.py index 8dbeebb2..9be4acd4 100644 --- a/tests/pySim-shell_test/utils.py +++ b/tests/pySim-shell_test/utils.py @@ -285,7 +285,7 @@ class UnittestUtils(unittest.TestCase): raise RuntimeError("pySim-shell exits with error code %u" % py_sim_shell_rc) # Check log for exceptions - exception_regex_compiled = re.compile('.*EXCEPTION.*') + exception_regex_compiled = re.compile('.*EXCEPTION.*|.*is not a recognized command, alias, or macro.*') exceptions_strings = re.findall(exception_regex_compiled, logfile_content) if exceptions_strings != []: print("The following exceptions occurred:")