@@ -21,23 +21,29 @@ class TestZFSSRCreateDestroy:
2121 and VM import.
2222 """
2323
24- def test_create_zfs_sr_without_zfs (self , host ):
24+ def test_create_zfs_sr_without_zfs (self , host , image_format ):
2525 # This test must be the first in the series in this module
2626 assert not host .file_exists ('/usr/sbin/zpool' ), \
2727 "zfs must not be installed on the host at the beginning of the tests"
2828 sr = None
2929 try :
30- sr = host .sr_create ('zfs' , "ZFS-local-SR-test" , {'location' : POOL_PATH })
30+ sr = host .sr_create ('zfs' , "ZFS-local-SR-test" , {
31+ 'location' : POOL_PATH ,
32+ 'preferred-image-formats' : image_format
33+ }, verify = True )
3134 except Exception :
3235 logging .info ("SR creation failed, as expected." )
3336 if sr is not None :
3437 sr .destroy ()
3538 assert False , "SR creation should not have succeeded!"
3639
3740 @pytest .mark .usefixtures ("zpool_vol0" )
38- def test_create_and_destroy_sr (self , host ):
41+ def test_create_and_destroy_sr (self , host , image_format ):
3942 # Create and destroy tested in the same test to leave the host as unchanged as possible
40- sr = host .sr_create ('zfs' , "ZFS-local-SR-test" , {'location' : POOL_PATH }, verify = True )
43+ sr = host .sr_create ('zfs' , "ZFS-local-SR-test" , {
44+ 'location' : POOL_PATH ,
45+ 'preferred-image-formats' : image_format
46+ }, verify = True )
4147 # import a VM in order to detect vm import issues here rather than in the vm_on_xfs_fixture used in
4248 # the next tests, because errors in fixtures break teardown
4349 vm = host .import_vm (vm_image ('mini-linux-x86_64-bios' ), sr_uuid = sr .uuid )
0 commit comments