[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 18/19] iotests.py: implement unsupported_imgopts
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v4 18/19] iotests.py: implement unsupported_imgopts |
Date: |
Fri, 3 Dec 2021 14:07:36 +0100 |
We have added support for some addition IMGOPTS in python iotests like
in bash iotests. Similarly to bash iotests, we want a way to skip some
tests which can't work with specific IMGOPTS.
Globally for python iotests we now don't support things like
'data_file=$TEST_IMG.ext_data_file' in IMGOPTS, so, forbid this
globally in iotests.py.
Suggested-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
tests/qemu-iotests/iotests.py | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 903686b402..2cbb13d67a 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -1238,6 +1238,17 @@ def _verify_virtio_scsi_pci_or_ccw() -> None:
notrun('Missing virtio-scsi-pci or virtio-scsi-ccw in QEMU binary')
+def _verify_imgopts(unsupported: Sequence[str] = ()) -> None:
+ imgopts = os.environ.get('IMGOPTS')
+ # One of usage examples for IMGOPTS is "data_file=$TEST_IMG.ext_data_file"
+ # but it supported only for bash tests. We don't have a concept of global
+ # TEST_IMG in iotests.py, not saying about somehow parsing $variables.
+ # So, for simplicity let's just not support any IMGOPTS with '$' inside.
+ unsup = list(unsupported) + ['$']
+ if imgopts and any(x in imgopts for x in unsup):
+ notrun(f'not suitable for this imgopts: {imgopts}')
+
+
def supports_quorum():
return 'quorum' in qemu_img_pipe('--help')
@@ -1414,7 +1425,8 @@ def execute_setup_common(supported_fmts: Sequence[str] =
(),
unsupported_fmts: Sequence[str] = (),
supported_protocols: Sequence[str] = (),
unsupported_protocols: Sequence[str] = (),
- required_fmts: Sequence[str] = ()) -> bool:
+ required_fmts: Sequence[str] = (),
+ unsupported_imgopts: Sequence[str] = ()) -> bool:
"""
Perform necessary setup for either script-style or unittest-style tests.
@@ -1434,6 +1446,7 @@ def execute_setup_common(supported_fmts: Sequence[str] =
(),
_verify_aio_mode(supported_aio_modes)
_verify_formats(required_fmts)
_verify_virtio_blk()
+ _verify_imgopts(unsupported_imgopts)
return debug
--
2.31.1
- [PATCH v4 00/19] iotests: support zstd, Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 02/19] iotests.py: qemu_img*("create"): support IMGOPTS='compression_type=zstd', Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 03/19] iotests: drop qemu_img_verbose() helper, Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 05/19] iotest 303: explicit compression type, Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 08/19] iotests.py: filter compression type out, Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 17/19] iotests: declare lack of support for compresion_type in IMGOPTS, Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 18/19] iotests.py: implement unsupported_imgopts,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v4 09/19] iotest 302: use img_info_log() helper, Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 07/19] iotests.py: filter out successful output of qemu-img create, Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 10/19] qcow2: simple case support for downgrading of qcow2 images with zstd, Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 19/19] iotests: specify some unsupported_imgopts for python iotests, Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 11/19] iotests/common.rc: introduce _qcow2_dump_header helper, Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 04/19] iotests.py: rewrite default luks support in qemu_img, Vladimir Sementsov-Ogievskiy, 2021/12/03