diff --git a/benchmark_runner/common/oc/oc.py b/benchmark_runner/common/oc/oc.py index 0b4392a01..14baf0eb0 100644 --- a/benchmark_runner/common/oc/oc.py +++ b/benchmark_runner/common/oc/oc.py @@ -244,13 +244,14 @@ def wait_for_dv_status(self, current_wait_time += OC.SLEEP_TIME raise DVStatusTimeout(status=status) - def verify_odf_installation(self): + def verify_odf_installation(self, namespace='openshift-storage'): """ This method verifies ODF installation :return: True ODF passed, False failed """ - self.run(""" oc patch storagecluster ocs-storagecluster -n openshift-storage --type json --patch '[{ "op": "replace", "path": "/spec/enableCephTools", "value": true }]' """) - rook_ceph_tools_pod = self._get_pod_name(pod_name='rook-ceph-tools', namespace='openshift-storage') + self.run(f"oc patch storagecluster ocs-storagecluster -n {namespace} --type json --patch '[{{ \"op\": \"replace\", \"path\": \"/spec/enableCephTools\", \"value\": true }}]'") + rook_ceph_tools_pod = self._get_pod_name(pod_name='rook-ceph-tools', namespace=namespace) + self.wait_for_pod_create(pod_name=rook_ceph_tools_pod, namespace=namespace, timeout=self.timeout) result = self.run(f"oc -n openshift-storage rsh {rook_ceph_tools_pod} ceph health") return 'HEALTH_OK' == result.strip() diff --git a/benchmark_runner/common/ocp_resources/create_ocp_resource_operations.py b/benchmark_runner/common/ocp_resources/create_ocp_resource_operations.py index dd40b1035..6bf2b6c7c 100644 --- a/benchmark_runner/common/ocp_resources/create_ocp_resource_operations.py +++ b/benchmark_runner/common/ocp_resources/create_ocp_resource_operations.py @@ -93,12 +93,12 @@ def apply_patch(self, namespace: str, resource: str): check_approved = f"oc get InstallPlan -n {namespace} {name} -ojsonpath={{..spec.approved}}" approved = self.__oc.run(cmd=check_approved) # APPROVED false - need to patch - if not approved: + if not {'true': True, 'false': False}.get(approved.lower(), False): install_plan_cmd = (f"oc patch InstallPlan -n {namespace} {name} -p '{{\"spec\":{{\"approved\":true}}}}' --type merge") self.__oc.run(cmd=install_plan_cmd) # verify current status result = self.__oc.run(cmd=check_approved) - if result == 'true': + if {'true': True, 'false': False}.get(result.lower(), False): if resource == 'odf': # Check status for each CSV name csv_names = self.__oc.run(f"oc get csv -n {namespace} -ojsonpath={{$.items[*].metadata.name}}")