Skip to content

Commit 0cdbd4b

Browse files
committed
Adjust and add e2e tests for status cleanup
Signed-off-by: y-rabie <[email protected]>
1 parent 0b8d144 commit 0cdbd4b

24 files changed

+524
-64
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: gateway.envoyproxy.io/v1alpha1
2+
kind: BackendTrafficPolicy
3+
metadata:
4+
name: backendtrafficpolicy-multiple-ancestors-same-gwc
5+
namespace: gateway-conformance-infra
6+
spec:
7+
targetRefs:
8+
- group: gateway.networking.k8s.io
9+
kind: Gateway
10+
name: same-namespace
11+
# This gateway (and its gatewayclass) is created through `status-cleanup-gateway-different-gwc.yaml` manifest.
12+
- group: gateway.networking.k8s.io
13+
kind: Gateway
14+
name: gateway-2
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: gateway.envoyproxy.io/v1alpha1
2+
kind: BackendTrafficPolicy
3+
metadata:
4+
name: backendtrafficpolicy-multiple-ancestors-same-gwc
5+
namespace: gateway-conformance-infra
6+
spec:
7+
targetRefs:
8+
- group: gateway.networking.k8s.io
9+
kind: Gateway
10+
name: same-namespace
11+
- group: gateway.networking.k8s.io
12+
kind: Gateway
13+
name: all-namespaces
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: gateway.envoyproxy.io/v1alpha1
2+
kind: BackendTrafficPolicy
3+
metadata:
4+
name: backendtrafficpolicy-multiple-ancestors-same-gwc
5+
namespace: gateway-conformance-infra
6+
spec:
7+
targetRefs:
8+
- group: gateway.networking.k8s.io
9+
kind: Gateway
10+
name: non-existent-ancestor
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: gateway.envoyproxy.io/v1alpha1
2+
kind: BackendTrafficPolicy
3+
metadata:
4+
name: backendtrafficpolicy-multiple-ancestors-same-gwc
5+
namespace: gateway-conformance-infra
6+
spec:
7+
targetRefs:
8+
- group: gateway.networking.k8s.io
9+
kind: Gateway
10+
name: same-namespace
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
apiVersion: gateway.networking.k8s.io/v1beta1
2+
kind: Gateway
3+
metadata:
4+
name: gateway-1
5+
namespace: gateway-conformance-infra
6+
spec:
7+
gatewayClassName: "{GATEWAY_CLASS_NAME}"
8+
listeners:
9+
- name: foo
10+
protocol: TCP
11+
port: 8080
12+
allowedRoutes:
13+
kinds:
14+
- kind: TCPRoute
15+
---
16+
apiVersion: gateway.networking.k8s.io/v1alpha2
17+
kind: TCPRoute
18+
metadata:
19+
name: tcp-route-status-cleanup
20+
namespace: gateway-conformance-infra
21+
spec:
22+
parentRefs:
23+
- name: gateway-1
24+
sectionName: foo
25+
# This gateway (and its gatewayclass) is created through `status-cleanup-gateway-different-gwc.yaml` manifest.
26+
- name: gateway-2
27+
sectionName: foo
28+
rules:
29+
- backendRefs:
30+
- name: infra-backend-v1
31+
port: 8080
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
apiVersion: gateway.networking.k8s.io/v1beta1
2+
kind: Gateway
3+
metadata:
4+
name: gateway-1
5+
namespace: gateway-conformance-infra
6+
spec:
7+
gatewayClassName: "{GATEWAY_CLASS_NAME}"
8+
listeners:
9+
- name: foo
10+
protocol: TCP
11+
port: 8080
12+
allowedRoutes:
13+
kinds:
14+
- kind: TCPRoute
15+
---
16+
apiVersion: gateway.networking.k8s.io/v1beta1
17+
kind: Gateway
18+
metadata:
19+
name: gateway-2
20+
namespace: gateway-conformance-infra
21+
spec:
22+
gatewayClassName: "{GATEWAY_CLASS_NAME}"
23+
listeners:
24+
- name: foo
25+
protocol: TCP
26+
port: 8080
27+
allowedRoutes:
28+
kinds:
29+
- kind: TCPRoute
30+
---
31+
apiVersion: gateway.networking.k8s.io/v1alpha2
32+
kind: TCPRoute
33+
metadata:
34+
name: tcp-route-status-cleanup
35+
namespace: gateway-conformance-infra
36+
spec:
37+
parentRefs:
38+
- name: gateway-1
39+
sectionName: foo
40+
- name: gateway-2
41+
sectionName: foo
42+
rules:
43+
- backendRefs:
44+
- name: infra-backend-v1
45+
port: 8080
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: gateway.networking.k8s.io/v1alpha2
2+
kind: TCPRoute
3+
metadata:
4+
name: tcp-route-status-cleanup
5+
namespace: gateway-conformance-infra
6+
spec:
7+
parentRefs:
8+
- name: gateway-1
9+
sectionName: foo
10+
rules:
11+
- backendRefs:
12+
- name: infra-backend-v1
13+
port: 8080
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
apiVersion: gateway.networking.k8s.io/v1
2+
kind: GatewayClass
3+
metadata:
4+
name: status-cleanup
5+
spec:
6+
controllerName: gateway.envoyproxy.io/gatewayclass-controller
7+
---
8+
apiVersion: gateway.networking.k8s.io/v1beta1
9+
kind: Gateway
10+
metadata:
11+
name: gateway-2
12+
namespace: gateway-conformance-infra
13+
spec:
14+
gatewayClassName: status-cleanup
15+
listeners:
16+
- name: foo
17+
protocol: TCP
18+
port: 8080
19+
allowedRoutes:
20+
kinds:
21+
- kind: TCPRoute
22+
infrastructure:
23+
parametersRef:
24+
group: gateway.envoyproxy.io
25+
kind: EnvoyProxy
26+
name: status-cleanup
27+
---
28+
apiVersion: gateway.envoyproxy.io/v1alpha1
29+
kind: EnvoyProxy
30+
metadata:
31+
name: status-cleanup
32+
namespace: gateway-conformance-infra
33+
spec:
34+
ipFamily: IPv4

