Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-4.17] test_obc_creation_and_deletion add dynamic noobaa sc name #11037

Open
wants to merge 1 commit into
base: release-4.17
Choose a base branch
from
Open
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
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
Loading