Skip to content

Commit

Permalink
adding new test cases for replica2 vs replica3 clone and restore
Browse files Browse the repository at this point in the history
Signed-off-by: Yulia Persky <[email protected]>
  • Loading branch information
ypersky1980 committed Jul 1, 2024
1 parent f011aa0 commit a6c2a95
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions tests/functional/storageclass/test_cross_sc_clone_snap_restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,21 @@ def test_cross_class_same_pool_clone_snap_restore(
restore_pvc_obj2.delete()

@pytest.mark.parametrize(
argnames="interface_type",
argnames=["interface_type", "replica1", "replica2"],
argvalues=[
pytest.param(*[constants.CEPHBLOCKPOOL]),
pytest.param(*[constants.CEPHFILESYSTEM]),
pytest.param(*[constants.CEPHBLOCKPOOL], "", ""),
pytest.param(*[constants.CEPHFILESYSTEM], "", ""),
pytest.param(*[constants.CEPHBLOCKPOOL], 3, 2),
pytest.param(*[constants.CEPHFILESYSTEM], 3, 2),
pytest.param(*[constants.CEPHBLOCKPOOL], 2, 3),
pytest.param(*[constants.CEPHFILESYSTEM], 2, 3),
],
)
def test_cross_class_different_pool_clone_snap_restore(
self,
interface_type,
replica1,
replica2,
storageclass_factory,
pvc_factory,
pod_factory,
Expand All @@ -154,7 +160,10 @@ def test_cross_class_different_pool_clone_snap_restore(
"""

# Create a Storage Class on default pool
sc_obj1 = storageclass_factory(interface=interface_type)
if replica1 == "":
sc_obj1 = storageclass_factory(interface=interface_type)
else:
sc_obj1 = storageclass_factory(interface=interface_type, replica=replica1)
pool_name1 = run_cmd(
f"oc get sc {sc_obj1.name} -o jsonpath={{'.parameters.pool'}}"
)
Expand All @@ -166,7 +175,12 @@ def test_cross_class_different_pool_clone_snap_restore(
)

# Create a Storage Class on another pool
sc_obj2 = storageclass_factory(interface=interface_type, new_rbd_pool=True)
if replica2 == "":
sc_obj2 = storageclass_factory(interface=interface_type, new_rbd_pool=True)
else:
sc_obj2 = storageclass_factory(
interface=interface_type, replica=replica2, new_rbd_pool=True
)
pool_name2 = run_cmd(
f"oc get sc {sc_obj2.name} -o jsonpath={{'.parameters.pool'}}"
)
Expand Down

0 comments on commit a6c2a95

Please sign in to comment.