@@ -25,10 +25,9 @@ var BackendTLSTest = suite.ConformanceTest{
25
25
Description : "Connect to backend with TLS" ,
26
26
Manifests : []string {"testdata/backend-tls.yaml" },
27
27
Test : func (t * testing.T , suite * suite.ConformanceTestSuite ) {
28
+ gwNN := types.NamespacedName {Name : "same-namespace" , Namespace : ConformanceInfraNamespace }
28
29
t .Run ("with a backend TLS Policy" , func (t * testing.T ) {
29
- ns := "gateway-conformance-infra"
30
- routeNN := types.NamespacedName {Name : "http-with-backend-tls" , Namespace : ns }
31
- gwNN := types.NamespacedName {Name : "same-namespace" , Namespace : ns }
30
+ routeNN := types.NamespacedName {Name : "http-with-backend-tls" , Namespace : ConformanceInfraNamespace }
32
31
gwAddr := kubernetes .GatewayAndHTTPRoutesMustBeAccepted (t , suite .Client , suite .TimeoutConfig , suite .ControllerName , kubernetes .NewGatewayRef (gwNN ), routeNN )
33
32
34
33
expectedResponse := http.ExpectedResponse {
@@ -38,7 +37,7 @@ var BackendTLSTest = suite.ConformanceTest{
38
37
Response : http.Response {
39
38
StatusCode : 200 ,
40
39
},
41
- Namespace : ns ,
40
+ Namespace : ConformanceInfraNamespace ,
42
41
}
43
42
44
43
http .MakeRequestAndExpectEventuallyConsistentResponse (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr , expectedResponse )
@@ -49,9 +48,7 @@ var BackendTLSTest = suite.ConformanceTest{
49
48
if IPFamily == "ipv6" {
50
49
t .Skip ("Skipping test as IP_FAMILY is IPv6" )
51
50
}
52
- ns := "gateway-conformance-infra"
53
- routeNN := types.NamespacedName {Name : "http-with-backend-tls-system-trust-store" , Namespace : ns }
54
- gwNN := types.NamespacedName {Name : "same-namespace" , Namespace : ns }
51
+ routeNN := types.NamespacedName {Name : "http-with-backend-tls-system-trust-store" , Namespace : ConformanceInfraNamespace }
55
52
gwAddr := kubernetes .GatewayAndHTTPRoutesMustBeAccepted (t , suite .Client , suite .TimeoutConfig , suite .ControllerName , kubernetes .NewGatewayRef (gwNN ), routeNN )
56
53
57
54
expectedResponse := http.ExpectedResponse {
@@ -73,9 +70,7 @@ var BackendTLSTest = suite.ConformanceTest{
73
70
})
74
71
75
72
t .Run ("without a backend TLS Policy" , func (t * testing.T ) {
76
- ns := "gateway-conformance-infra"
77
- routeNN := types.NamespacedName {Name : "http-without-backend-tls" , Namespace : ns }
78
- gwNN := types.NamespacedName {Name : "same-namespace" , Namespace : ns }
73
+ routeNN := types.NamespacedName {Name : "http-without-backend-tls" , Namespace : ConformanceInfraNamespace }
79
74
gwAddr := kubernetes .GatewayAndHTTPRoutesMustBeAccepted (t , suite .Client , suite .TimeoutConfig , suite .ControllerName , kubernetes .NewGatewayRef (gwNN ), routeNN )
80
75
81
76
expectedResponse := http.ExpectedResponse {
@@ -85,16 +80,14 @@ var BackendTLSTest = suite.ConformanceTest{
85
80
Response : http.Response {
86
81
StatusCode : 400 , // Bad Request: Client sent an HTTP request to an HTTPS server
87
82
},
88
- Namespace : ns ,
83
+ Namespace : ConformanceInfraNamespace ,
89
84
}
90
85
91
86
http .MakeRequestAndExpectEventuallyConsistentResponse (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr , expectedResponse )
92
87
})
93
88
94
89
t .Run ("with CA mismatch and skip tls verify" , func (t * testing.T ) {
95
- ns := "gateway-conformance-infra"
96
- routeNN := types.NamespacedName {Name : "http-with-backend-insecure-skip-verify" , Namespace : ns }
97
- gwNN := types.NamespacedName {Name : "same-namespace" , Namespace : ns }
90
+ routeNN := types.NamespacedName {Name : "http-with-backend-insecure-skip-verify" , Namespace : ConformanceInfraNamespace }
98
91
gwAddr := kubernetes .GatewayAndHTTPRoutesMustBeAccepted (t , suite .Client , suite .TimeoutConfig , suite .ControllerName , kubernetes .NewGatewayRef (gwNN ), routeNN )
99
92
100
93
expectedResponse := http.ExpectedResponse {
@@ -104,26 +97,24 @@ var BackendTLSTest = suite.ConformanceTest{
104
97
Response : http.Response {
105
98
StatusCode : 200 , // Bad Request: Client sent an HTTP request to an HTTPS server
106
99
},
107
- Namespace : ns ,
100
+ Namespace : ConformanceInfraNamespace ,
108
101
}
109
102
110
103
http .MakeRequestAndExpectEventuallyConsistentResponse (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr , expectedResponse )
111
104
})
112
105
113
106
t .Run ("with ClusterTrustBundle" , func (t * testing.T ) {
114
- ns := "gateway-conformance-infra"
115
- routeNN := types.NamespacedName {Name : "http-with-backend-tls" , Namespace : ns }
116
- gwNN := types.NamespacedName {Name : "same-namespace" , Namespace : ns }
107
+ routeNN := types.NamespacedName {Name : "http-with-backend-tls-trust-bundle" , Namespace : ConformanceInfraNamespace }
117
108
gwAddr := kubernetes .GatewayAndHTTPRoutesMustBeAccepted (t , suite .Client , suite .TimeoutConfig , suite .ControllerName , kubernetes .NewGatewayRef (gwNN ), routeNN )
118
109
119
110
expectedResponse := http.ExpectedResponse {
120
111
Request : http.Request {
121
- Path : "/backend-tls " ,
112
+ Path : "/cluster-trust-bundle " ,
122
113
},
123
114
Response : http.Response {
124
115
StatusCode : 200 ,
125
116
},
126
- Namespace : ns ,
117
+ Namespace : ConformanceInfraNamespace ,
127
118
}
128
119
129
120
http .MakeRequestAndExpectEventuallyConsistentResponse (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr , expectedResponse )
0 commit comments