TestHandshakeWithAccessToken performs an ALTS handshake between a test client and server, where both client and server offload to a local, fake handshaker service, and expects the StartClient request to include a bound access token.
(t *testing.T)
| 337 | // server, where both client and server offload to a local, fake handshaker |
| 338 | // service, and expects the StartClient request to include a bound access token. |
| 339 | func (s) TestHandshakeWithAccessToken(t *testing.T) { |
| 340 | // Start the fake handshaker service and the server. |
| 341 | var wait sync.WaitGroup |
| 342 | defer wait.Wait() |
| 343 | boundAccessToken := "fake-bound-access-token" |
| 344 | stopHandshaker, handshakerAddress := startFakeHandshakerServiceWithExpectedBoundAccessToken(t, &wait, boundAccessToken) |
| 345 | defer stopHandshaker() |
| 346 | stopServer, serverAddress := startServer(t, handshakerAddress) |
| 347 | defer stopServer() |
| 348 | |
| 349 | // Ping the server, authenticating with ALTS and a bound access token. |
| 350 | establishAltsConnectionWithBoundAccessToken(t, handshakerAddress, serverAddress, boundAccessToken) |
| 351 | |
| 352 | // Close open connections to the fake handshaker service. |
| 353 | if err := service.CloseForTesting(); err != nil { |
| 354 | t.Errorf("service.CloseForTesting() failed: %v", err) |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | // TestConcurrentHandshakes performs a several, concurrent ALTS handshakes |
| 359 | // between a test client and server, where both client and server offload to a |
nothing calls this directly
no test coverage detected