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

Method TestLocalCredsClientFail

test/local_creds_test.go:203–210  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

201}
202
203func (s) TestLocalCredsClientFail(t *testing.T) {
204 // Use local creds at client-side which should lead to client-side failure.
205 opts := []grpc.DialOption{grpc.WithTransportCredentials(local.NewCredentials())}
206 want := status.Error(codes.Unavailable, "transport: authentication handshake failed: local credentials rejected connection to non-local address")
207 if err := testLocalCredsE2EFail(t, opts); !isExpected(err, want) {
208 t.Fatalf("testLocalCredsE2EFail() = %v; want %v", err, want)
209 }
210}
211
212func (s) TestLocalCredsServerFail(t *testing.T) {
213 // Use insecure at client-side which should lead to server-side failure.

Callers

nothing calls this directly

Calls 6

WithTransportCredentialsFunction · 0.92
NewCredentialsFunction · 0.92
ErrorFunction · 0.92
testLocalCredsE2EFailFunction · 0.85
isExpectedFunction · 0.85
FatalfMethod · 0.65

Tested by

no test coverage detected