From 38e700198e6a4288324dbdab65dbe245141d3b2d Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 28 Feb 2021 20:20:38 +0200 Subject: [PATCH] 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 --- tests/hwsim/vm/parallel-vm.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/hwsim/vm/parallel-vm.py b/tests/hwsim/vm/parallel-vm.py index c451e8ab6..86565c677 100755 --- a/tests/hwsim/vm/parallel-vm.py +++ b/tests/hwsim/vm/parallel-vm.py @@ -344,6 +344,23 @@ def show_progress(scr): scr.refresh() 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(): import argparse import os @@ -617,6 +634,16 @@ def main(): if 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: print("Code coverage - preparing report") for i in range(num_servers):