diff mbox series

[3/3] iotests: blacklist bochs and cloop for 205 and 208

Message ID 1522422996-14235-4-git-send-email-vsementsov@virtuozzo.com
State New
Headers show
Series iotests: blacklist bochs and cloop for 205 and 208 | expand

Commit Message

Vladimir Sementsov-Ogievskiy March 30, 2018, 3:16 p.m. UTC
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(-)

Comments

Kevin Wolf April 3, 2018, 1:36 p.m. UTC | #1
Am 30.03.2018 um 17:16 hat Vladimir Sementsov-Ogievskiy geschrieben:
> 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>

We can take this for now, but I think I would actually prefer a solution
like in the bash tests, where the $IMGFMT_GENERIC environment variable
is checked for "_supported_fmt generic".

I suppose in Python test cases, we can assume that generic is meant when
neither supported_fmts nor unsupported_fmts are given (or both are empty
lists).

Kevin
Vladimir Sementsov-Ogievskiy April 9, 2018, 11:30 a.m. UTC | #2
03.04.2018 16:36, Kevin Wolf wrote:
> Am 30.03.2018 um 17:16 hat Vladimir Sementsov-Ogievskiy geschrieben:
>> 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>
> We can take this for now, but I think I would actually prefer a solution
> like in the bash tests, where the $IMGFMT_GENERIC environment variable
> is checked for "_supported_fmt generic".
>
> I suppose in Python test cases, we can assume that generic is meant when
> neither supported_fmts nor unsupported_fmts are given (or both are empty
> lists).
>
> Kevin

it may be ok for verify_image_format, as we can call it or not call (to 
support all formats).

but iotests main function always call verify_image_format, so, this will 
skip bochs and cloop for all
iotests which call maind() without format restriction.

So, I think it is safer to directly mimic bash tests behavior - allow 
'generic' as a member of supported_fmts.
Kevin Wolf April 9, 2018, 1:29 p.m. UTC | #3
Am 09.04.2018 um 13:30 hat Vladimir Sementsov-Ogievskiy geschrieben:
> 03.04.2018 16:36, Kevin Wolf wrote:
> > Am 30.03.2018 um 17:16 hat Vladimir Sementsov-Ogievskiy geschrieben:
> > > 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>
> > We can take this for now, but I think I would actually prefer a solution
> > like in the bash tests, where the $IMGFMT_GENERIC environment variable
> > is checked for "_supported_fmt generic".
> > 
> > I suppose in Python test cases, we can assume that generic is meant when
> > neither supported_fmts nor unsupported_fmts are given (or both are empty
> > lists).
> > 
> > Kevin
> 
> it may be ok for verify_image_format, as we can call it or not call (to
> support all formats).
> 
> but iotests main function always call verify_image_format, so, this
> will skip bochs and cloop for all iotests which call maind() without
> format restriction.

Yes, but that's what we want. Read-only formats can only be tested with
test cases made specifically for the respective format, because they
need to use a binary image from sample_images/.

I don't think there is a case where we really want to run the test for
all possible formats. Can you think of one?

> So, I think it is safer to directly mimic bash tests behavior - allow
> 'generic' as a member of supported_fmts.

That works, too, but I think it's not quite as nice.

Kevin
diff mbox series

Patch

diff --git a/tests/qemu-iotests/205 b/tests/qemu-iotests/205
index e7b2eae..c41b929 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(unsupported_fmts=['bochs', 'cloop'])
diff --git a/tests/qemu-iotests/208 b/tests/qemu-iotests/208
index 18f59ad..3bbfc9d 100755
--- a/tests/qemu-iotests/208
+++ b/tests/qemu-iotests/208
@@ -22,6 +22,8 @@ 
 
 import iotests
 
+iotests.verify_image_format(unsupported_fmts=['bochs', 'cloop'])
+
 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, \