55import logging
66
77from lib .common import vm_image , wait_for
8+ from lib .host import Host
89from lib .sr import SR
910from lib .vdi import VDI
1011from lib .vm import VM
1617
1718pytestmark = pytest .mark .usefixtures ("host_at_least_8_3" )
1819
20+
1921class TestZfsvolSRCreateDestroy :
2022 """
2123 Tests that do not use fixtures that setup the SR or import VMs,
2224 because they precisely need to test SR creation and destruction,
2325 and VM import.
2426 """
2527
26- def test_create_and_destroy_sr (self , sr_disk_wiped , host_with_zfsvol ) :
28+ def test_create_and_destroy_sr (self , sr_disk_wiped : str , host_with_zfsvol : Host ) -> None :
2729 host = host_with_zfsvol
2830 # Create and destroy tested in the same test to leave the host as unchanged as possible
2931 sr = host .sr_create ('zfs-vol' , "ZFS-local-SR-test" , {'device' : '/dev/' + sr_disk_wiped }, verify = True )
@@ -38,12 +40,12 @@ class TestZfsvolVm:
3840
3941 @pytest .mark .xfail
4042 @pytest .mark .quicktest
41- def test_quicktest (self , zfsvol_sr ) :
43+ def test_quicktest (self , zfsvol_sr : SR ) -> None :
4244 zfsvol_sr .run_quicktest ()
4345
4446 @pytest .mark .small_vm # run with a small VM to test the features
4547 @pytest .mark .big_vm # and ideally with a big VM to test it scales
46- def test_start_and_shutdown_VM (self , vm_on_zfsvol_sr ) :
48+ def test_start_and_shutdown_VM (self , vm_on_zfsvol_sr : VM ) -> None :
4749 vm = vm_on_zfsvol_sr
4850 vm .start ()
4951 vm .wait_for_os_booted ()
@@ -52,7 +54,7 @@ def test_start_and_shutdown_VM(self, vm_on_zfsvol_sr):
5254 @pytest .mark .xfail # needs support for destroying snapshots
5355 @pytest .mark .small_vm
5456 @pytest .mark .big_vm
55- def test_snapshot (self , vm_on_zfsvol_sr ) :
57+ def test_snapshot (self , vm_on_zfsvol_sr : VM ) -> None :
5658 vm = vm_on_zfsvol_sr
5759 vm .start ()
5860 try :
@@ -64,16 +66,16 @@ def test_snapshot(self, vm_on_zfsvol_sr):
6466 @pytest .mark .small_vm
6567 @pytest .mark .parametrize ("vdi_op" , ["snapshot" ]) # "clone" requires a snapshot
6668 @pytest .mark .skip ("zfsvol doesn't provide vhd-parent" )
67- def test_coalesce (self , storage_test_vm : VM , vdi_on_zfsvol_sr : VDI , vdi_op : CoalesceOperation ):
69+ def test_coalesce (self , storage_test_vm : VM , vdi_on_zfsvol_sr : VDI , vdi_op : CoalesceOperation ) -> None :
6870 coalesce_integrity (storage_test_vm , vdi_on_zfsvol_sr , vdi_op )
6971
7072 @pytest .mark .small_vm
7173 @pytest .mark .parametrize ("compression" , ["none" , "gzip" , "zstd" ])
72- def test_xva_export_import (self , vm_on_zfsvol_sr : VM , compression : XVACompression ):
74+ def test_xva_export_import (self , vm_on_zfsvol_sr : VM , compression : XVACompression ) -> None :
7375 xva_export_import (vm_on_zfsvol_sr , compression )
7476
7577 @pytest .mark .small_vm
76- def test_vdi_export_import (self , storage_test_vm : VM , zfsvol_sr : SR , image_format : ImageFormat ):
78+ def test_vdi_export_import (self , storage_test_vm : VM , zfsvol_sr : SR , image_format : ImageFormat ) -> None :
7779 vm = storage_test_vm
7880 sr = zfsvol_sr
7981 vdi : VDI | None = sr .create_vdi (image_format = image_format )
@@ -112,7 +114,7 @@ def test_vdi_export_import(self, storage_test_vm: VM, zfsvol_sr: SR, image_forma
112114
113115 @pytest .mark .reboot
114116 @pytest .mark .small_vm
115- def test_reboot (self , vm_on_zfsvol_sr , host , zfsvol_sr ) :
117+ def test_reboot (self , vm_on_zfsvol_sr : VM , host : Host , zfsvol_sr : SR ) -> None :
116118 sr = zfsvol_sr
117119 vm = vm_on_zfsvol_sr
118120 host .reboot (verify = True )
0 commit comments