@@ -32,7 +32,7 @@ class TestEXTSRCreateDestroy:
3232 and VM import.
3333 """
3434
35- def test_create_sr_with_missing_device (self , host ) :
35+ def test_create_sr_with_missing_device (self , host : Host ) -> None :
3636 try_to_create_sr_with_missing_device ('ext' , 'EXT-local-SR-test' , host )
3737
3838 def test_create_and_destroy_sr (self , host : Host ,
@@ -53,13 +53,13 @@ def test_create_and_destroy_sr(self, host: Host,
5353@pytest .mark .usefixtures ("ext_sr" )
5454class TestEXTSR :
5555 @pytest .mark .quicktest
56- def test_quicktest (self , ext_sr ) :
56+ def test_quicktest (self , ext_sr : SR ) -> None :
5757 ext_sr .run_quicktest ()
5858
59- def test_vdi_is_not_open (self , vdi_on_ext_sr ) :
59+ def test_vdi_is_not_open (self , vdi_on_ext_sr : VDI ) -> None :
6060 assert not vdi_is_open (vdi_on_ext_sr )
6161
62- def test_vdi_image_format (self , vdi_on_ext_sr : VDI , image_format : ImageFormat ):
62+ def test_vdi_image_format (self , vdi_on_ext_sr : VDI , image_format : ImageFormat ) -> None :
6363 fmt = vdi_on_ext_sr .get_image_format ()
6464 # feature-detect: if the SM doesn't report image-format, skip this check
6565 if not fmt :
@@ -68,15 +68,15 @@ def test_vdi_image_format(self, vdi_on_ext_sr: VDI, image_format: ImageFormat):
6868
6969 @pytest .mark .small_vm # run with a small VM to test the features
7070 @pytest .mark .big_vm # and ideally with a big VM to test it scales
71- def test_start_and_shutdown_VM (self , vm_on_ext_sr ) :
71+ def test_start_and_shutdown_VM (self , vm_on_ext_sr : VM ) -> None :
7272 vm = vm_on_ext_sr
7373 vm .start ()
7474 vm .wait_for_os_booted ()
7575 vm .shutdown (verify = True )
7676
7777 @pytest .mark .small_vm
7878 @pytest .mark .big_vm
79- def test_snapshot (self , vm_on_ext_sr ) :
79+ def test_snapshot (self , vm_on_ext_sr : VM ) -> None :
8080 vm = vm_on_ext_sr
8181 vm .start ()
8282 try :
@@ -87,23 +87,23 @@ def test_snapshot(self, vm_on_ext_sr):
8787
8888 @pytest .mark .small_vm
8989 @pytest .mark .parametrize ("vdi_op" , ["snapshot" , "clone" ])
90- def test_coalesce (self , storage_test_vm : VM , vdi_on_ext_sr : VDI , vdi_op : CoalesceOperation ):
90+ def test_coalesce (self , storage_test_vm : VM , vdi_on_ext_sr : VDI , vdi_op : CoalesceOperation ) -> None :
9191 coalesce_integrity (storage_test_vm , vdi_on_ext_sr , vdi_op )
9292
9393 @pytest .mark .small_vm
9494 @pytest .mark .parametrize ("compression" , ["none" , "gzip" , "zstd" ])
95- def test_xva_export_import (self , vm_on_ext_sr : VM , compression : XVACompression ):
95+ def test_xva_export_import (self , vm_on_ext_sr : VM , compression : XVACompression ) -> None :
9696 xva_export_import (vm_on_ext_sr , compression )
9797
9898 @pytest .mark .small_vm
99- def test_vdi_export_import (self , storage_test_vm : VM , ext_sr : SR , image_format : ImageFormat ):
99+ def test_vdi_export_import (self , storage_test_vm : VM , ext_sr : SR , image_format : ImageFormat ) -> None :
100100 vdi_export_import (storage_test_vm , ext_sr , image_format )
101101
102102 # *** tests with reboots (longer tests).
103103
104104 @pytest .mark .small_vm
105105 @pytest .mark .big_vm
106- def test_blktap_activate_failure (self , vm_on_ext_sr ) :
106+ def test_blktap_activate_failure (self , vm_on_ext_sr : VM ) -> None :
107107 from lib .fistpoint import FistPoint
108108 vm = vm_on_ext_sr
109109 with FistPoint (vm .host , "blktap_activate_inject_failure" ), pytest .raises (SSHCommandFailed ):
@@ -112,7 +112,7 @@ def test_blktap_activate_failure(self, vm_on_ext_sr):
112112
113113 @pytest .mark .small_vm
114114 @pytest .mark .big_vm
115- def test_resize (self , vm_on_ext_sr ) :
115+ def test_resize (self , vm_on_ext_sr : VM ) -> None :
116116 vm = vm_on_ext_sr
117117 vdi = VDI (vm .vdi_uuids ()[0 ], host = vm .host )
118118 old_size = vdi .get_virtual_size ()
@@ -124,7 +124,7 @@ def test_resize(self, vm_on_ext_sr):
124124
125125 @pytest .mark .small_vm
126126 @pytest .mark .big_vm
127- def test_failing_resize (self , host , ext_sr , vm_on_ext_sr , exit_on_fistpoint ) :
127+ def test_failing_resize (self , host : Host , ext_sr : SR , vm_on_ext_sr : VM , exit_on_fistpoint : None ) -> None :
128128 vm = vm_on_ext_sr
129129 vdi = VDI (vm .vdi_uuids ()[0 ], host = vm .host )
130130 old_size = vdi .get_virtual_size ()
@@ -135,13 +135,13 @@ def test_failing_resize(self, host, ext_sr, vm_on_ext_sr, exit_on_fistpoint):
135135 vdi .resize (new_size )
136136 except SSHCommandFailed :
137137 logging .info (f"Launching SR scan for { ext_sr } after failure" )
138- host .xe ("sr-scan" , {"uuid" : ext_sr })
138+ host .xe ("sr-scan" , {"uuid" : ext_sr . uuid })
139139
140140 assert vdi .get_virtual_size () == new_size
141141
142142 @pytest .mark .reboot
143143 @pytest .mark .small_vm
144- def test_reboot (self , host , ext_sr , vm_on_ext_sr ) :
144+ def test_reboot (self , host : Host , ext_sr : SR , vm_on_ext_sr : VM ) -> None :
145145 sr = ext_sr
146146 vm = vm_on_ext_sr
147147 host .reboot (verify = True )
0 commit comments