Skip to contentSkip to conversation

iotests: blacklist bochs and cloop for 205 and 208

PATCH Applied Vladimir Sementsov-Ogievskiy 2 participants 4 messages Apr 9, 2018 – Apr 10, 2018

lore
Share & tools
lore
#0 lore raw

v2 cover iotests: blacklist bochs and cloop for 205 and 208

v2: move from unsupported_fmts to support "generic", like in bash tests.

Vladimir Sementsov-Ogievskiy (2):
iotests.py: improve verify_image_format helper
iotests: blacklist bochs and cloop for 205 and 208

 tests/qemu-iotests/205        |  2 +-
 tests/qemu-iotests/208        |  2 ++
 tests/qemu-iotests/iotests.py | 14 +++++++++++---
 3 files changed, 14 insertions(+), 4 deletions(-)
Signature · 1 line
2.11.1
#1 lore raw

PATCH v2 1/2 iotests.py: improve verify_image_format helper

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.

---
 tests/qemu-iotests/iotests.py | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
tests/qemu-iotests/iotests.py +11 -3
index b5d7945af8..1a2b83893c 100644
@@ -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']):
Signature · 1 line
2.11.1
#2 lore raw

PATCH v2 2/2 iotests: blacklist bochs and cloop for 205 and 208

In reply to Vladimir Sementsov-Ogievskiy

Blacklist these formats, as they don't support image creation, as they say:

Quoted 1 line

./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

---
 tests/qemu-iotests/205 | 2 +-
 tests/qemu-iotests/208 | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
tests/qemu-iotests/205 +1 -1
index e7b2eae51d..31b2f5707a 100755
@@ -153,4 +153,4 @@ class TestNbdServerRemove(iotests.QMPTestCase):
 
 
 if __name__ == '__main__':
-    iotests.main()
+    iotests.main(supported_fmts=['generic'])
tests/qemu-iotests/208 +2 -0
index 18f59ada94..1e202388dc 100755
@@ -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, \
Signature · 1 line
2.11.1