99
1010if TYPE_CHECKING :
1111 from lib .host import Host
12+ from lib .vdi import VDI
1213
1314# Requirements:
1415# - one XCP-ng host with an additional unused 4KiB disk for the SR
@@ -23,10 +24,14 @@ class TestLARGEBLOCKSRCreateDestroy:
2324 def test_create_sr_with_missing_device (self , host ):
2425 try_to_create_sr_with_missing_device ('largeblock' , 'LARGEBLOCK-local-SR-test' , host )
2526
26- def test_create_and_destroy_sr (self , host : Host , unused_4k_disks : dict [Host , list [Host .BlockDeviceInfo ]]) -> None :
27+ def test_create_and_destroy_sr (self , host : Host ,
28+ unused_4k_disks : dict [Host , list [Host .BlockDeviceInfo ]],
29+ image_format : str ) -> None :
2730 # Create and destroy tested in the same test to leave the host as unchanged as possible
2831 sr_disk = unused_4k_disks [host ][0 ]["name" ]
29- sr = host .sr_create ('largeblock' , "LARGEBLOCK-local-SR-test" , {'device' : '/dev/' + sr_disk }, verify = True )
32+ sr = host .sr_create ('largeblock' , "LARGEBLOCK-local-SR-test" ,
33+ {'device' : '/dev/' + sr_disk ,
34+ 'preferred-image-formats' : image_format }, verify = True )
3035 # import a VM in order to detect vm import issues here rather than in the vm_on_xfs_fixture used in
3136 # the next tests, because errors in fixtures break teardown
3237 vm = host .import_vm (vm_image ('mini-linux-x86_64-bios' ), sr_uuid = sr .uuid )
@@ -42,6 +47,9 @@ def test_quicktest(self, largeblock_sr):
4247 def test_vdi_is_not_open (self , vdi_on_largeblock_sr ):
4348 assert not vdi_is_open (vdi_on_largeblock_sr )
4449
50+ def test_vdi_image_format (self , vdi_on_largeblock_sr : VDI , image_format : str ):
51+ assert vdi_on_largeblock_sr .get_image_format () == image_format
52+
4553 @pytest .mark .small_vm # run with a small VM to test the features
4654 @pytest .mark .big_vm # and ideally with a big VM to test it scales
4755 def test_start_and_shutdown_VM (self , vm_on_largeblock_sr ):
0 commit comments