tests: Display unexpected stdout and stderr prints in parallel-vm.py

Make it more difficult to miss issues that were previously only printed
out in /tmp/hwsim-test-logs/*-parallel.log. This covers things like
memory leaks and test script failures or forgotten development time
prints to stdout.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2021-02-28 20:20:38 +02:00
parent 40551a15c1
commit 38e700198e

View file

@ -344,6 +344,23 @@ def show_progress(scr):
scr.refresh() scr.refresh()
time.sleep(0.3) time.sleep(0.3)
def known_output(tests, line):
if not line:
return True
if line in tests:
return True
known = ["START ", "PASS ", "FAIL ", "SKIP ", "REASON ", "ALL-PASSED",
"READY",
" ", "Exception: ", "Traceback (most recent call last):",
"./run-all.sh: running",
"./run-all.sh: passing",
"Test run completed", "Logfiles are at", "Starting test run",
"passed all", "skipped ", "failed tests:"]
for k in known:
if line.startswith(k):
return True
return False
def main(): def main():
import argparse import argparse
import os import os
@ -617,6 +634,16 @@ def main():
if other_reasons: if other_reasons:
print("Other skip reasons:", other_reasons) print("Other skip reasons:", other_reasons)
for i in range(num_servers):
unknown = ""
for line in vm[i]['out'].splitlines():
if not known_output(tests, line):
unknown += line + "\n"
if unknown:
print("\nVM %d - unexpected stdout output:\n%s" % (i, unknown))
if vm[i]['err']:
print("\nVM %d - unexpected stderr output:\n%s\n" % (i, vm[i]['err']))
if codecov: if codecov:
print("Code coverage - preparing report") print("Code coverage - preparing report")
for i in range(num_servers): for i in range(num_servers):