kunit: show error if kunit results are not present
Currently, if the kernel is configured incorrectly or if it crashes before any kunit tests are run, kunit finishes without error, reporting that 0 test cases were run. To fix this, an error is shown when the tap header is not found, which indicates that kunit was not able to run at all. Signed-off-by: Uriel Guajardo <urielguajardo@google.com> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:

committed by
Shuah Khan

parent
3f37d14b8a
commit
e173b8b8c4
@@ -170,6 +170,17 @@ class KUnitParserTest(unittest.TestCase):
|
||||
result.status)
|
||||
file.close()
|
||||
|
||||
def test_no_kunit_output(self):
|
||||
crash_log = get_absolute_path(
|
||||
'test_data/test_insufficient_memory.log')
|
||||
file = open(crash_log)
|
||||
print_mock = mock.patch('builtins.print').start()
|
||||
result = kunit_parser.parse_run_tests(
|
||||
kunit_parser.isolate_kunit_output(file.readlines()))
|
||||
print_mock.assert_any_call(StrContains("no kunit output detected"))
|
||||
print_mock.stop()
|
||||
file.close()
|
||||
|
||||
def test_crashed_test(self):
|
||||
crashed_log = get_absolute_path(
|
||||
'test_data/test_is_test_passed-crash.log')
|
||||
|
Reference in New Issue
Block a user