(t *testing.T)
| 79 | } |
| 80 | |
| 81 | func (s) TestCredsBundleBoth(t *testing.T) { |
| 82 | te := newTest(t, env{name: "creds-bundle", network: "tcp", security: "empty"}) |
| 83 | te.tapHandle = authHandle |
| 84 | te.customDialOptions = []grpc.DialOption{ |
| 85 | grpc.WithCredentialsBundle(&testCredsBundle{t: t}), |
| 86 | grpc.WithAuthority("x.test.example.com"), |
| 87 | } |
| 88 | creds, err := credentials.NewServerTLSFromFile(testdata.Path("x509/server1_cert.pem"), testdata.Path("x509/server1_key.pem")) |
| 89 | if err != nil { |
| 90 | t.Fatalf("Failed to generate credentials %v", err) |
| 91 | } |
| 92 | te.customServerOptions = []grpc.ServerOption{ |
| 93 | grpc.Creds(creds), |
| 94 | } |
| 95 | te.startServer(&testServer{}) |
| 96 | defer te.tearDown() |
| 97 | |
| 98 | cc := te.clientConn() |
| 99 | tc := testgrpc.NewTestServiceClient(cc) |
| 100 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 101 | defer cancel() |
| 102 | if _, err := tc.EmptyCall(ctx, &testpb.Empty{}); err != nil { |
| 103 | t.Fatalf("Test failed. Reason: %v", err) |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | func (s) TestCredsBundleTransportCredentials(t *testing.T) { |
| 108 | te := newTest(t, env{name: "creds-bundle", network: "tcp", security: "empty"}) |
nothing calls this directly
no test coverage detected