2222from tests .storage .utils import (
2323 assert_num_files_in_pod ,
2424 assert_use_populator ,
25- create_vm_and_verify_image_permission ,
2625 create_vm_from_dv ,
2726 get_file_url ,
2827 get_importer_pod ,
4342from utilities .ssp import validate_os_info_vmi_vs_windows_os
4443from utilities .storage import (
4544 ErrorMsg ,
46- PodWithPVC ,
47- check_disk_count_in_vm ,
4845 create_dummy_first_consumer_pod ,
4946 create_dv ,
50- get_containers_for_pods_with_pvc ,
5147 get_test_artifact_server_url ,
5248 sc_volume_binding_mode_is_wffc ,
5349)
6460DEFAULT_DV_SIZE = Images .Cirros .DEFAULT_DV_SIZE
6561SMALL_DV_SIZE = "200Mi"
6662
67- DV_PARAMS = {
68- "file_name" : Images .Cdi .QCOW2_IMG ,
69- "source" : HTTPS ,
70- "configmap_name" : INTERNAL_HTTP_CONFIGMAP_NAME ,
71- }
72-
7363LATEST_WINDOWS_OS_DICT = py_config .get ("latest_windows_os_dict" , {})
7464
7565
@@ -176,45 +166,11 @@ def test_empty_url(namespace, storage_class_name_scope_module):
176166 pass
177167
178168
179- @pytest .mark .parametrize (
180- "dv_from_http_import" ,
181- [
182- pytest .param (
183- {
184- "dv_name" : "cnv-2145" ,
185- "file_name" : TAR_IMG ,
186- "content_type" : DataVolume .ContentType .ARCHIVE ,
187- },
188- ),
189- ],
190- indirect = True ,
191- )
192- @pytest .mark .sno
193- @pytest .mark .polarion ("CNV-2145" )
194- @pytest .mark .s390x
195- def test_successful_import_archive (
196- skip_block_volumemode_scope_module ,
197- running_pod_with_dv_pvc ,
198- ):
199- """
200- Skip block volume mode - archive does not support block mode DVs,
201- https://github.com/kubevirt/containerized-data-importer/blob/main/doc/supported_operations.md
202- """
203- assert_num_files_in_pod (pod = running_pod_with_dv_pvc , expected_num_of_files = 3 )
204-
205-
206169@pytest .mark .sno
207170@pytest .mark .gating
208171@pytest .mark .parametrize (
209172 "dv_from_http_import" ,
210173 [
211- pytest .param (
212- {
213- "dv_name" : "cnv-2143" ,
214- "file_name" : Images .Cdi .QCOW2_IMG ,
215- },
216- marks = pytest .mark .polarion ("CNV-2143" ),
217- ),
218174 pytest .param (
219175 {
220176 "dv_name" : "cnv-377" ,
@@ -226,7 +182,6 @@ def test_successful_import_archive(
226182 indirect = True ,
227183)
228184def test_successful_import_image (
229- running_pod_with_dv_pvc ,
230185 dv_from_http_import ,
231186 storage_class_name_scope_module ,
232187 cluster_csi_drivers_names ,
@@ -270,7 +225,12 @@ def test_successful_import_secure_archive(
270225 "dv_from_http_import" ,
271226 [
272227 pytest .param (
273- DV_PARAMS ,
228+ {
229+ "dv_name" : "cnv-2719" ,
230+ "file_name" : Images .Cdi .QCOW2_IMG ,
231+ "source" : HTTPS ,
232+ "configmap_name" : INTERNAL_HTTP_CONFIGMAP_NAME ,
233+ },
274234 marks = pytest .mark .polarion ("CNV-2719" ),
275235 ),
276236 ],
@@ -284,20 +244,14 @@ def test_successful_import_secure_image(internal_http_configmap, dv_from_http_im
284244
285245@pytest .mark .sno
286246@pytest .mark .parametrize (
287- ( "content_type" , " file_name") ,
247+ "content_type, file_name" ,
288248 [
289- pytest .param (
290- DataVolume .ContentType .ARCHIVE ,
291- TAR_IMG ,
292- marks = (pytest .mark .polarion ("CNV-2339" )),
293- ),
294249 pytest .param (
295250 DataVolume .ContentType .KUBEVIRT ,
296251 Images .Cirros .RAW_IMG_XZ ,
297252 marks = (pytest .mark .polarion ("CNV-784" ), pytest .mark .smoke ()),
298253 ),
299254 ],
300- ids = ["import_basic_auth_archive" , "import_basic_auth_kubevirt" ],
301255)
302256@pytest .mark .s390x
303257def test_successful_import_basic_auth (
@@ -324,17 +278,6 @@ def test_successful_import_basic_auth(
324278 storage_class = storage_class_name_scope_module ,
325279 ) as dv :
326280 dv .wait_for_dv_success ()
327- pvc = dv .pvc
328- with PodWithPVC (
329- namespace = pvc .namespace ,
330- name = f"{ pvc .name } -pod" ,
331- pvc_name = pvc .name ,
332- containers = get_containers_for_pods_with_pvc (
333- volume_mode = storage_class_matrix__module__ [storage_class_name_scope_module ]["volume_mode" ],
334- pvc_name = pvc .name ,
335- ),
336- ) as pod :
337- pod .wait_for_status (status = pod .Status .RUNNING )
338281
339282
340283@pytest .mark .sno
@@ -406,21 +349,6 @@ def test_unpack_compressed(
406349 )
407350
408351
409- @pytest .mark .parametrize (
410- "dv_from_http_import" ,
411- [
412- pytest .param (
413- DV_PARAMS ,
414- marks = pytest .mark .polarion ("CNV-2811" ),
415- ),
416- ],
417- indirect = True ,
418- )
419- @pytest .mark .sno
420- def test_certconfigmap (internal_http_configmap , running_pod_with_dv_pvc ):
421- assert_num_files_in_pod (pod = running_pod_with_dv_pvc , expected_num_of_files = 1 )
422-
423-
424352@pytest .mark .sno
425353@pytest .mark .parametrize (
426354 ("https_config_map" , "dv_from_http_import" ),
@@ -517,7 +445,6 @@ def test_successful_concurrent_blank_disk_import(
517445):
518446 for vm in vm_list_created_by_multiprocess :
519447 running_vm (vm = vm )
520- check_disk_count_in_vm (vm = vm )
521448
522449
523450@pytest .mark .parametrize (
@@ -644,13 +571,6 @@ def test_successful_vm_from_imported_dv_windows(
644571 )
645572
646573
647- @pytest .mark .polarion ("CNV-4032" )
648- @pytest .mark .sno
649- @pytest .mark .s390x
650- def test_disk_image_after_import (skip_block_volumemode_scope_module , cirros_dv_unprivileged ):
651- create_vm_and_verify_image_permission (dv = cirros_dv_unprivileged )
652-
653-
654574@pytest .mark .polarion ("CNV-4724" )
655575@pytest .mark .sno
656576@pytest .mark .s390x
0 commit comments