Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
33 changes: 18 additions & 15 deletions features/networking/operator.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ Feature: Operator related networking scenarios
Given the master version >= "4.0"
#Getting OCP version
Given evaluation of `cluster_version('version').version` is stored in the :ocp_version clipboard
#Making sure that operator is not Failing before proceesing further steps
And evaluation of `cluster_operator('network').condition(type: 'Failing')` is stored in the :failing_status_before_patch clipboard
Then the expression should be true> cb.failing_status_before_patch["status"]=="False"
#Making sure that operator is not Degraded before proceesing further steps
And evaluation of `cluster_operator('network').condition(type: 'Degraded')` is stored in the :degraded_status_before_patch clipboard
Then the expression should be true> cb.Degraded_status_before_patch["status"]=="False"
#Making sure that operator is not Degraded before proceesing further steps
And evaluation of `cluster_operator('network').condition(type: 'Degraded')` is stored in the :degraded_status_before_patch clipboard
Then the expression should be true> cb.Degraded_status_before_patch["status"]=="False"
#Editing networks.config.openshift.io cluster to reflect bad config like changing networktype from OpenShiftSDN to OpenShift
When I run the :patch admin command with:
| resource | networks.config.openshift.io |
Expand All @@ -34,7 +37,7 @@ Feature: Operator related networking scenarios
| type | merge |
Then the step should succeed

#Registering clean-up steps to move networkType back to OpenShiftSDN and to check Failing status is False before test exits
#Registering clean-up steps to move networkType back to OpenShiftSDN and to check Degraded status is False before test exits
Given I register clean-up steps:
"""
When I run the :patch admin command with:
Expand All @@ -44,13 +47,13 @@ Feature: Operator related networking scenarios
| type | merge |
Then the step should succeed
20 seconds have passed
evaluation of `cluster_operator('network').condition(type: 'Failing',cached: false)` is stored in the :failing_status clipboard
the expression should be true> cb.failing_status["status"]=="False"
evaluation of `cluster_operator('network').condition(type: 'Degraded',cached: false)` is stored in the :degraded_status clipboard
the expression should be true> cb.degraded_status["status"]=="False"
"""
#Normally it takes 5-10 seconds for network config update to reconcile across the cluster but taking 20 seconds wait to make sure that Failing status becomes True post bad patch
#Normally it takes 5-10 seconds for network config update to reconcile across the cluster but taking 20 seconds wait to make sure that Degraded status becomes True post bad patch
Given 20 seconds have passed
And evaluation of `cluster_operator('network').condition(type: 'Failing',cached: false)` is stored in the :failing_status_post_patch clipboard
Then the expression should be true> cb.failing_status_post_patch["status"]=="True"
And evaluation of `cluster_operator('network').condition(type: 'Degraded',cached: false)` is stored in the :degraded_status_post_patch clipboard
Then the expression should be true> cb.degraded_status_post_patch["status"]=="True"
And the expression should be true> cluster_operator('network').version_exists?(version: cb.ocp_version)

# @author bmeng@redhat.com
Expand All @@ -60,9 +63,9 @@ Feature: Operator related networking scenarios
Given the master version >= "4.0"
# Check the operator object has version
Given the expression should be true> cluster_operator('network').versions.length > 0
# Check the operator object has status for Failing|Progressing|Available
# Check the operator object has status for Degraded|Progressing|Available
And the expression should be true> cluster_operator('network').condition(type: 'Available')['status'] == "True"
And the expression should be true> cluster_operator('network').condition(type: 'Failing')['status'] == "False"
And the expression should be true> cluster_operator('network').condition(type: 'Degraded')['status'] == "False"
And the expression should be true> cluster_operator('network').condition(type: 'Progressing')['status'] == "False"


Expand All @@ -72,8 +75,8 @@ Feature: Operator related networking scenarios
@destructive
Scenario: The clusteroperator should be able to reflect the realtime status of the network when the config has problem
Given the master version >= "4.0"
# Check that the operator is not failing
Given the expression should be true> cluster_operator('network').condition(type: 'Failing')['status'] == "False"
# Check that the operator is not Degraded
Given the expression should be true> cluster_operator('network').condition(type: 'Degraded')['status'] == "False"
# Copy the value of the networktype for backup
When I run the :get admin command with:
| resource | network.config.openshift.io |
Expand All @@ -100,7 +103,7 @@ Feature: Operator related networking scenarios
# Check that the operator status reflect the problem
Given I wait up to 10 seconds for the steps to pass:
"""
Given the status of condition "Failing" for network operator is :True
Given the status of condition "Degraded" for network operator is :True
And the status of condition "Available" for network operator is :True
"""
# Change the network.config.openshift.io back
Expand All @@ -113,7 +116,7 @@ Feature: Operator related networking scenarios
# Check that the operator status
Given I wait up to 20 seconds for the steps to pass:
"""
Given the status of condition "Failing" for network operator is :False
Given the status of condition "Degraded" for network operator is :False
And the status of condition "Available" for network operator is :True
"""

Expand Down
4 changes: 2 additions & 2 deletions features/step_definitions/networking.rb
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,8 @@
elsif type == "Progressing"
@result = admin.cli_exec(:get, resource: "clusteroperators", resource_name: "network", o: "jsonpath={.status.conditions[?(.type == \"Progressing\")].status}")
real_status = @result[:response]
elsif type == "Failing"
@result = admin.cli_exec(:get, resource: "clusteroperators", resource_name: "network", o: "jsonpath={.status.conditions[?(.type == \"Failing\")].status}")
elsif type == "Degraded"
@result = admin.cli_exec(:get, resource: "clusteroperators", resource_name: "network", o: "jsonpath={.status.conditions[?(.type == \"Degraded\")].status}")
real_status = @result[:response]
else
raise "Unknown condition type!"
Expand Down