cli: upgrade to lucas-clemente/quic-go 0.23.0 (#449)
See https://github.com/ooni/probe/issues/1754 for a comprehensive description.
This commit is contained in:
parent
a9014e7950
commit
8f18813e17
12 changed files with 192 additions and 130 deletions
|
|
@ -3,6 +3,8 @@ package quicdialer_test
|
|||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"net"
|
||||
"testing"
|
||||
|
||||
"github.com/lucas-clemente/quic-go"
|
||||
|
|
@ -10,8 +12,33 @@ import (
|
|||
"github.com/ooni/probe-cli/v3/internal/engine/netx/trace"
|
||||
"github.com/ooni/probe-cli/v3/internal/errorsx"
|
||||
"github.com/ooni/probe-cli/v3/internal/netxlite"
|
||||
"github.com/ooni/probe-cli/v3/internal/netxmocks"
|
||||
"github.com/ooni/probe-cli/v3/internal/quicx"
|
||||
)
|
||||
|
||||
func TestQUICListenerSaverCannotListen(t *testing.T) {
|
||||
expected := errors.New("mocked error")
|
||||
qls := &quicdialer.QUICListenerSaver{
|
||||
QUICListener: &netxmocks.QUICListener{
|
||||
MockListen: func(addr *net.UDPAddr) (quicx.UDPLikeConn, error) {
|
||||
return nil, expected
|
||||
},
|
||||
},
|
||||
Saver: &trace.Saver{},
|
||||
}
|
||||
pconn, err := qls.Listen(&net.UDPAddr{
|
||||
IP: []byte{},
|
||||
Port: 8080,
|
||||
Zone: "",
|
||||
})
|
||||
if !errors.Is(err, expected) {
|
||||
t.Fatal("unexpected error", err)
|
||||
}
|
||||
if pconn != nil {
|
||||
t.Fatal("expected nil pconn here")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSystemDialerSuccessWithReadWrite(t *testing.T) {
|
||||
// This is the most common use case for collecting reads, writes
|
||||
tlsConf := &tls.Config{
|
||||
|
|
|
|||
Loading…
Reference in a new issue