[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 3/7] iotests.py: improve verify_image_format helper
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 3/7] iotests.py: improve verify_image_format helper |
Date: |
Tue, 10 Apr 2018 17:37:44 +0200 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
Support "generic" formats like in bash tests with their
_supported_fmt generic
The test, supporting "generic" formats will run if IMGFMT_GENERIC =
true, which is default, except for bochs and cloop. However, you can
use verify_image_format(['generic', 'bochs']), which will run for all
except cloop (for this moment).
Also, add an assert (we don't want set both arguments) and remove
duplication.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/qemu-iotests/iotests.py | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 1623257e32..97131b1f86 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -532,9 +532,17 @@ def notrun(reason):
sys.exit(0)
def verify_image_format(supported_fmts=[], unsupported_fmts=[]):
- if supported_fmts and (imgfmt not in supported_fmts):
- notrun('not suitable for this image format: %s' % imgfmt)
- if unsupported_fmts and (imgfmt in unsupported_fmts):
+ assert not (supported_fmts and unsupported_fmts)
+
+ if 'generic' in supported_fmts and \
+ os.environ.get('IMGFMT_GENERIC', 'true') == 'true':
+ # similar to
+ # _supported_fmt generic
+ # for bash tests
+ return
+
+ not_sup = supported_fmts and (imgfmt not in supported_fmts)
+ if not_sup or (imgfmt in unsupported_fmts):
notrun('not suitable for this image format: %s' % imgfmt)
def verify_platform(supported_oses=['linux']):
--
2.13.6
- [Qemu-block] [PULL 0/7] Block layer patches for 2.12.0-rc3, Kevin Wolf, 2018/04/10
- [Qemu-block] [PULL 3/7] iotests.py: improve verify_image_format helper,
Kevin Wolf <=
- [Qemu-block] [PULL 5/7] qemu-iotests: Remove _supported_fmt dmg, Kevin Wolf, 2018/04/10
- [Qemu-block] [PULL 2/7] hw/block/pflash_cfi: fix off-by-one error, Kevin Wolf, 2018/04/10
- [Qemu-block] [PULL 6/7] commit/stream: Reset delay_ns, Kevin Wolf, 2018/04/10
- [Qemu-block] [PULL 4/7] iotests: blacklist bochs and cloop for 205 and 208, Kevin Wolf, 2018/04/10
- [Qemu-block] [PULL 7/7] qemu-iotests: update 185 output, Kevin Wolf, 2018/04/10
- [Qemu-block] [PULL 1/7] iotests.py: support unsupported_fmts in main(), Kevin Wolf, 2018/04/10
- Re: [Qemu-block] [PULL 0/7] Block layer patches for 2.12.0-rc3, Peter Maydell, 2018/04/11