@annotations @router.cookie @release-1.22

Feature: Cookie rules

An Ingress may define routing rules based on the request path. If the HTTP request path matches the paths and cookie info in the Ingress objects, the traffic is routed to its backend service.

Scenarios
Status Progress

Passed

100.00%

Failed

0.00%
check_circle
Given 5s an Ingress resource in a new random namespace +Show Parameter
check_circle
And 6s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://exact-path-rules-cookie-uid/ with header +Show Parameter
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the foo-exact service
check_circle
Given 5s an Ingress resource in a new random namespace +Show Parameter
check_circle
And 6s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://exact-path-rules-cookie-uid-req-no-cookie/
check_circle
Then 0s the response status-code must be 500
check_circle
Given 10s an Ingress resource in a new random namespace +Show Parameter
check_circle
And 3s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://exact-path-rules-cookie-length0/ with header +Show Parameter
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the foo-exact-no-cookie service
check_circle
Given 10s an Ingress resource in a new random namespace +Show Parameter
check_circle
And 3s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://exact-path-rules-no-cookie/
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the foo-exact-no-cookie service
Scenario: An Ingress with path rules and cookie should send traffic to the matching backend service

(exact / and cookie "c_ref:https://www.baidu.com/link" matches request / with right cookie)

check_circle
Given 10s an Ingress resource in a new random namespace +Show Parameter
check_circle
And 6s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://exact-with-cookie-right/ with header +Show Parameter
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the exact-cookie-right service
Scenario: An Ingress with path rules and error cookie should not send traffic to the matching backend service

(exact / and cookie "c_ref:https://www.baidu.com/" not matches request / with wrong cookie)

check_circle
Given 5s an Ingress resource in a new random namespace +Show Parameter
check_circle
And 6s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://exact-with-cookie-wrong/ with header +Show Parameter
check_circle
Then 0s the response status-code must be 500
Scenario: An Ingress with path rules and cookie should not send traffic to the matching backend service

(exact / and cookie "c_ref:https://www.baidu.com/" not matches request / with no cookie)

check_circle
Given 5s an Ingress resource in a new random namespace +Show Parameter
check_circle
And 6s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://exact-with-no-cookie/
check_circle
Then 0s the response status-code must be 500
Scenario: An Ingress with path rules and multi cookie should send traffic to the matching backend service, use last config

(exact / and multi cookie "cookie_key:cookie_value" and "cookie_key1:cookie_value1" matches request / with cookie)

check_circle
Given 10s an Ingress resource in a new random namespace +Show Parameter
check_circle
And 6s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://multi-coookie-rule/ with header +Show Parameter
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the multi-cookie service