Skip to content

Commit 9a5ae51

Browse files
asanzgomCFSNM
authored andcommitted
Chore: Added sleep and timeout for while loop (red-hat-data-services#2029)
* Added sleep and timeout for while loop * Added If else structure for Gettting Resource Attribute Kw for when value comes empty
1 parent c2f1af4 commit 9a5ae51

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

ods_ci/tests/Resources/OCP.resource

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,5 +290,9 @@ Get Resource Attribute
290290
${rc} ${value}= Run And Return Rc And Output
291291
... oc get ${resource_type}/${resource_name} -n ${namespace} -o 'jsonpath={${attribute_path}}'
292292
Should Be Equal "${rc}" "0" msg=${value}
293-
Log To Console ${resource_type} ${resource_name} in the namespace ${namespace} attribute ${attribute_path} value is ${value}
293+
IF "${value}" != "${EMPTY}"
294+
Log To Console ${resource_type} ${resource_name} in the namespace ${namespace} attribute ${attribute_path} value is ${value}
295+
ELSE
296+
Log To Console ${resource_type} ${resource_name} in the namespace ${namespace} attribute ${attribute_path} value is EMPTY
297+
END
294298
RETURN ${value}

ods_ci/tests/Resources/Page/Operators/ISVs.resource

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ${FILES_RESOURCES_DIRPATH}= tests/Resources/Files
1010
${SUBSCRIPTION_YAML_TEMPLATE_FILEPATH}= ${FILES_RESOURCES_DIRPATH}/isv-operator-subscription.yaml
1111
${OPERATORGROUP_YAML_TEMPLATE_FILEPATH}= ${FILES_RESOURCES_DIRPATH}/isv-operator-group.yaml
1212
${IS_PRESENT}= 0
13+
${installplan_name} ${EMPTY}
1314

1415

1516
*** Keywords ***
@@ -19,6 +20,7 @@ Install ISV Operator From OperatorHub Via CLI # robocop: disable
1920
... ${channel}=stable ${catalog_source_name}=certified-operators
2021
... ${cs_namespace}=openshift-marketplace ${operator_group_name}=${NONE}
2122
... ${operator_group_ns}=${NONE} ${operator_group_target_ns}=${NONE}
23+
[Timeout] 10 minutes
2224
Log To Console message=Installing the '${operator_name}' Operator
2325
IF "${operator_group_name}" != "${NONE}"
2426
Create Operator Group name=${operator_group_name}
@@ -36,9 +38,11 @@ Install ISV Operator From OperatorHub Via CLI # robocop: disable
3638
Oc Apply kind=Subscription src=${operator_sub_filepath}
3739
Wait Until Keyword Succeeds 1 min 0 sec
3840
... Is Resource Present Subscription ${subscription_name} ${namespace} ${IS_PRESENT}
39-
Sleep 30s
40-
${installplan_name}= Get Resource Attribute ${namespace}
41-
... Subscription ${subscription_name} .status.installPlanRef.name
41+
WHILE "${installplan_name}" == "${EMPTY}" limit=5m
42+
${installplan_name}= Get Resource Attribute ${namespace}
43+
... Subscription ${subscription_name} .status.installPlanRef.name
44+
Sleep 20s
45+
END
4246
${installplan_approval}= Get Resource Attribute ${namespace}
4347
... InstallPlan ${installplan_name} .spec.approval
4448
IF "${installplan_approval}" == "Manual"

0 commit comments

Comments
 (0)