[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH 1/3] iotests.py: improve verify_image_format helper
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[Qemu-block] [PATCH 1/3] iotests.py: improve verify_image_format helper |
Date: |
Fri, 30 Mar 2018 18:16:34 +0300 |
Add an assert (we don't want set both arguments) and remove
duplication.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
tests/qemu-iotests/iotests.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index b5d7945..83c454d 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -532,9 +532,9 @@ 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)
+ 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.7.4
- [Qemu-block] [PATCH 0/3] iotests: blacklist bochs and cloop for 205 and 208, Vladimir Sementsov-Ogievskiy, 2018/03/30
- [Qemu-block] [PATCH 3/3] iotests: blacklist bochs and cloop for 205 and 208, Vladimir Sementsov-Ogievskiy, 2018/03/30
- [Qemu-block] [PATCH 1/3] iotests.py: improve verify_image_format helper,
Vladimir Sementsov-Ogievskiy <=
- [Qemu-block] [PATCH 2/3] iotests.py: support unsupported_fmts in main(), Vladimir Sementsov-Ogievskiy, 2018/03/30
- Re: [Qemu-block] [PATCH for 2.12 0/3] iotests: blacklist bochs and cloop for 205 and 208, Vladimir Sementsov-Ogievskiy, 2018/03/30
- Re: [Qemu-block] [Qemu-devel] [PATCH 0/3] iotests: blacklist bochs and cloop for 205 and 208, no-reply, 2018/03/31
- Re: [Qemu-block] [Qemu-devel] [PATCH 0/3] iotests: blacklist bochs and cloop for 205 and 208, no-reply, 2018/03/31