Skip to content

Commit b1458bb

Browse files
committed
one of the canary tests was fixed and extended
1 parent b65263c commit b1458bb

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

test/e2e/annotations/canary.go

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ var _ = framework.DescribeAnnotation("canary-*", func() {
8888

8989
ginkgo.It("should return 404 status for requests to the canary if no matching ingress is found", func() {
9090
host := fooHost
91+
filterHeader := "CanaryByHeaderFoo"
92+
wrongHeaders := []string{
93+
"WrongHeader",
94+
"CanaryByHeader",
95+
"CanaryByHeaderBar",
96+
"CanaryByHeaderFooBar",
97+
"BarCanaryByHeaderFoo",
98+
}
9199

92100
canaryAnnotations := map[string]string{
93101
"nginx.ingress.kubernetes.io/canary": "true",
@@ -110,12 +118,14 @@ var _ = framework.DescribeAnnotation("canary-*", func() {
110118
return strings.Contains(server, fmt.Sprintf("server_name %v", host))
111119
})
112120

113-
f.HTTPTestClient().
114-
GET("/info").
115-
WithHeader("Host", host).
116-
WithHeader("CanaryByHeader", "always").
117-
Expect().
118-
Status(http.StatusNotFound)
121+
for _, wh := range wrongHeaders {
122+
f.HTTPTestClient().
123+
GET("/info").
124+
WithHeader("Host", host).
125+
WithHeader(wh, "always").
126+
Expect().
127+
Status(http.StatusNotFound)
128+
}
119129
})
120130

121131
/*

0 commit comments

Comments
 (0)