TUN-2582: EventDigest field in tunnelrpc

This commit is contained in:
Adam Chalmers
2019-11-22 10:17:23 -06:00
parent b0d31a0ef3
commit f51712bef9
4 changed files with 278 additions and 256 deletions

View File

@@ -19,8 +19,9 @@ const (
)
var (
testErr = fmt.Errorf("Invalid credential")
testLogLines = []string{"all", "working"}
testErr = fmt.Errorf("Invalid credential")
testLogLines = []string{"all", "working"}
testEventDigest = []byte("asdf")
)
// *PermanentRegistrationError implements TunnelRegistrationError
@@ -31,8 +32,8 @@ var _ TunnelRegistrationError = (*RetryableRegistrationError)(nil)
func TestTunnelRegistration(t *testing.T) {
testCases := []*TunnelRegistration{
NewSuccessfulTunnelRegistration(testURL, testLogLines, testTunnelID),
NewSuccessfulTunnelRegistration(testURL, nil, testTunnelID),
NewSuccessfulTunnelRegistration(testURL, testLogLines, testTunnelID, testEventDigest),
NewSuccessfulTunnelRegistration(testURL, nil, testTunnelID, testEventDigest),
NewPermanentRegistrationError(testErr).Serialize(),
NewRetryableRegistrationError(testErr, testRetryAfterSeconds).Serialize(),
}