(t *testing.T, opts0, opts1 []AgentOption)
| 288 | } |
| 289 | |
| 290 | func pipeWithVNetUsingOptions(t *testing.T, opts0, opts1 []AgentOption) (*Conn, *Conn) { |
| 291 | t.Helper() |
| 292 | |
| 293 | aNotifier, aConnected := onConnected() |
| 294 | bNotifier, bConnected := onConnected() |
| 295 | |
| 296 | aAgent, err := NewAgentWithOptions(opts0...) |
| 297 | require.NoError(t, err) |
| 298 | if err = aAgent.OnConnectionStateChange(aNotifier); err != nil { |
| 299 | require.NoError(t, err) |
| 300 | } |
| 301 | |
| 302 | bAgent, err := NewAgentWithOptions(opts1...) |
| 303 | require.NoError(t, err) |
| 304 | if err = bAgent.OnConnectionStateChange(bNotifier); err != nil { |
| 305 | require.NoError(t, err) |
| 306 | } |
| 307 | |
| 308 | t.Cleanup(func() { |
| 309 | require.NoError(t, aAgent.Close(), "failed to close agent0") |
| 310 | require.NoError(t, bAgent.Close(), "failed to close agent1") |
| 311 | }) |
| 312 | |
| 313 | aConn, bConn := connectWithVNet(t, aAgent, bAgent) |
| 314 | |
| 315 | <-aConnected |
| 316 | <-bConnected |
| 317 | |
| 318 | return aConn, bConn |
| 319 | } |
| 320 | |
| 321 | func closePipe(t *testing.T, ca *Conn, cb *Conn) { |
| 322 | t.Helper() |
no test coverage detected
searching dependent graphs…