Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies = [
"pytest-progress>=1.3.0",
"pytest-testconfig>=0.2.0",
"python-benedict>=0.34.0",
"python-rrmngmnt>=0.1.32",
"python-rrmngmnt",
"python-utility-scripts>=1.0.1",
"pyvmomi>=8.0.3.0.1",
"pyyaml>=6.0.2",
Expand Down Expand Up @@ -110,6 +110,10 @@ dev = [
]

[tool.uv.sources]
python-rrmngmnt = { git = "https://github.com/rnetser/python-rrmngmnt.git", branch = "update-paramiko" }

[tool.uv]
override-dependencies = ["python-rrmngmnt"]

# Utilities Unit Testing Configuration
[tool.pytest.ini_options]
Expand Down
76 changes: 43 additions & 33 deletions tests/storage/cdi_clone/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,9 @@
from ocp_resources.data_source import DataSource
from ocp_resources.datavolume import DataVolume

from tests.storage.utils import create_cirros_dv
from utilities.constants import OS_FLAVOR_FEDORA
from utilities.storage import data_volume


@pytest.fixture(scope="module")
def cirros_dv_with_filesystem_volume_mode(
unprivileged_client,
namespace,
storage_class_with_filesystem_volume_mode,
):
yield from create_cirros_dv(
client=unprivileged_client,
namespace=namespace.name,
name="cirros-fs",
storage_class=storage_class_with_filesystem_volume_mode,
volume_mode=DataVolume.VolumeMode.FILE,
)


@pytest.fixture(scope="module")
def cirros_dv_with_block_volume_mode(
unprivileged_client,
namespace,
storage_class_with_block_volume_mode,
):
yield from create_cirros_dv(
client=unprivileged_client,
namespace=namespace.name,
name="cirros-block",
storage_class=storage_class_with_block_volume_mode,
volume_mode=DataVolume.VolumeMode.BLOCK,
)
from tests.storage.constants import QUAY_FEDORA_CONTAINER_IMAGE
from utilities.constants import OS_FLAVOR_FEDORA, REGISTRY_STR, Images
from utilities.storage import create_dv, data_volume


@pytest.fixture()
Expand All @@ -60,3 +30,43 @@ def fedora_data_source_scope_module(golden_images_namespace):
client=golden_images_namespace.client,
ensure_exists=True,
)


@pytest.fixture(scope="module")
def fedora_dv_with_filesystem_volume_mode(
unprivileged_client,
namespace,
storage_class_with_filesystem_volume_mode,
):
with create_dv(
dv_name="dv-fedora-fs",
namespace=namespace.name,
source=REGISTRY_STR,
url=QUAY_FEDORA_CONTAINER_IMAGE,
size=Images.Fedora.DEFAULT_DV_SIZE,
storage_class=storage_class_with_filesystem_volume_mode,
volume_mode=DataVolume.VolumeMode.FILE,
client=unprivileged_client,
) as dv:
dv.wait_for_dv_success()
yield dv


@pytest.fixture(scope="module")
def fedora_dv_with_block_volume_mode(
unprivileged_client,
namespace,
storage_class_with_block_volume_mode,
):
with create_dv(
dv_name="dv-fedora-block",
namespace=namespace.name,
source=REGISTRY_STR,
url=QUAY_FEDORA_CONTAINER_IMAGE,
size=Images.Fedora.DEFAULT_DV_SIZE,
storage_class=storage_class_with_block_volume_mode,
volume_mode=DataVolume.VolumeMode.BLOCK,
client=unprivileged_client,
) as dv:
dv.wait_for_dv_success()
yield dv
16 changes: 8 additions & 8 deletions tests/storage/cdi_clone/test_clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ def create_vm_from_clone_dv_template(
with VirtualMachineForTests(
name=vm_name,
namespace=namespace_name,
os_flavor=Images.Cirros.OS_FLAVOR,
os_flavor=OS_FLAVOR_FEDORA,
client=client,
memory_guest=Images.Cirros.DEFAULT_MEMORY_SIZE,
memory_guest=Images.Fedora.DEFAULT_MEMORY_SIZE,
data_volume_template=data_volume_template_dict(
target_dv_name=dv_name,
target_dv_namespace=namespace_name,
Expand All @@ -59,7 +59,7 @@ def create_vm_from_clone_dv_template(
storage_class=storage_class,
),
) as vm:
running_vm(vm=vm, wait_for_interfaces=False)
running_vm(vm=vm)


@pytest.mark.tier3
Expand Down Expand Up @@ -255,14 +255,14 @@ def test_clone_from_fs_to_block_using_dv_template(
skip_test_if_no_block_sc,
unprivileged_client,
namespace,
cirros_dv_with_filesystem_volume_mode,
fedora_dv_with_filesystem_volume_mode,
storage_class_with_block_volume_mode,
):
create_vm_from_clone_dv_template(
vm_name="vm-5607",
dv_name="dv-5607",
namespace_name=namespace.name,
source_dv=cirros_dv_with_filesystem_volume_mode,
source_dv=fedora_dv_with_filesystem_volume_mode,
client=unprivileged_client,
volume_mode=DataVolume.VolumeMode.BLOCK,
storage_class=storage_class_with_block_volume_mode,
Expand All @@ -276,20 +276,20 @@ def test_clone_from_block_to_fs_using_dv_template(
skip_test_if_no_block_sc,
unprivileged_client,
namespace,
cirros_dv_with_block_volume_mode,
fedora_dv_with_block_volume_mode,
storage_class_with_filesystem_volume_mode,
default_fs_overhead,
):
create_vm_from_clone_dv_template(
vm_name="vm-5608",
dv_name="dv-5608",
namespace_name=namespace.name,
source_dv=cirros_dv_with_block_volume_mode,
source_dv=fedora_dv_with_block_volume_mode,
client=unprivileged_client,
volume_mode=DataVolume.VolumeMode.FILE,
# add fs overhead and round up the result
size=overhead_size_for_dv(
image_size=int(cirros_dv_with_block_volume_mode.size[:-2]),
image_size=int(fedora_dv_with_block_volume_mode.size[:-2]),
overhead_value=default_fs_overhead,
),
storage_class=storage_class_with_filesystem_volume_mode,
Expand Down
13 changes: 6 additions & 7 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.