Skip to content

Commit

Permalink
code fix and verification
Browse files Browse the repository at this point in the history
Signed-off-by: am-agrawa <amagrawa@redhat.com>
  • Loading branch information
am-agrawa committed May 9, 2024
1 parent 5148e18 commit d440f81
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
25 changes: 19 additions & 6 deletions ocs_ci/ocs/dr/dr_workload.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,16 @@ def deploy_workload(self):
]["matchExpressions"][0]["values"][0] = self.preferred_primary_cluster
if self.appset_model == "pull":
# load appset_yaml_file
app_set_yaml_data["template"]["metadata"] = "annotations:"
app_set_yaml_data["template"]["metadata"]["annotations:"][0] = (
app_set_yaml_data["spec"]["template"]["metadata"]["annotations"][
0
] = (
"apps.open-cluster-management.io/ocm"
"-managed-cluster: '{{name}}'"
)
app_set_yaml_data["template"]["metadata"]["annotations:"][1] = (
"argocd.argoproj.io/skip-reconcile: " "'true'"
)
app_set_yaml_data["template"]["metadata"]["labels"][
app_set_yaml_data["spec"]["template"]["metadata"]["annotations"][
1
] = "argocd.argoproj.io/skip-reconcile: 'true'"
app_set_yaml_data["spec"]["template"]["metadata"]["labels"][
1
] = "apps.open-cluster-management.io/pull-to-ocm-managed-cluster: 'true'"
log.info(app_set_yaml_data_list)
Expand Down Expand Up @@ -446,6 +447,18 @@ def verify_workload_deployment(self):

self.check_pod_pvc_status(skip_replication_resources=False)

appset_resource_name = (
self._get_applicaionset_name() + self.preferred_primary_cluster
)

if self.appset_model == "pull":
appset_pull_obj = ocp.OCP(
kind=constants.APPLICATION_ARGOCD,
resource_name=appset_resource_name,
namespace=constants.GITOPS_CLUSTER_NAMESPACE,
)
appset_pull_obj.wait_for_phase(phase="Succeeded", timeout=60)

def check_pod_pvc_status(self, skip_replication_resources=False):
"""
Check for Pod and PVC status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from ocs_ci.ocs.resources.drpc import DRPC
from ocs_ci.ocs.resources.pod import wait_for_pods_to_be_running
from ocs_ci.ocs.utils import get_active_acm_index
from ocs_ci.utility.utils import ceph_health_check, TimeoutSampler
from ocs_ci.utility.utils import ceph_health_check, TimeoutSampler, skipif_ocs_version

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -54,14 +54,14 @@ class TestFailoverAndRelocate:
pytest.param(
constants.SUBSCRIPTION,
False,
"none",
None,
marks=pytest.mark.polarion_id(polarion_id_primary_up),
id="primary_up_subscription",
),
pytest.param(
constants.SUBSCRIPTION,
True,
"none",
None,
marks=pytest.mark.polarion_id(polarion_id_primary_down),
id="primary_down_subscription",
),
Expand All @@ -76,7 +76,10 @@ class TestFailoverAndRelocate:
constants.APPLICATION_SET,
False,
"pull",
marks=pytest.mark.polarion_id(polarion_id_primary_up_appset_pull),
marks=[
pytest.mark.polarion_id(polarion_id_primary_up_appset_pull),
skipif_ocs_version("<4.16"),
],
id="primary_up_appset",
),
pytest.param(
Expand All @@ -90,7 +93,10 @@ class TestFailoverAndRelocate:
constants.APPLICATION_SET,
True,
"pull",
marks=pytest.mark.polarion_id(polarion_id_primary_down_appset_pull),
marks=[
pytest.mark.polarion_id(polarion_id_primary_down_appset_pull),
skipif_ocs_version("<4.16"),
],
id="primary_down_appset",
),
],
Expand Down

0 comments on commit d440f81

Please sign in to comment.