Skip to content

Commit e27d3d6

Browse files
committed
HTTP/3 tests
1 parent df74d10 commit e27d3d6

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

test/e2e/settings/http3.go

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
Copyright 2025 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package settings
18+
19+
import (
20+
"strings"
21+
22+
"github.com/onsi/ginkgo/v2"
23+
24+
"k8s.io/ingress-nginx/test/e2e/framework"
25+
)
26+
27+
var _ = framework.DescribeSetting("http3", func() {
28+
f := framework.NewDefaultFramework("http3")
29+
30+
ginkgo.It("should disable HTTP/3", func() {
31+
host := "http3.com"
32+
annotations := map[string]string{}
33+
34+
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, annotations)
35+
f.EnsureIngress(ing)
36+
37+
f.UpdateNginxConfigMapData("use-http3", "false")
38+
39+
f.WaitForNginxConfiguration(func(cfg string) bool {
40+
return !strings.Contains(cfg, "quic;")
41+
})
42+
})
43+
44+
ginkgo.It("should enable HTTP/3", func() {
45+
host := "http3.com"
46+
annotations := map[string]string{}
47+
48+
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, annotations)
49+
f.EnsureIngress(ing)
50+
51+
f.UpdateNginxConfigMapData("use-http3", "true")
52+
53+
f.WaitForNginxConfiguration(func(cfg string) bool {
54+
return strings.Contains(cfg, "quic;")
55+
})
56+
})
57+
58+
ginkgo.It("should set http3_max_concurrent_streams value", func() {
59+
f.UpdateNginxConfigMapData("http3-max-concurrent-streams", "256")
60+
61+
f.WaitForNginxConfiguration(func(cfg string) bool {
62+
return strings.Contains(cfg, "http3_max_concurrent_streams 256;")
63+
})
64+
})
65+
66+
ginkgo.It("should set http3_stream_buffer_size value", func() {
67+
f.UpdateNginxConfigMapData("http3-stream-buffer-size", "128k")
68+
69+
f.WaitForNginxConfiguration(func(cfg string) bool {
70+
return strings.Contains(cfg, "http3_stream_buffer_size 128k;")
71+
})
72+
})
73+
})

0 commit comments

Comments
 (0)