Skip to content

Commit 9747a01

Browse files
authored
Merge branch 'main' into kubevirt_vm_labels
2 parents 8513c2e + 78d0b48 commit 9747a01

5 files changed

Lines changed: 12 additions & 543 deletions

File tree

tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2476,9 +2476,11 @@ def migrated_vm_multiple_times(request, vm_for_migration_test):
24762476

24772477

24782478
@pytest.fixture()
2479-
def removed_default_storage_classes(cluster_storage_classes):
2479+
def removed_default_storage_classes(admin_client, golden_images_namespace, cluster_storage_classes):
24802480
with remove_default_storage_classes(cluster_storage_classes=cluster_storage_classes):
24812481
yield
2482+
if not verify_boot_sources_reimported(admin_client=admin_client, namespace=golden_images_namespace.name):
2483+
pytest.fail("Failed to reimport all boot sources at teardown")
24822484

24832485

24842486
@pytest.fixture(scope="session")

tests/infrastructure/golden_images/update_boot_source/test_ssp_data_import_crons.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from tests.infrastructure.golden_images.update_boot_source.utils import get_all_dic_volume_names
2020
from utilities.constants import (
2121
BIND_IMMEDIATE_ANNOTATION,
22-
QUARANTINED,
2322
TIMEOUT_1MIN,
2423
TIMEOUT_2MIN,
2524
TIMEOUT_5MIN,
@@ -328,10 +327,6 @@ def test_data_import_cron_using_default_storage_class(
328327
)
329328

330329

331-
@pytest.mark.xfail(
332-
reason=f"{QUARANTINED}: This test still fail in some cases ; tracked in CNV-62615",
333-
run=False,
334-
)
335330
@pytest.mark.polarion("CNV-7532")
336331
def test_data_import_cron_deletion_on_opt_out(
337332
admin_client,

tests/storage/cdi_import/test_import_http.py

Lines changed: 7 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from 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,
@@ -43,11 +42,8 @@
4342
from utilities.ssp import validate_os_info_vmi_vs_windows_os
4443
from 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
)
@@ -64,12 +60,6 @@
6460
DEFAULT_DV_SIZE = Images.Cirros.DEFAULT_DV_SIZE
6561
SMALL_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-
7363
LATEST_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
)
228184
def 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
303257
def 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

tests/storage/conftest.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@
6262
from utilities.jira import is_jira_open
6363
from utilities.storage import (
6464
create_cirros_dv_for_snapshot_dict,
65-
data_volume,
6665
get_downloaded_artifact,
67-
sc_volume_binding_mode_is_wffc,
6866
write_file,
6967
)
7068
from utilities.virt import VirtualMachineForTests
@@ -211,12 +209,6 @@ def skip_test_if_no_hpp_sc(cluster_storage_classes):
211209
pytest.skip(f"This test runs only on one of the hpp storage classes: {HPP_STORAGE_CLASSES}")
212210

213211

214-
@pytest.fixture(scope="module")
215-
def skip_when_hpp_no_waitforfirstconsumer(storage_class_matrix_hpp_matrix__module__):
216-
if not sc_volume_binding_mode_is_wffc(sc=[*storage_class_matrix_hpp_matrix__module__][0]):
217-
pytest.skip("Test only run when volumeBindingMode is WaitForFirstConsumer")
218-
219-
220212
@pytest.fixture()
221213
def uploadproxy_route_deleted(hco_namespace):
222214
"""
@@ -426,21 +418,6 @@ def cirros_vm_name(request):
426418
return request.param["vm_name"]
427419

428420

429-
@pytest.fixture(scope="module")
430-
def data_volume_multi_hpp_storage(
431-
request,
432-
namespace,
433-
schedulable_nodes,
434-
storage_class_matrix_hpp_matrix__module__,
435-
):
436-
yield from data_volume(
437-
request=request,
438-
namespace=namespace,
439-
storage_class=[*storage_class_matrix_hpp_matrix__module__][0],
440-
schedulable_nodes=schedulable_nodes,
441-
)
442-
443-
444421
@pytest.fixture(scope="session")
445422
def available_hpp_storage_class(skip_test_if_no_hpp_sc, cluster_storage_classes):
446423
"""

0 commit comments

Comments
 (0)