On 10/1/19 3:46 PM, Max Reitz wrote: > Signed-off-by: Max Reitz <mre...@redhat.com> > --- > tests/qemu-iotests/iotests.py | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py > index 7030900807..cdcb62c4ac 100644 > --- a/tests/qemu-iotests/iotests.py > +++ b/tests/qemu-iotests/iotests.py > @@ -950,6 +950,19 @@ def skip_if_unsupported(required_formats=[], > read_only=False): > return func_wrapper > return skip_test_decorator > > +def skip_for_imgopts(unsupported_opts=[]): > + '''Skip Test Decorator > + Skips the test if imgopts contains any of the given options''' > + def skip_test_decorator(func): > + def func_wrapper(test_case: QMPTestCase, *args, **kwargs): :D > + for opt in imgopts: > + if any(unsupported in opt for unsupported in > unsupported_opts): > + test_case.case_skip('{}: Option {} is > unsupported'.format( > + test_case, opt)) > + return func(test_case, *args, **kwargs) > + return func_wrapper > + return skip_test_decorator > + > def execute_unittest(debug=False): > """Executes unittests within the calling module.""" > > Reviewed-by: John Snow <js...@redhat.com>
- [PATCH 01/67] iotests.py: Read $IMGOPTS Max Reitz
- Re: [PATCH 01/67] iotests.py: Read $IMGO... John Snow
- Re: [PATCH 01/67] iotests.py: Read $... Vladimir Sementsov-Ogievskiy
- Re: [PATCH 01/67] iotests.py: Read $IMGO... Vladimir Sementsov-Ogievskiy
- [PATCH 08/67] iotests.py: Add filter_json_fil... Max Reitz
- [PATCH 06/67] iotests.py: Add image_path() Max Reitz
- [PATCH 03/67] iotests.py: Add unsupported_img... Max Reitz
- Re: [PATCH 03/67] iotests.py: Add unsupp... John Snow
- Re: [PATCH 03/67] iotests.py: Add unsupp... Vladimir Sementsov-Ogievskiy
- [PATCH 02/67] iotests.py: Add @skip_for_imgop... Max Reitz
- Re: [PATCH 02/67] iotests.py: Add @skip_... John Snow
- Re: [PATCH 02/67] iotests.py: Add @skip_... Vladimir Sementsov-Ogievskiy
- Re: [PATCH 02/67] iotests.py: Add @s... Max Reitz
- [PATCH 09/67] iotests.py: Add @hide_fields to... Max Reitz
- [PATCH 13/67] iotests/242: Hide refcount bit ... Max Reitz
- [PATCH 04/67] iotests.py: create_test_image, ... Max Reitz
- Re: [PATCH 04/67] iotests.py: create_tes... John Snow
- Re: [PATCH 04/67] iotests.py: create... John Snow
- Re: [PATCH 04/67] iotests.py: create... Max Reitz
- Re: [PATCH 04/67] iotests.py: cr... John Snow
- [PATCH 12/67] iotests/228: Filter json:{} fil... Max Reitz