@@ -28,10 +28,15 @@ class TestEXTSRCreateDestroy:
2828 def test_create_sr_with_missing_device (self , host ):
2929 try_to_create_sr_with_missing_device ('ext' , 'EXT-local-SR-test' , host )
3030
31- def test_create_and_destroy_sr (self , host : Host , unused_512B_disks : dict [Host , list [Host .BlockDeviceInfo ]]) -> None :
31+ def test_create_and_destroy_sr (self , host : Host ,
32+ unused_512B_disks : dict [Host , list [Host .BlockDeviceInfo ]],
33+ image_format : str
34+ ) -> None :
3235 # Create and destroy tested in the same test to leave the host as unchanged as possible
3336 sr_disk = unused_512B_disks [host ][0 ]["name" ]
34- sr = host .sr_create ('ext' , "EXT-local-SR-test" , {'device' : '/dev/' + sr_disk }, verify = True )
37+ sr = host .sr_create ('ext' , "EXT-local-SR-test" ,
38+ {'device' : '/dev/' + sr_disk ,
39+ 'preferred-image-formats' : image_format }, verify = True )
3540 # import a VM in order to detect vm import issues here rather than in the vm_on_xfs_fixture used in
3641 # the next tests, because errors in fixtures break teardown
3742 vm = host .import_vm (vm_image ('mini-linux-x86_64-bios' ), sr_uuid = sr .uuid )
@@ -47,6 +52,13 @@ def test_quicktest(self, ext_sr):
4752 def test_vdi_is_not_open (self , vdi_on_ext_sr ):
4853 assert not vdi_is_open (vdi_on_ext_sr )
4954
55+ def test_vdi_image_format (self , vdi_on_ext_sr : VDI , image_format : str ):
56+ fmt = vdi_on_ext_sr .get_image_format ()
57+ # feature-detect: if the SM doesn't report image-format, skip this check
58+ if not fmt :
59+ pytest .skip ("SM does not report sm-config:image-format; skipping format check" )
60+ assert fmt == image_format
61+
5062 @pytest .mark .small_vm # run with a small VM to test the features
5163 @pytest .mark .big_vm # and ideally with a big VM to test it scales
5264 def test_start_and_shutdown_VM (self , vm_on_ext_sr ):
0 commit comments