test/e2e/tests/backend_health_check.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ var BackendHealthCheckActiveHTTPTest = suite.ConformanceTest{
4949
Namespace: gatewayapi.NamespacePtr(gwNN.Namespace),
5050
Name: gwapiv1.ObjectName(gwNN.Name),
5151
}
52-
BackendTrafficPolicyMustBeAccepted(t, suite.Client, types.NamespacedName{Name: "health-check-active-http-pass-btp", Namespace: ns}, suite.ControllerName, ancestorRef)
53-
BackendTrafficPolicyMustBeAccepted(t, suite.Client, types.NamespacedName{Name: "health-check-active-http-fail-btp", Namespace: ns}, suite.ControllerName, ancestorRef)
52+
BackendTrafficPolicyMustBeAccepted(t, suite.Client, types.NamespacedName{Name: "health-check-active-http-pass-btp", Namespace: ns}, suite.ControllerName, false, ancestorRef)
53+
BackendTrafficPolicyMustBeAccepted(t, suite.Client, types.NamespacedName{Name: "health-check-active-http-fail-btp", Namespace: ns}, suite.ControllerName, false, ancestorRef)
5454

5555
promClient, err := prometheus.NewClient(suite.Client,
5656
types.NamespacedName{Name: "prometheus", Namespace: "monitoring"},

test/e2e/tests/backend_panic_threshold.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var BackendPanicThresholdHTTPTest = suite.ConformanceTest{
4848
Namespace: gatewayapi.NamespacePtr(gwNN.Namespace),
4949
Name: gwapiv1.ObjectName(gwNN.Name),
5050
}
51-
BackendTrafficPolicyMustBeAccepted(t, suite.Client, types.NamespacedName{Name: "panic-threshold-pass-btp", Namespace: ns}, suite.ControllerName, ancestorRef)
51+
BackendTrafficPolicyMustBeAccepted(t, suite.Client, types.NamespacedName{Name: "panic-threshold-pass-btp", Namespace: ns}, suite.ControllerName, false, ancestorRef)
5252

5353
promClient, err := prometheus.NewClient(suite.Client,
5454
types.NamespacedName{Name: "prometheus", Namespace: "monitoring"},

0 commit comments

Comments
 (0)