[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 5/8] iotests: Let skip_if_unsupported() accept a
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v3 5/8] iotests: Let skip_if_unsupported() accept a method |
Date: |
Mon, 19 Aug 2019 22:18:48 +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 726f904f50..8f315538e9 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -893,8 +893,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(*args, **kwargs):
- usf_list = list(set(required_formats) -
- set(supported_formats(read_only)))
+ if callable(required_formats):
+ fmts = required_formats(args[0])
+ else:
+ fmts = required_formats
+
+ usf_list = list(set(fmts) - set(supported_formats(read_only)))
if usf_list:
args[0].case_skip('{}: formats {} are not whitelisted'.format(
args[0], usf_list))
--
2.21.0
- Re: [Qemu-devel] [PATCH v3 1/8] iotests: Add -display none to the qemu options, (continued)
- [Qemu-devel] [PATCH v3 2/8] iotests: Prefer null-co over null-aio, Max Reitz, 2019/08/19
- [Qemu-devel] [PATCH v3 3/8] iotests: Allow skipping test cases, Max Reitz, 2019/08/19
- [Qemu-devel] [PATCH v3 4/8] iotests: Use case_skip() in skip_if_unsupported(), Max Reitz, 2019/08/19
- [Qemu-devel] [PATCH v3 5/8] iotests: Let skip_if_unsupported() accept a method,
Max Reitz <=
- [Qemu-devel] [PATCH v3 6/8] iotests: Test driver whitelisting in 093, Max Reitz, 2019/08/19
- [Qemu-devel] [PATCH v3 7/8] iotests: Test driver whitelisting in 136, Max Reitz, 2019/08/19
- [Qemu-devel] [PATCH v3 8/8] iotests: Cache supported_formats(), Max Reitz, 2019/08/19