(t *testing.T)
| 105 | } |
| 106 | |
| 107 | func (s) TestCredsBundleTransportCredentials(t *testing.T) { |
| 108 | te := newTest(t, env{name: "creds-bundle", network: "tcp", security: "empty"}) |
| 109 | te.customDialOptions = []grpc.DialOption{ |
| 110 | grpc.WithCredentialsBundle(&testCredsBundle{t: t, mode: bundleTLSOnly}), |
| 111 | grpc.WithAuthority("x.test.example.com"), |
| 112 | } |
| 113 | creds, err := credentials.NewServerTLSFromFile(testdata.Path("x509/server1_cert.pem"), testdata.Path("x509/server1_key.pem")) |
| 114 | if err != nil { |
| 115 | t.Fatalf("Failed to generate credentials %v", err) |
| 116 | } |
| 117 | te.customServerOptions = []grpc.ServerOption{ |
| 118 | grpc.Creds(creds), |
| 119 | } |
| 120 | te.startServer(&testServer{}) |
| 121 | defer te.tearDown() |
| 122 | |
| 123 | cc := te.clientConn() |
| 124 | tc := testgrpc.NewTestServiceClient(cc) |
| 125 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 126 | defer cancel() |
| 127 | if _, err := tc.EmptyCall(ctx, &testpb.Empty{}); err != nil { |
| 128 | t.Fatalf("Test failed. Reason: %v", err) |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | func (s) TestCredsBundlePerRPCCredentials(t *testing.T) { |
| 133 | te := newTest(t, env{name: "creds-bundle", network: "tcp", security: "empty"}) |
nothing calls this directly
no test coverage detected