refactor(netxlite): restructure dialer tests (#486)
While there, add one more test checking for whether the internal CA bundle we use can actually be loaded. Part of https://github.com/ooni/probe/issues/1591
This commit is contained in:
parent
f054ec3201
commit
6d39118b26
6 changed files with 297 additions and 239 deletions
|
|
@ -310,7 +310,7 @@ func TestTLSDialerDialTLSContextFailureSplitHostPort(t *testing.T) {
|
|||
func TestTLSDialerDialTLSContextFailureDialing(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
cancel() // immediately fail
|
||||
dialer := tlsDialer{Dialer: defaultDialer}
|
||||
dialer := tlsDialer{Dialer: &dialerSystem{}}
|
||||
conn, err := dialer.DialTLSContext(ctx, "tcp", "www.google.com:443")
|
||||
if err == nil || !strings.HasSuffix(err.Error(), "operation was canceled") {
|
||||
t.Fatal("not the error we expected", err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue