]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make parallel-vm.py log easier to use for debugging failures
authorJouni Malinen <jouni@codeaurora.org>
Fri, 15 Mar 2019 19:08:10 +0000 (21:08 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 15 Mar 2019 19:10:00 +0000 (21:10 +0200)
Print a list of full paths to log files from failed test cases both the
parallel.log and stdout so that they can be easily opened for analysis.
In addition, renumber the VM lines in the <timestamp>-parallel.log to
match the i+1 numbering used in the log directories and UI that is
tracking test execution.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/vm/parallel-vm.py

index 0e2a14110e53de573e115e4c0f359325f89025ce..d659abbf01f3f26baf352a0c5f8c1b87af216bb5 100755 (executable)
@@ -476,7 +476,19 @@ def main():
 
     with open('{}/{}-parallel.log'.format(dir, timestamp), 'w') as f:
         for i in range(0, num_servers):
-            f.write('VM {}\n{}\n{}\n'.format(i, vm[i]['out'], vm[i]['err']))
+            f.write('VM {}\n{}\n{}\n'.format(i + 1, vm[i]['out'], vm[i]['err']))
+        first = True
+        for i in range(0, num_servers):
+            for line in vm[i]['out'].splitlines():
+                if line.startswith("FAIL "):
+                    if first:
+                        first = False
+                        print("Logs for failed test cases:")
+                        f.write("Logs for failed test cases:\n")
+                    fname = "%s/%d.srv.%d/%s.log" % (dir, timestamp, i + 1,
+                                                     line.split(' ')[1])
+                    print(fname)
+                    f.write("%s\n" % fname)
 
     failed = get_failed(vm)