* [Qemu-devel] [PATCH v2 1/2] iotests.py: improve verify_image_format helper
2018-04-09 11:44 [Qemu-devel] [PATCH v2 0/2] iotests: blacklist bochs and cloop for 205 and 208 Vladimir Sementsov-Ogievskiy
@ 2018-04-09 11:44 ` Vladimir Sementsov-Ogievskiy
2018-04-09 11:44 ` [Qemu-devel] [PATCH v2 2/2] iotests: blacklist bochs and cloop for 205 and 208 Vladimir Sementsov-Ogievskiy
2018-04-10 8:38 ` [Qemu-devel] [PATCH v2 0/2] " Kevin Wolf
2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2018-04-09 11:44 UTC (permalink / raw)
To: qemu-devel, qemu-block
Cc: mreitz, kwolf, den, vsementsov, jsnow, eblake, stefanha
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 <vsementsov@virtuozzo.com>
---
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 b5d7945af8..1a2b83893c 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.11.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH v2 2/2] iotests: blacklist bochs and cloop for 205 and 208
2018-04-09 11:44 [Qemu-devel] [PATCH v2 0/2] iotests: blacklist bochs and cloop for 205 and 208 Vladimir Sementsov-Ogievskiy
2018-04-09 11:44 ` [Qemu-devel] [PATCH v2 1/2] iotests.py: improve verify_image_format helper Vladimir Sementsov-Ogievskiy
@ 2018-04-09 11:44 ` Vladimir Sementsov-Ogievskiy
2018-04-10 8:38 ` [Qemu-devel] [PATCH v2 0/2] " Kevin Wolf
2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2018-04-09 11:44 UTC (permalink / raw)
To: qemu-devel, qemu-block
Cc: mreitz, kwolf, den, vsementsov, jsnow, eblake, stefanha
Blacklist these formats, as they don't support image creation, as they
say:
> ./qemu-img create -f bochs x 1m
qemu-img: x: Format driver 'bochs' does not support image creation
> ./qemu-img create -f cloop x 1m
qemu-img: x: Format driver 'cloop' does not support image creation
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
tests/qemu-iotests/205 | 2 +-
tests/qemu-iotests/208 | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/205 b/tests/qemu-iotests/205
index e7b2eae51d..31b2f5707a 100755
--- a/tests/qemu-iotests/205
+++ b/tests/qemu-iotests/205
@@ -153,4 +153,4 @@ class TestNbdServerRemove(iotests.QMPTestCase):
if __name__ == '__main__':
- iotests.main()
+ iotests.main(supported_fmts=['generic'])
diff --git a/tests/qemu-iotests/208 b/tests/qemu-iotests/208
index 18f59ada94..1e202388dc 100755
--- a/tests/qemu-iotests/208
+++ b/tests/qemu-iotests/208
@@ -22,6 +22,8 @@
import iotests
+iotests.verify_image_format(supported_fmts=['generic'])
+
with iotests.FilePath('disk.img') as disk_img_path, \
iotests.FilePath('disk-snapshot.img') as disk_snapshot_img_path, \
iotests.FilePath('nbd.sock') as nbd_sock_path, \
--
2.11.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH v2 0/2] iotests: blacklist bochs and cloop for 205 and 208
2018-04-09 11:44 [Qemu-devel] [PATCH v2 0/2] iotests: blacklist bochs and cloop for 205 and 208 Vladimir Sementsov-Ogievskiy
2018-04-09 11:44 ` [Qemu-devel] [PATCH v2 1/2] iotests.py: improve verify_image_format helper Vladimir Sementsov-Ogievskiy
2018-04-09 11:44 ` [Qemu-devel] [PATCH v2 2/2] iotests: blacklist bochs and cloop for 205 and 208 Vladimir Sementsov-Ogievskiy
@ 2018-04-10 8:38 ` Kevin Wolf
2 siblings, 0 replies; 4+ messages in thread
From: Kevin Wolf @ 2018-04-10 8:38 UTC (permalink / raw)
To: Vladimir Sementsov-Ogievskiy
Cc: qemu-devel, qemu-block, mreitz, den, jsnow, eblake, stefanha
Am 09.04.2018 um 13:44 hat Vladimir Sementsov-Ogievskiy geschrieben:
> v2: move from unsupported_fmts to support "generic", like in bash tests.
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 4+ messages in thread