@@ -19,23 +19,29 @@ class TestZFSSRCreateDestroy:
19
19
and VM import.
20
20
"""
21
21
22
- def test_create_zfs_sr_without_zfs (self , host ):
22
+ def test_create_zfs_sr_without_zfs (self , host , image_format ):
23
23
# This test must be the first in the series in this module
24
24
assert not host .file_exists ('/usr/sbin/zpool' ), \
25
25
"zfs must not be installed on the host at the beginning of the tests"
26
26
sr = None
27
27
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 )
29
32
except Exception :
30
33
logging .info ("SR creation failed, as expected." )
31
34
if sr is not None :
32
35
sr .destroy ()
33
36
assert False , "SR creation should not have succeeded!"
34
37
35
38
@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 ):
37
40
# 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 )
39
45
# import a VM in order to detect vm import issues here rather than in the vm_on_xfs_fixture used in
40
46
# the next tests, because errors in fixtures break teardown
41
47
vm = host .import_vm (vm_image ('mini-linux-x86_64-bios' ), sr_uuid = sr .uuid )
0 commit comments