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