]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Display unexpected stdout and stderr prints in parallel-vm.py
authorJouni Malinen <j@w1.fi>
Sun, 28 Feb 2021 18:20:38 +0000 (20:20 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 28 Feb 2021 20:31:58 +0000 (22:31 +0200)
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>
tests/hwsim/vm/parallel-vm.py

index c451e8ab6adaf01095cd154aa0985528a04fbb9b..86565c6774936b0df18a8d90d964fc4ec850f16b 100755 (executable)
@@ -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):