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

Adding a new test case for bucketclass NSS creation with Cache via CLI #11283

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
19 changes: 13 additions & 6 deletions ocs_ci/ocs/resources/mcg.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,18 +757,25 @@ def cli_create_bucketclass_over_namespacestores(
namespacestore.name for namespacestore in namespacestores
]
namestores_name_str = f"{','.join(namestores_name_list)}"

namespace_policy_type = namespace_policy["type"].lower()
if namespace_policy_type != constants.NAMESPACE_POLICY_TYPE_SINGLE.lower():
cmd = f"bucketclass create namespace-bucketclass {namespace_policy_type} {name}"

if namespace_policy_type == constants.NAMESPACE_POLICY_TYPE_SINGLE.lower():
cmd += f" --resource={namestores_name_str}"
self.exec_mcg_cmd(cmd)
elif namespace_policy_type == constants.NAMESPACE_POLICY_TYPE_CACHE.lower():
cmd += f" --hub-resource={namestores_name_str}"
cmd += " --backingstores=constants.DEFAULT_NOOBAA_BACKINGSTORE"
if "ttl" in namespace_policy:
cmd += f" --ttl=={namespace_policy['ttl']}"
self.exec_mcg_cmd(cmd)
else:
raise NotImplementedError(
f"Cli creating of bucketclass on namespacestore "
f"with policy {namespace_policy_type} is not implemented yet"
)

self.exec_mcg_cmd(
f"bucketclass create namespace-bucketclass {namespace_policy_type} "
f"--resource={namestores_name_str} {name}"
)

def check_if_mirroring_is_done(self, bucket_name, timeout=300):
"""
Check whether all object chunks in a bucket
Expand Down
20 changes: 19 additions & 1 deletion tests/functional/object/mcg/test_namespace_crd.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,24 @@ def deprecated_test_namespace_store_creation_crd(
marks=[
tier1,
on_prem_platform_required,
pytest.mark.polarion_id("OCS-2407"),
pytest.mark.polarion_id("OCS-6339"),
],
),
pytest.param(
{
"interface": "CLI",
"namespace_policy_dict": {
"type": "Cache",
"ttl": 300000,
"namespacestore_dict": {
"rgw": [(1, None)],
},
},
},
marks=[
tier1,
on_prem_platform_required,
pytest.mark.polarion_id("OCS-6338"),
],
),
pytest.param(
Expand Down Expand Up @@ -218,6 +235,7 @@ def deprecated_test_namespace_store_creation_crd(
"Azure-OC-Single",
"RGW-OC-Single",
"RGW-CLI-Single",
"RGW-CLI-Cache",
"IBM-OC-Single",
"AWS+Azure-OC-Multi",
"AWS+AWS-OC-Multi",
Expand Down