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
This commit is contained in:
Philipp Maier
2024-11-04 14:55:29 +01:00
parent ec30022b1a
commit 30c59fce42

View File

@@ -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:")