Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 1 | package main |
| 2 | |
| 3 | func (s *TapSuite) TestLinuxIperf() { |
| 4 | t := s.T() |
| 5 | clnCh := make(chan error) |
| 6 | stopServerCh := make(chan struct{}) |
| 7 | srvCh := make(chan error, 1) |
| 8 | defer func() { |
| 9 | stopServerCh <- struct{}{} |
| 10 | }() |
| 11 | |
| 12 | go StartServerApp(srvCh, stopServerCh, nil) |
| 13 | err := <-srvCh |
| 14 | if err != nil { |
| 15 | t.Errorf("%v", err) |
| 16 | t.FailNow() |
| 17 | } |
| 18 | t.Log("server running") |
| 19 | go StartClientApp(nil, clnCh) |
| 20 | t.Log("client running") |
| 21 | err = <-clnCh |
| 22 | if err != nil { |
| 23 | s.Failf("client", "%v", err) |
| 24 | } |
| 25 | t.Log("Test completed") |
| 26 | } |