]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
iotests: check: return 1 on failure
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Mon, 1 Feb 2021 08:50:41 +0000 (11:50 +0300)
committerKevin Wolf <kwolf@redhat.com>
Tue, 2 Feb 2021 16:05:38 +0000 (17:05 +0100)
We should indicate failure by exit code, not only output.

Reported-by: Peter Maydell
Fixes: f203080bbd9f9e5b31041b1f2afcd6040c5aaec5
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210201085041.3079-1-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
tests/qemu-iotests/check
tests/qemu-iotests/testrunner.py

index 5190dee82e8982ec4839e25fc1307362c1f2d4d0..d1c87ceaf17fab1b8538e96325aa198099a8e1c5 100755 (executable)
@@ -140,4 +140,7 @@ if __name__ == '__main__':
     else:
         with TestRunner(env, makecheck=args.makecheck,
                         color=args.color) as tr:
-            tr.run_tests([os.path.join(env.source_iotests, t) for t in tests])
+            paths = [os.path.join(env.source_iotests, t) for t in tests]
+            ok = tr.run_tests(paths)
+            if not ok:
+                sys.exit(1)
index 24b3fba1154feb3dc4b0cf6ef1d37f2c118e1a99..25754e9a09efbe8b05f820d210a98b70ceb2b190 100644 (file)
@@ -318,7 +318,7 @@ class TestRunner(ContextManager['TestRunner']):
 
         return res
 
-    def run_tests(self, tests: List[str]) -> None:
+    def run_tests(self, tests: List[str]) -> bool:
         n_run = 0
         failed = []
         notrun = []
@@ -363,5 +363,7 @@ class TestRunner(ContextManager['TestRunner']):
         if failed:
             print('Failures:', ' '.join(failed))
             print(f'Failed {len(failed)} of {n_run} iotests')
+            return False
         else:
             print(f'Passed all {n_run} iotests')
+            return True