-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
channelz: fix GetSecurityValue function name. #2450
Conversation
test/channelz_test.go
Outdated
} | ||
skt := channelz.GetSocket(id) | ||
cert, _ := tls.LoadX509KeyPair(testdata.Path("server1.pem"), testdata.Path("server1.key")) | ||
securityVal := skt.SocketData.Security.(*credentials.TLSChannelzSecurityValue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do an ok
check to avoid panic is Security
is not the expected type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
test/channelz_test.go
Outdated
if !reflect.DeepEqual(securityVal.RemoteCertificate, cert.Certificate[0]) { | ||
return false, fmt.Errorf("SocketData.Security.RemoteCertificate got: %v, want: %v", securityVal.RemoteCertificate, cert.Certificate[0]) | ||
} | ||
for _, v := range credentials.CipherSuiteLookup { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the expected suites a subset of the whole CipherSuiteLookup
? I would prefer to not export the map for testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make a test copy of all the cipher suites for checking against.
Thank you for your pull request. Before we can look at your contribution, we need to ensure all contributors are covered by a Contributor License Agreement. After the following items are addressed, please respond with a new comment here, and the automated system will re-verify.
Regards, |
te.startServer(&testServer{security: e.security}) | ||
defer te.tearDown() | ||
te.clientConn() | ||
if err := verifyResultWithDelay(func() (bool, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to the changes in this PR.
Can this just be verifyResultWithDelay(func() error)
? (No bool
in return value).
It seems the function either return true, nil
or false, <non-nil>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right. I think the original idea is that we may want false, nil
sometimes to skip creating intermediate errors. But it seems we don't really have such use case yet. We probably should just refactor to what you suggested.
No description provided.