4040
4141@pytest .fixture ()
4242def skip_non_shared_storage (storage_class_name_scope_function ):
43+ """Skip tests if the storage class is non-shared."""
4344 if storage_class_name_scope_function in HPP_STORAGE_CLASSES :
4445 pytest .skip ("Skipping when storage is non-shared" )
4546
4647
4748@pytest .fixture ()
4849def bridge_on_node (admin_client ):
50+ """Create a Linux Bridge network device and yield it."""
4951 with network_device (
5052 interface_type = LINUX_BRIDGE ,
5153 nncp_name = BRIDGE_NAME ,
@@ -57,6 +59,7 @@ def bridge_on_node(admin_client):
5759
5860@pytest .fixture ()
5961def linux_nad (admin_client , namespace , bridge_on_node ):
62+ """Create a Linux Bridge Network Attachment Definition (NAD) and yield it."""
6063 with network_nad (
6164 namespace = namespace ,
6265 nad_type = LINUX_BRIDGE ,
@@ -71,6 +74,7 @@ def linux_nad(admin_client, namespace, bridge_on_node):
7174def cirros_pvc (
7275 data_volume_template_metadata ,
7376):
77+ """Create a PVC from the data volume template metadata."""
7478 return PersistentVolumeClaim (
7579 name = data_volume_template_metadata ["name" ],
7680 namespace = data_volume_template_metadata ["namespace" ],
@@ -81,11 +85,13 @@ def cirros_pvc(
8185def pvc_original_timestamp (
8286 cirros_pvc ,
8387):
88+ """Get the original creation timestamp of the Cirros PVC."""
8489 return cirros_pvc .instance .metadata .creationTimestamp
8590
8691
8792@pytest .fixture ()
8893def dv_non_exist_url (namespace , storage_class_name_scope_module ):
94+ """Create a DV with a non-existent URL to test import failure."""
8995 with create_dv (
9096 dv_name = f"cnv-876-{ storage_class_name_scope_module } " ,
9197 namespace = namespace .name ,
@@ -104,6 +110,7 @@ def dv_from_http_import(
104110 storage_class_name_scope_module ,
105111 images_internal_http_server ,
106112):
113+ """Create a DV from HTTP import with parameters from the test function."""
107114 with create_dv (
108115 dv_name = f"{ request .param .get ('dv_name' , 'http-dv' )} -{ storage_class_name_scope_module } " ,
109116 namespace = namespace .name ,
@@ -127,6 +134,7 @@ def running_pod_with_dv_pvc(
127134 storage_class_name_scope_module ,
128135 dv_from_http_import ,
129136):
137+ """Create a running pod with DV's PVC."""
130138 dv_from_http_import .wait_for_dv_success ()
131139 with create_pod_for_pvc (
132140 pvc = dv_from_http_import .pvc ,
@@ -137,6 +145,7 @@ def running_pod_with_dv_pvc(
137145
138146@pytest .fixture ()
139147def created_blank_dv_list (unprivileged_client , namespace , storage_class_name_scope_module , number_of_dvs ):
148+ """Create a list of blank DVs."""
140149 dvs_list = []
141150 try :
142151 for dv_index in range (number_of_dvs ):
@@ -189,6 +198,7 @@ def created_vm_list(unprivileged_client, created_blank_dv_list, storage_class_na
189198
190199@pytest .fixture ()
191200def dvs_and_vms_from_public_registry (unprivileged_client , namespace , storage_class_name_scope_function ):
201+ """Create DVs from public registry and VMs from those DVs."""
192202 dvs = []
193203 vms = []
194204 try :
@@ -230,6 +240,7 @@ def dvs_and_vms_from_public_registry(unprivileged_client, namespace, storage_cla
230240
231241@pytest .fixture ()
232242def dv_with_annotation (admin_client , namespace , linux_nad ):
243+ """Create a DV with multus annotation and yield the importer pod annotations."""
233244 with create_dv (
234245 dv_name = "dv-annotation" ,
235246 namespace = namespace .name ,
0 commit comments