|
4 | 4 |
|
5 | 5 | import pytest
|
6 | 6 | from ocp_resources.data_source import DataSource
|
7 |
| -from ocp_resources.datavolume import DataVolume |
8 | 7 | from ocp_resources.deployment import Deployment
|
9 | 8 | from ocp_resources.persistent_volume_claim import PersistentVolumeClaim
|
10 | 9 | from ocp_resources.pod import Pod
|
|
25 | 24 | ZERO_CPU_CORES,
|
26 | 25 | disk_file_system_info,
|
27 | 26 | enable_swap_fedora_vm,
|
28 |
| - fail_if_not_zero_restartcount, |
29 | 27 | metric_result_output_dict_by_mountpoint,
|
30 |
| - restart_cdi_worker_pod, |
31 | 28 | wait_for_metric_vmi_request_cpu_cores_output,
|
32 | 29 | )
|
33 | 30 | from tests.observability.utils import validate_metrics_value
|
34 | 31 | from tests.utils import create_vms
|
35 | 32 | from utilities import console
|
36 | 33 | from utilities.constants import (
|
37 |
| - CDI_UPLOAD_TMP_PVC, |
38 | 34 | NODE_STR,
|
39 | 35 | ONE_CPU_CORE,
|
40 | 36 | OS_FLAVOR_FEDORA,
|
41 |
| - PVC, |
42 |
| - SOURCE_POD, |
43 | 37 | SSP_OPERATOR,
|
44 | 38 | TIMEOUT_2MIN,
|
45 | 39 | TIMEOUT_4MIN,
|
46 | 40 | TIMEOUT_15SEC,
|
47 |
| - TIMEOUT_30MIN, |
48 | 41 | TWO_CPU_CORES,
|
49 | 42 | TWO_CPU_SOCKETS,
|
50 | 43 | TWO_CPU_THREADS,
|
51 | 44 | VIRT_TEMPLATE_VALIDATOR,
|
52 | 45 | Images,
|
53 | 46 | )
|
54 | 47 | from utilities.hco import ResourceEditorValidateHCOReconcile
|
55 |
| -from utilities.infra import create_ns, get_http_image_url, get_node_selector_dict, get_pod_by_name_prefix, unique_name |
| 48 | +from utilities.infra import create_ns, get_node_selector_dict, get_pod_by_name_prefix, unique_name |
56 | 49 | from utilities.monitoring import get_metrics_value
|
57 | 50 | from utilities.network import assert_ping_successful
|
58 | 51 | from utilities.ssp import verify_ssp_pod_is_running
|
59 | 52 | from utilities.storage import (
|
60 |
| - create_dv, |
61 | 53 | data_volume_template_with_source_ref_dict,
|
62 | 54 | is_snapshot_supported_by_sc,
|
63 | 55 | vm_snapshot,
|
64 |
| - wait_for_cdi_worker_pod, |
65 | 56 | )
|
66 | 57 | from utilities.virt import (
|
67 | 58 | VirtualMachineForTests,
|
@@ -202,101 +193,6 @@ def virt_up_metrics_values(request, prometheus):
|
202 | 193 | return int(query_response[0]["value"][1])
|
203 | 194 |
|
204 | 195 |
|
205 |
| -@pytest.fixture() |
206 |
| -def windows_dv_with_block_volume_mode( |
207 |
| - namespace, |
208 |
| - unprivileged_client, |
209 |
| - storage_class_with_block_volume_mode, |
210 |
| -): |
211 |
| - with create_dv( |
212 |
| - dv_name="test-dv-windows-image", |
213 |
| - namespace=namespace.name, |
214 |
| - url=get_http_image_url(image_directory=Images.Windows.UEFI_WIN_DIR, image_name=Images.Windows.WIN2k19_IMG), |
215 |
| - size=Images.Windows.DEFAULT_DV_SIZE, |
216 |
| - storage_class=storage_class_with_block_volume_mode, |
217 |
| - client=unprivileged_client, |
218 |
| - volume_mode=DataVolume.VolumeMode.BLOCK, |
219 |
| - ) as dv: |
220 |
| - dv.wait_for_dv_success(timeout=TIMEOUT_30MIN) |
221 |
| - yield dv |
222 |
| - |
223 |
| - |
224 |
| -@pytest.fixture() |
225 |
| -def cloned_dv_from_block_to_fs( |
226 |
| - unprivileged_client, |
227 |
| - windows_dv_with_block_volume_mode, |
228 |
| - storage_class_with_filesystem_volume_mode, |
229 |
| -): |
230 |
| - with create_dv( |
231 |
| - source=PVC, |
232 |
| - dv_name="cloned-test-dv-windows-image", |
233 |
| - namespace=windows_dv_with_block_volume_mode.namespace, |
234 |
| - source_pvc=windows_dv_with_block_volume_mode.name, |
235 |
| - source_namespace=windows_dv_with_block_volume_mode.namespace, |
236 |
| - size=windows_dv_with_block_volume_mode.size, |
237 |
| - storage_class=storage_class_with_filesystem_volume_mode, |
238 |
| - client=unprivileged_client, |
239 |
| - volume_mode=DataVolume.VolumeMode.FILE, |
240 |
| - ) as cdv: |
241 |
| - cdv.wait_for_status(status=DataVolume.Status.CLONE_IN_PROGRESS, timeout=TIMEOUT_2MIN) |
242 |
| - yield cdv |
243 |
| - |
244 |
| - |
245 |
| -@pytest.fixture() |
246 |
| -def running_cdi_worker_pod(cloned_dv_from_block_to_fs): |
247 |
| - for pod_name in [CDI_UPLOAD_TMP_PVC, SOURCE_POD]: |
248 |
| - wait_for_cdi_worker_pod( |
249 |
| - pod_name=pod_name, |
250 |
| - storage_ns_name=cloned_dv_from_block_to_fs.namespace, |
251 |
| - ).wait_for_status(status=Pod.Status.RUNNING, timeout=TIMEOUT_2MIN) |
252 |
| - |
253 |
| - |
254 |
| -@pytest.fixture() |
255 |
| -def restarted_cdi_dv_clone( |
256 |
| - unprivileged_client, |
257 |
| - cloned_dv_from_block_to_fs, |
258 |
| - running_cdi_worker_pod, |
259 |
| -): |
260 |
| - restart_cdi_worker_pod( |
261 |
| - unprivileged_client=unprivileged_client, |
262 |
| - dv=cloned_dv_from_block_to_fs, |
263 |
| - pod_prefix=CDI_UPLOAD_TMP_PVC, |
264 |
| - ) |
265 |
| - |
266 |
| - |
267 |
| -@pytest.fixture() |
268 |
| -def ready_uploaded_dv(unprivileged_client, namespace): |
269 |
| - with create_dv( |
270 |
| - source=UPLOAD_STR, |
271 |
| - dv_name=f"{UPLOAD_STR}-dv", |
272 |
| - namespace=namespace.name, |
273 |
| - storage_class=py_config["default_storage_class"], |
274 |
| - client=unprivileged_client, |
275 |
| - ) as dv: |
276 |
| - dv.wait_for_status(status=DataVolume.Status.UPLOAD_READY, timeout=TIMEOUT_2MIN) |
277 |
| - yield dv |
278 |
| - |
279 |
| - |
280 |
| -@pytest.fixture() |
281 |
| -def restarted_cdi_dv_upload(unprivileged_client, ready_uploaded_dv): |
282 |
| - restart_cdi_worker_pod( |
283 |
| - unprivileged_client=unprivileged_client, |
284 |
| - dv=ready_uploaded_dv, |
285 |
| - pod_prefix=CDI_UPLOAD_PRIME, |
286 |
| - ) |
287 |
| - ready_uploaded_dv.wait_for_status(status=DataVolume.Status.UPLOAD_READY, timeout=TIMEOUT_2MIN) |
288 |
| - |
289 |
| - |
290 |
| -@pytest.fixture() |
291 |
| -def zero_clone_dv_restart_count(cloned_dv_from_block_to_fs): |
292 |
| - fail_if_not_zero_restartcount(dv=cloned_dv_from_block_to_fs) |
293 |
| - |
294 |
| - |
295 |
| -@pytest.fixture() |
296 |
| -def zero_upload_dv_restart_count(ready_uploaded_dv): |
297 |
| - fail_if_not_zero_restartcount(dv=ready_uploaded_dv) |
298 |
| - |
299 |
| - |
300 | 196 | @pytest.fixture()
|
301 | 197 | def connected_vm_console_successfully(vm_for_test, prometheus):
|
302 | 198 | with console.Console(vm=vm_for_test) as vmc:
|
|
0 commit comments