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 :
@@ -63,16 +65,16 @@ def test_snapshot(self, vm_on_zfsvol_sr):
6365
6466 @pytest .mark .small_vm
6567 @pytest .mark .parametrize ("vdi_op" , ["snapshot" ]) # "clone" requires a snapshot
66- def test_coalesce (self , storage_test_vm : VM , vdi_on_zfsvol_sr : VDI , vdi_op : CoalesceOperation ):
68+ def test_coalesce (self , storage_test_vm : VM , vdi_on_zfsvol_sr : VDI , vdi_op : CoalesceOperation ) -> None :
6769 coalesce_integrity (storage_test_vm , vdi_on_zfsvol_sr , vdi_op )
6870
6971 @pytest .mark .small_vm
7072 @pytest .mark .parametrize ("compression" , ["none" , "gzip" , "zstd" ])
71- def test_xva_export_import (self , vm_on_zfsvol_sr : VM , compression : XVACompression ):
73+ def test_xva_export_import (self , vm_on_zfsvol_sr : VM , compression : XVACompression ) -> None :
7274 xva_export_import (vm_on_zfsvol_sr , compression )
7375
7476 @pytest .mark .small_vm
75- def test_vdi_export_import (self , storage_test_vm : VM , zfsvol_sr : SR , image_format : ImageFormat ):
77+ def test_vdi_export_import (self , storage_test_vm : VM , zfsvol_sr : SR , image_format : ImageFormat ) -> None :
7678 vm = storage_test_vm
7779 sr = zfsvol_sr
7880 vdi : VDI | None = sr .create_vdi (image_format = image_format )
@@ -111,7 +113,7 @@ def test_vdi_export_import(self, storage_test_vm: VM, zfsvol_sr: SR, image_forma
111113
112114 @pytest .mark .reboot
113115 @pytest .mark .small_vm
114- def test_reboot (self , vm_on_zfsvol_sr , host , zfsvol_sr ) :
116+ def test_reboot (self , vm_on_zfsvol_sr : VM , host : Host , zfsvol_sr : SR ) -> None :
115117 sr = zfsvol_sr
116118 vm = vm_on_zfsvol_sr
117119 host .reboot (verify = True )
0 commit comments