[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 06/10] iotests: check: return 1 on failure
From: |
Kevin Wolf |
Subject: |
[PULL v2 06/10] iotests: check: return 1 on failure |
Date: |
Tue, 2 Feb 2021 17:28:30 +0100 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
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/testrunner.py | 4 +++-
tests/qemu-iotests/check | 5 ++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunner.py
index 24b3fba115..25754e9a09 100644
--- a/tests/qemu-iotests/testrunner.py
+++ b/tests/qemu-iotests/testrunner.py
@@ -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
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 5190dee82e..d1c87ceaf1 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -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)
--
2.29.2
- [PULL v2 00/10] Block layer patches, Kevin Wolf, 2021/02/02
- [PULL v2 01/10] MAINTAINERS: Add Vladimir as co-maintainer for Block Jobs, Kevin Wolf, 2021/02/02
- [PULL v2 03/10] block: move blk_exp_close_all() to qemu_cleanup(), Kevin Wolf, 2021/02/02
- [PULL v2 02/10] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore(), Kevin Wolf, 2021/02/02
- [PULL v2 05/10] iotests: Revert emulator selection to old behaviour, Kevin Wolf, 2021/02/02
- [PULL v2 04/10] iotests/297: pylint: ignore too many statements, Kevin Wolf, 2021/02/02
- [PULL v2 07/10] iotests: Fix -makecheck output, Kevin Wolf, 2021/02/02
- [PULL v2 09/10] block/nvme: Trace NVMe spec version supported by the controller, Kevin Wolf, 2021/02/02
- [PULL v2 08/10] block/nvme: Properly display doorbell stride length in trace event, Kevin Wolf, 2021/02/02
- [PULL v2 06/10] iotests: check: return 1 on failure,
Kevin Wolf <=
- [PULL v2 10/10] block: Fix VM size column width in bdrv_snapshot_dump(), Kevin Wolf, 2021/02/02
- Re: [PULL v2 00/10] Block layer patches, Peter Maydell, 2021/02/02