@@ -46,8 +46,8 @@ var BackendTLSPolicySANValidation = suite.ConformanceTest{
46
46
Manifests : []string {"tests/backendtlspolicy-san.yaml" },
47
47
Test : func (t * testing.T , suite * suite.ConformanceTestSuite ) {
48
48
ns := "gateway-conformance-infra"
49
- routeNN := types.NamespacedName {Name : "route- backendtlspolicy-san-test" , Namespace : ns }
50
- gwNN := types.NamespacedName {Name : "gateway-backendtlspolicy " , Namespace : ns }
49
+ routeNN := types.NamespacedName {Name : "backendtlspolicy-san-test" , Namespace : ns }
50
+ gwNN := types.NamespacedName {Name : "same-namespace " , Namespace : ns }
51
51
52
52
kubernetes .NamespacesMustBeReady (t , suite .Client , suite .TimeoutConfig , []string {ns })
53
53
gwAddr := kubernetes .GatewayAndRoutesMustBeAccepted (t , suite .Client , suite .TimeoutConfig , suite .ControllerName , kubernetes .NewGatewayRef (gwNN ), & gatewayv1.HTTPRoute {}, false , routeNN )
@@ -63,98 +63,98 @@ var BackendTLSPolicySANValidation = suite.ConformanceTest{
63
63
64
64
// Verify that the request sent to Service with valid BackendTLSPolicy containing dns SAN should succeed.
65
65
t .Run ("HTTP request sent to Service with valid BackendTLSPolicy containing dns SAN should succeed" , func (t * testing.T ) {
66
- policyNN := types.NamespacedName {Name : "backendtlspolicy- san-dns" , Namespace : ns }
66
+ policyNN := types.NamespacedName {Name : "san-dns" , Namespace : ns }
67
67
kubernetes .BackendTLSPolicyMustHaveCondition (t , suite .Client , suite .TimeoutConfig , policyNN , gwNN , policyCond )
68
68
69
69
h .MakeRequestAndExpectEventuallyConsistentResponse (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr ,
70
70
h.ExpectedResponse {
71
71
Namespace : ns ,
72
72
Request : h.Request {
73
73
Host : serverStr ,
74
- Path : "/backendTLSSanDns " ,
74
+ Path : "/backendtlspolicy-san-dns " ,
75
75
SNI : serverStr ,
76
76
},
77
- Response : h.Response {StatusCode : 200 },
77
+ Response : h.Response {StatusCodes : [] int { 200 } },
78
78
})
79
79
})
80
80
81
81
// Verify that the request sent to a Service targeted by a BackendTLSPolicy with mismatched dns SAN should fail.
82
82
t .Run ("HTTP request sent to Service targeted by BackendTLSPolicy with mismatched dns SAN should return an HTTP error" , func (t * testing.T ) {
83
- policyNN := types.NamespacedName {Name : "backendtlspolicy- san-dns-mismatch" , Namespace : ns }
83
+ policyNN := types.NamespacedName {Name : "san-dns-mismatch" , Namespace : ns }
84
84
kubernetes .BackendTLSPolicyMustHaveCondition (t , suite .Client , suite .TimeoutConfig , policyNN , gwNN , policyCond )
85
85
86
86
h .MakeRequestAndExpectFailure (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr ,
87
87
h.ExpectedResponse {
88
88
Namespace : ns ,
89
89
Request : h.Request {
90
90
Host : serverStr ,
91
- Path : "/backendTLSSanDnsMismatch " ,
91
+ Path : "/backendtlspolicy-san-dns-mismatch " ,
92
92
SNI : serverStr ,
93
93
},
94
94
})
95
95
})
96
96
97
97
// Verify that the request sent to Service with valid BackendTLSPolicy containing uri SAN should succeed.
98
98
t .Run ("HTTP request sent to Service with valid BackendTLSPolicy containing uri SAN should succeed" , func (t * testing.T ) {
99
- policyNN := types.NamespacedName {Name : "backendtlspolicy- san-uri" , Namespace : ns }
99
+ policyNN := types.NamespacedName {Name : "san-uri" , Namespace : ns }
100
100
kubernetes .BackendTLSPolicyMustHaveCondition (t , suite .Client , suite .TimeoutConfig , policyNN , gwNN , policyCond )
101
101
102
102
h .MakeRequestAndExpectEventuallyConsistentResponse (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr ,
103
103
h.ExpectedResponse {
104
104
Namespace : ns ,
105
105
Request : h.Request {
106
106
Host : serverStr ,
107
- Path : "/backendTLSSanUri " ,
107
+ Path : "/backendtlspolicy-san-uri " ,
108
108
SNI : serverStr ,
109
109
},
110
- Response : h.Response {StatusCode : 200 },
110
+ Response : h.Response {StatusCodes : [] int { 200 } },
111
111
})
112
112
})
113
113
114
114
// Verify that the request sent to a Service targeted by a BackendTLSPolicy with mismatched uri SAN should fail.
115
115
t .Run ("HTTP request sent to Service targeted by BackendTLSPolicy with mismatched uri SAN should return an HTTP error" , func (t * testing.T ) {
116
- policyNN := types.NamespacedName {Name : "backendtlspolicy- san-uri-mismatch" , Namespace : ns }
116
+ policyNN := types.NamespacedName {Name : "san-uri-mismatch" , Namespace : ns }
117
117
kubernetes .BackendTLSPolicyMustHaveCondition (t , suite .Client , suite .TimeoutConfig , policyNN , gwNN , policyCond )
118
118
119
119
h .MakeRequestAndExpectFailure (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr ,
120
120
h.ExpectedResponse {
121
121
Namespace : ns ,
122
122
Request : h.Request {
123
123
Host : serverStr ,
124
- Path : "/backendTLSSanUriMismatch " ,
124
+ Path : "/backendtlspolicy-san-uri-mismatch " ,
125
125
SNI : serverStr ,
126
126
},
127
127
})
128
128
})
129
129
130
130
// Verify that the request sent to Service with valid BackendTLSPolicy containing multi SANs should succeed.
131
131
t .Run ("HTTP request sent to Service with valid BackendTLSPolicy containing multi SAN should succeed" , func (t * testing.T ) {
132
- policyNN := types.NamespacedName {Name : "backendtlspolicy- multiple-sans" , Namespace : ns }
132
+ policyNN := types.NamespacedName {Name : "multiple-sans" , Namespace : ns }
133
133
kubernetes .BackendTLSPolicyMustHaveCondition (t , suite .Client , suite .TimeoutConfig , policyNN , gwNN , policyCond )
134
134
135
135
h .MakeRequestAndExpectEventuallyConsistentResponse (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr ,
136
136
h.ExpectedResponse {
137
137
Namespace : ns ,
138
138
Request : h.Request {
139
139
Host : serverStr ,
140
- Path : "/backendTLSMultiSans " ,
140
+ Path : "/backendtlspolicy-multiple-sans " ,
141
141
SNI : serverStr ,
142
142
},
143
- Response : h.Response {StatusCode : 200 },
143
+ Response : h.Response {StatusCodes : [] int { 200 } },
144
144
})
145
145
})
146
146
147
147
// Verify that the request sent to a Service targeted by a BackendTLSPolicy with mismatched multi SAN should fail.
148
148
t .Run ("HTTP request sent to Service targeted by BackendTLSPolicy with mismatched multi SAN should return an HTTP error" , func (t * testing.T ) {
149
- policyNN := types.NamespacedName {Name : "backendtlspolicy- multiple-mismatch-sans" , Namespace : ns }
149
+ policyNN := types.NamespacedName {Name : "multiple-mismatch-sans" , Namespace : ns }
150
150
kubernetes .BackendTLSPolicyMustHaveCondition (t , suite .Client , suite .TimeoutConfig , policyNN , gwNN , policyCond )
151
151
152
152
h .MakeRequestAndExpectFailure (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr ,
153
153
h.ExpectedResponse {
154
154
Namespace : ns ,
155
155
Request : h.Request {
156
156
Host : serverStr ,
157
- Path : "/backendTLSMultiMismatchSans " ,
157
+ Path : "/backendtlspolicy-multiple-mismatch-sans " ,
158
158
SNI : serverStr ,
159
159
},
160
160
})
0 commit comments