This repository has been archived by the owner on Mar 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend scoreboard to also track TLS handshake RST (#82)
The scoreboard package will probably benefit from some more precise unit testing with respect to returned keys. Work related to ooni/probe-engine#87
- Loading branch information
1 parent
48cfb0e
commit 5972a62
Showing
4 changed files
with
102 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,52 @@ | ||
package scoreboard | ||
// must be another package to avoid import cycle | ||
package scoreboard_test | ||
|
||
import "testing" | ||
import ( | ||
"errors" | ||
"net" | ||
"net/url" | ||
"testing" | ||
|
||
func TestIntegration(t *testing.T) { | ||
board := &Board{} | ||
board.AddDNSBogonInfo(DNSBogonInfo{}) | ||
"github.com/ooni/netx/model" | ||
"github.com/ooni/netx/x/scoreboard" | ||
) | ||
|
||
func TestIntegrationDNSBogon(t *testing.T) { | ||
board := &scoreboard.Board{} | ||
board.AddDNSBogonInfo(scoreboard.DNSBogonInfo{}) | ||
t.Log(board.Marshal()) | ||
} | ||
|
||
func TestIntegrationTLSHandshakeResetNil(t *testing.T) { | ||
board := &scoreboard.Board{} | ||
board.MaybeTLSHandshakeReset(0, nil, nil) | ||
t.Log(board.Marshal()) | ||
} | ||
|
||
func TestIntegrationTLSHandshakeResetNotReset(t *testing.T) { | ||
board := &scoreboard.Board{} | ||
board.MaybeTLSHandshakeReset(0, nil, errors.New("antani")) | ||
t.Log(board.Marshal()) | ||
} | ||
|
||
func TestIntegrationTLSHandshakeResetIsReset(t *testing.T) { | ||
board := &scoreboard.Board{} | ||
board.MaybeTLSHandshakeReset(0, &url.URL{}, errors.New("connection_reset")) | ||
t.Log(board.Marshal()) | ||
} | ||
|
||
func TestIntegrationTLSHandshakeResetIsResetWithAddr(t *testing.T) { | ||
board := &scoreboard.Board{} | ||
board.MaybeTLSHandshakeReset( | ||
0, &url.URL{}, &model.ErrWrapper{ | ||
Failure: "connection_reset", | ||
WrappedErr: &net.OpError{ | ||
Addr: &net.TCPAddr{ | ||
IP: net.IPv4(8, 8, 8, 8), | ||
Port: 53, | ||
}, | ||
}, | ||
}, | ||
) | ||
t.Log(board.Marshal()) | ||
} |