[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v4 4/7] iotests: Let skip_if_unsupported accept a fu
From: |
Max Reitz |
Subject: |
[Qemu-block] [PATCH v4 4/7] iotests: Let skip_if_unsupported accept a function |
Date: |
Tue, 17 Sep 2019 11:20:01 +0200 |
This lets tests use skip_if_unsupported() with a potentially variable
list of required formats.
Suggested-by: Kevin Wolf <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/iotests.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 427c34697a..a42702b6b9 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -894,8 +894,12 @@ def skip_if_unsupported(required_formats=[],
read_only=False):
Runs the test if all the required formats are whitelisted'''
def skip_test_decorator(func):
def func_wrapper(test_case: QMPTestCase, *args, **kwargs):
- usf_list = list(set(required_formats) -
- set(supported_formats(read_only)))
+ if callable(required_formats):
+ fmts = required_formats(test_case)
+ else:
+ fmts = required_formats
+
+ usf_list = list(set(fmts) - set(supported_formats(read_only)))
if usf_list:
test_case.case_skip('{}: formats {} are not
whitelisted'.format(
test_case, usf_list))
--
2.21.0
- [Qemu-block] [PATCH v4 0/7] iotests: Selfish patches, Max Reitz, 2019/09/17
- [Qemu-block] [PATCH v4 1/7] iotests: Prefer null-co over null-aio, Max Reitz, 2019/09/17
- [Qemu-block] [PATCH v4 2/7] iotests: Allow skipping test cases, Max Reitz, 2019/09/17
- [Qemu-block] [PATCH v4 3/7] iotests: Use case_skip() in skip_if_unsupported(), Max Reitz, 2019/09/17
- [Qemu-block] [PATCH v4 4/7] iotests: Let skip_if_unsupported accept a function,
Max Reitz <=
- [Qemu-block] [PATCH v4 5/7] iotests: Test driver whitelisting in 093, Max Reitz, 2019/09/17
- Re: [Qemu-block] [Qemu-devel] [PATCH v4 5/7] iotests: Test driver whitelisting in 093, John Snow, 2019/09/18
- [Qemu-block] [PATCH v4 6/7] iotests: Test driver whitelisting in 136, Max Reitz, 2019/09/17
- [Qemu-block] [PATCH v4 7/7] iotests: Cache supported_formats(), Max Reitz, 2019/09/17