forked from quic-go/quic-go
run multiplex integration tests with all supported QUIC versions
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
|||||||
quic "github.com/lucas-clemente/quic-go"
|
quic "github.com/lucas-clemente/quic-go"
|
||||||
"github.com/lucas-clemente/quic-go/integrationtests/tools/testlog"
|
"github.com/lucas-clemente/quic-go/integrationtests/tools/testlog"
|
||||||
"github.com/lucas-clemente/quic-go/integrationtests/tools/testserver"
|
"github.com/lucas-clemente/quic-go/integrationtests/tools/testserver"
|
||||||
|
"github.com/lucas-clemente/quic-go/internal/protocol"
|
||||||
"github.com/lucas-clemente/quic-go/internal/testdata"
|
"github.com/lucas-clemente/quic-go/internal/testdata"
|
||||||
|
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
@@ -16,8 +17,16 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("Multiplexing clients", func() {
|
var _ = Describe("Multiplexing clients", func() {
|
||||||
|
for _, v := range append(protocol.SupportedVersions, protocol.VersionTLS) {
|
||||||
|
version := v
|
||||||
|
|
||||||
|
Context(fmt.Sprintf("with QUIC version %s", version), func() {
|
||||||
runServer := func() quic.Listener {
|
runServer := func() quic.Listener {
|
||||||
ln, err := quic.ListenAddr("localhost:0", testdata.GetTLSConfig(), nil)
|
ln, err := quic.ListenAddr(
|
||||||
|
"localhost:0",
|
||||||
|
testdata.GetTLSConfig(),
|
||||||
|
&quic.Config{Versions: []protocol.VersionNumber{version}},
|
||||||
|
)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
go func() {
|
go func() {
|
||||||
defer GinkgoRecover()
|
defer GinkgoRecover()
|
||||||
@@ -40,7 +49,13 @@ var _ = Describe("Multiplexing clients", func() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dial := func(conn net.PacketConn, addr net.Addr) {
|
dial := func(conn net.PacketConn, addr net.Addr) {
|
||||||
sess, err := quic.Dial(conn, addr, fmt.Sprintf("quic.clemente.io:%d", addr.(*net.UDPAddr).Port), nil, nil)
|
sess, err := quic.Dial(
|
||||||
|
conn,
|
||||||
|
addr,
|
||||||
|
fmt.Sprintf("quic.clemente.io:%d", addr.(*net.UDPAddr).Port),
|
||||||
|
nil,
|
||||||
|
&quic.Config{Versions: []protocol.VersionNumber{version}},
|
||||||
|
)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
str, err := sess.AcceptStream()
|
str, err := sess.AcceptStream()
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
@@ -112,5 +127,6 @@ var _ = Describe("Multiplexing clients", func() {
|
|||||||
Eventually(done1, timeout).Should(BeClosed())
|
Eventually(done1, timeout).Should(BeClosed())
|
||||||
Eventually(done2, timeout).Should(BeClosed())
|
Eventually(done2, timeout).Should(BeClosed())
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user