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

bz:2294723, test to update placement from spread to mirror of multiregion bucketclass #10631

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Changes from 1 commit
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
38 changes: 38 additions & 0 deletions tests/functional/object/mcg/test_multi_region.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
red_squad,
runs_on_provider,
mcg,
tier2,
)
from ocs_ci.framework.testlib import MCGTest
from ocs_ci.ocs import ocp, constants
from ocs_ci.ocs.bucket_utils import (
sync_object_directory,
verify_s3_object_integrity,
Expand Down Expand Up @@ -176,3 +178,39 @@ def test_multiregion_mirror(
mcg_obj.check_backingstore_state(
"backing-store-" + backingstore2.name, BS_OPTIMAL
)

@tier2
@bugzilla("2294723")
@skipif_ocs_version("<4.17")
@pytest.mark.polarion_id("OCS-6249")
def test_multiregion_spread_to_mirror(
self,
bucket_factory,
):
"""
Test to update and validate placement policy from spread to mirror of multi-region bucket class
"""

bucket_class = {
"interface": "OC",
"backingstore_dict": {"aws": [(1, "us-west-1"), (1, "us-east-2")]},
"placement_policy": "Spread",
}
# Create backing store, bucket class along with a bucket with "Spread" placement policy
bucket = bucket_factory(1, "OC", bucketclass=bucket_class)[0]
bucketclass_obj = ocp.OCP(
kind=constants.BUCKETCLASS,
namespace=constants.DEFAULT_NAMESPACE,
resource_name=bucket.bucketclass.name,
)
# Patch bucket class to update placement from "Spread" to "Mirror"
params = '[{"op": "replace", "path": "/spec/placementPolicy/tiers/0/placement", "value": "Mirror"}]'
bucketclass_obj.patch(params=params, format_type="json")
bucketclass_obj.reload_data()
# Validate "Mirror" placement policy is applied and status of bucket class
assert (
bucketclass_obj.data["spec"]["placementPolicy"]["tiers"][0]["placement"]
== "Mirror"
), f"Failed Mirror policy is not updated in {bucket.bucketclass.name}"
bucketclass_obj._has_phase = True
bucketclass_obj.wait_for_phase(phase=constants.STATUS_READY, timeout=180)
Loading