Skip to content

Commit

Permalink
Incorprated comments on verify part
Browse files Browse the repository at this point in the history
Signed-off-by: Avdhoot <[email protected]>
  • Loading branch information
Avdhoot authored and avd-sagare committed Jun 26, 2024
1 parent 5a509a1 commit 52e890b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 14 additions & 4 deletions ocs_ci/helpers/dr_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
run_cmd,
)
from ocs_ci.utility.utils import TimeoutSampler, CommandFailed, run_cmd
from ocs_ci.helpers.helpers import run_cmd_verify_cli_output


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -1118,9 +1119,15 @@ def disable_dr_from_app(secondary_cluster_name):

# Delete all drpc
run_cmd("oc delete drpc --all -A")

# Verify all drpc gets deleted
# ToDo
sample = TimeoutSampler(
timeout=300,
sleep=5,
func=run_cmd_verify_cli_output,
cmd="oc get drpc -A",
expected_output_lst="No resources found",
)
if not sample.wait_for_func_status(result=True):
raise Exception("All drpcs are not deleted")

# Remove annotation from placements
for placement in placements:
Expand Down Expand Up @@ -1188,7 +1195,10 @@ def replace_cluster(workload, primary_cluster_name, secondary_cluster_name):
run_cmd(cmd=f"oc delete managedcluster {primary_cluster_name}")

# Verify old primary cluster is dettached
# Todo
expected_output = primary_cluster_name
out = run_cmd(cmd=f"oc get managedcluster {primary_cluster_name}")
if expected_output not in out:
raise Exception("Old primary cluster is not dettached.")

# Import Recovery cluster
cluster_name_recoevry = import_recovery_clusters_with_acm()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ def test_replace_cluster(
down_cluster_name=self.primary_cluster_name,
expected_text="Unknown",
)
elif config.RUN.get("mdr_failover_via_ui"):
check_cluster_status_on_acm_console(acm_obj)

# Fenced the primary managed cluster
enable_fence(drcluster_name=self.primary_cluster_name)
Expand Down

0 comments on commit 52e890b

Please sign in to comment.