iotests: blacklist bochs and cloop for 205 and 208
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
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
@@ -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
PATCH v2 2/2 iotests: blacklist bochs and cloop for 205 and 208
In reply to Vladimir Sementsov-OgievskiyBlacklist 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
@@ -153,4 +153,4 @@ class TestNbdServerRemove(iotests.QMPTestCase): if __name__ == '__main__': - iotests.main() + iotests.main(supported_fmts=['generic'])
tests/qemu-iotests/208 +2 -0
@@ -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
Kevin Wolf
AppliedAm 09.04.2018 um 13:44 hat Vladimir Sementsov-Ogievskiy geschrieben:
Quoted 1 line
v2: move from
unsupported_fmtsto support "generic", like in bash tests.
Thanks, applied to the block branch.
Kevin