Skip to content

Commit

Permalink
add dynamic noobaa sc name (#11016)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Osypenko <[email protected]>
  • Loading branch information
DanielOsypenko authored Dec 11, 2024
1 parent db8c523 commit f2e6061
Showing 1 changed file with 43 additions and 32 deletions.
75 changes: 43 additions & 32 deletions tests/functional/object/mcg/ui/test_mcg_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
)
from ocs_ci.ocs.ui.page_objects.object_buckets_tab import ObjectBucketsTab
from ocs_ci.ocs.ui.page_objects.page_navigator import PageNavigator
from ocs_ci.ocs.scale_noobaa_lib import fetch_noobaa_storage_class_name


logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -281,6 +283,43 @@ def test_namespace_bc_creation_and_deletion(
assert test_bc.check_resource_existence(should_exist=False)


def generate_test_params():
"""
Generate test parameters for the test_obc_creation_and_deletion - helper function to reuse fixture in parametrize
"""

noobaa_sc = fetch_noobaa_storage_class_name().decode("utf-8")
return [
pytest.param(
*[
noobaa_sc,
"noobaa-default-bucket-class",
"three_dots",
True,
],
marks=[pytest.mark.polarion_id("OCS-4698"), mcg],
),
pytest.param(
*[
noobaa_sc,
"noobaa-default-bucket-class",
"Actions",
True,
],
marks=[pytest.mark.polarion_id("OCS-2542"), mcg],
),
pytest.param(
*[
"ocs-storagecluster-ceph-rgw",
None,
"three_dots",
True,
],
marks=[pytest.mark.polarion_id("OCS-4845"), on_prem_platform_required],
),
]


@skipif_disconnected_cluster
@black_squad
@runs_on_provider
Expand All @@ -299,43 +338,15 @@ def teardown(self):
resource_name=obc_name
)

@pytest.mark.parametrize(
argnames=["storageclass", "bucketclass", "delete_via", "verify_ob_removal"],
argvalues=generate_test_params(),
)
@provider_mode
@ui
@tier1
@runs_on_provider
@bugzilla("2097772")
@pytest.mark.parametrize(
argnames=["storageclass", "bucketclass", "delete_via", "verify_ob_removal"],
argvalues=[
pytest.param(
*[
"openshift-storage.noobaa.io",
"noobaa-default-bucket-class",
"three_dots",
True,
],
marks=[pytest.mark.polarion_id("OCS-4698"), mcg],
),
pytest.param(
*[
"openshift-storage.noobaa.io",
"noobaa-default-bucket-class",
"Actions",
True,
],
marks=[pytest.mark.polarion_id("OCS-2542"), mcg],
),
pytest.param(
*[
"ocs-storagecluster-ceph-rgw",
None,
"three_dots",
True,
],
marks=[pytest.mark.polarion_id("OCS-4845"), on_prem_platform_required],
),
],
)
def test_obc_creation_and_deletion(
self,
setup_ui_class_factory,
Expand Down

0 comments on commit f2e6061

Please sign in to comment.