MCPcopy
hub / github.com/grpc/grpc-go / TestServerHandshakeReturnsAuthInfo

Method TestServerHandshakeReturnsAuthInfo

credentials/credentials_test.go:172–185  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

170}
171
172func (s) TestServerHandshakeReturnsAuthInfo(t *testing.T) {
173 done := make(chan AuthInfo, 1)
174 lis := launchServer(t, gRPCServerHandshake, done)
175 defer lis.Close()
176 clientAuthInfo := clientHandle(t, tlsClientHandshake, lis.Addr().String())
177 // wait until server sends serverAuthInfo or fails.
178 serverAuthInfo, ok := <-done
179 if !ok {
180 t.Fatalf("Error at server-side")
181 }
182 if !compare(clientAuthInfo, serverAuthInfo) {
183 t.Fatalf("ServerHandshake(_) = %v, want %v.", serverAuthInfo, clientAuthInfo)
184 }
185}
186
187func (s) TestServerAndClientHandshake(t *testing.T) {
188 done := make(chan AuthInfo, 1)

Callers

nothing calls this directly

Calls 7

launchServerFunction · 0.70
clientHandleFunction · 0.70
compareFunction · 0.70
CloseMethod · 0.65
StringMethod · 0.65
FatalfMethod · 0.65
AddrMethod · 0.45

Tested by

no test coverage detected