@@ -22,13 +22,13 @@ import (
2222
2323 "github.com/stretchr/testify/require"
2424 "k8s.io/apimachinery/pkg/types"
25+ gwhttp "sigs.k8s.io/gateway-api/conformance/utils/http"
2526 "sigs.k8s.io/gateway-api/conformance/utils/suite"
2627 "sigs.k8s.io/gateway-api/pkg/features"
2728
2829 "sigs.k8s.io/gateway-api-inference-extension/conformance/resources"
2930 "sigs.k8s.io/gateway-api-inference-extension/conformance/utils/config"
3031 k8sutils "sigs.k8s.io/gateway-api-inference-extension/conformance/utils/kubernetes"
31- trafficutils "sigs.k8s.io/gateway-api-inference-extension/conformance/utils/traffic"
3232 "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling/framework/plugins/test"
3333)
3434
@@ -69,19 +69,24 @@ var EppUnAvailableFailOpen = suite.ConformanceTest{
6969 targetPodIP := pods [0 ].Status .PodIP
7070 t .Run ("Phase 1: Verify baseline connectivity with EPP available" , func (t * testing.T ) {
7171 t .Log ("Sending request to ensure the Gateway and EPP are working correctly..." )
72- trafficutils . MakeRequestAndExpectSuccess (
72+ gwhttp . MakeRequestAndExpectEventuallyConsistentResponse (
7373 t ,
7474 s .RoundTripper ,
7575 s .TimeoutConfig ,
7676 gwAddr ,
77- trafficutils.Request {
78- Host : hostname ,
79- Path : path ,
80- Headers : map [string ]string {
81- test .HeaderTestEppEndPointSelectionKey : targetPodIP ,
77+ gwhttp.ExpectedResponse {
78+ Request : gwhttp.Request {
79+ Host : hostname ,
80+ Path : path ,
81+ Headers : map [string ]string {
82+ test .HeaderTestEppEndPointSelectionKey : targetPodIP ,
83+ },
84+ Method : http .MethodPost ,
85+ Body : requestBody ,
86+ },
87+ Response : gwhttp.Response {
88+ StatusCodes : []int {http .StatusOK },
8289 },
83- Method : http .MethodPost ,
84- Body : requestBody ,
8590 Backend : pods [0 ].Name , // Make sure the request is from the targetPod when the EPP is alive.
8691 Namespace : resources .AppBackendNamespace ,
8792 },
@@ -96,19 +101,24 @@ var EppUnAvailableFailOpen = suite.ConformanceTest{
96101 require .NoError (t , err , "Failed to make the EPP service %v unavailable" , resources .PrimaryEppServiceNN )
97102
98103 t .Log ("Sending request again, expecting success to verify fail-open..." )
99- trafficutils . MakeRequestAndExpectSuccess (
104+ gwhttp . MakeRequestAndExpectEventuallyConsistentResponse (
100105 t ,
101106 s .RoundTripper ,
102107 s .TimeoutConfig ,
103108 gwAddr ,
104- trafficutils.Request {
105- Host : hostname ,
106- Path : path ,
107- Headers : map [string ]string {
108- test .HeaderTestEppEndPointSelectionKey : targetPodIP ,
109+ gwhttp.ExpectedResponse {
110+ Request : gwhttp.Request {
111+ Host : hostname ,
112+ Path : path ,
113+ Headers : map [string ]string {
114+ test .HeaderTestEppEndPointSelectionKey : targetPodIP ,
115+ },
116+ Method : http .MethodPost ,
117+ Body : requestBody ,
118+ },
119+ Response : gwhttp.Response {
120+ StatusCodes : []int {http .StatusOK },
109121 },
110- Method : http .MethodPost ,
111- Body : requestBody ,
112122 Backend : appPodBackendPrefix , // Only checks the prefix since the EPP is not alive and the response can return from any Pod.
113123 Namespace : resources .AppBackendNamespace ,
114124 },
0 commit comments