]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Print a command line to re-run failed test sequence
authorJouni Malinen <j@w1.fi>
Thu, 18 Jun 2015 17:44:59 +0000 (20:44 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 18 Jun 2015 18:39:24 +0000 (21:39 +0300)
This makes it easier to test whether a specific test sequence results in
a reproducible test failure.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/vm/parallel-vm.py

index b9c2bca2d1168351ec78115a0795734fa65532e4..1b4683d8af8ce90145bd64fddb556fce4137ba5b 100755 (executable)
@@ -115,6 +115,10 @@ def vm_read_stdout(vm, i):
             total_skipped += 1
         elif line.startswith("START"):
             total_started += 1
+            if len(vm['failed']) == 0:
+                vals = line.split(' ')
+                if len(vals) >= 2:
+                    vm['fail_seq'].append(vals[1])
         vm['out'] += line + '\n'
         lines.append(line)
     vm['pending'] = pending
@@ -426,6 +430,7 @@ def main():
         vm[i]['pending'] = ""
         vm[i]['err'] = ""
         vm[i]['failed'] = []
+        vm[i]['fail_seq'] = []
         for stream in [ vm[i]['proc'].stdout, vm[i]['proc'].stderr ]:
             fd = stream.fileno()
             fl = fcntl.fcntl(fd, fcntl.F_GETFL)
@@ -441,6 +446,19 @@ def main():
     failed = get_failed(vm)
 
     if first_run_failures:
+        print "To re-run same failure sequence(s):"
+        for i in range(0, num_servers):
+            if len(vm[i]['failed']) == 0:
+                continue
+            print "./parallel-vm.py -1 1",
+            skip = len(vm[i]['fail_seq'])
+            skip -= min(skip, 30)
+            for t in vm[i]['fail_seq']:
+                if skip > 0:
+                    skip -= 1
+                    continue
+                print t,
+            print
         print "Failed test cases:"
         for f in first_run_failures:
             print f,