Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 1 | package main |
| 2 | |
| 3 | func (s *TapSuite) TestLinuxIperf() { |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 4 | clnCh := make(chan error) |
| 5 | stopServerCh := make(chan struct{}) |
| 6 | srvCh := make(chan error, 1) |
Maros Ondrejicka | 8753180 | 2022-12-19 20:35:27 +0100 | [diff] [blame] | 7 | clnRes := make(chan string, 1) |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 8 | defer func() { |
| 9 | stopServerCh <- struct{}{} |
| 10 | }() |
| 11 | |
| 12 | go StartServerApp(srvCh, stopServerCh, nil) |
| 13 | err := <-srvCh |
Maros Ondrejicka | 98a91e8 | 2022-12-06 15:38:05 +0100 | [diff] [blame] | 14 | s.assertNil(err) |
Maros Ondrejicka | 8753180 | 2022-12-19 20:35:27 +0100 | [diff] [blame] | 15 | s.log("server running") |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame^] | 16 | |
| 17 | ipAddress := s.netInterfaces["tap0"].Ip4AddressString() |
| 18 | go StartClientApp(ipAddress, nil, clnCh, clnRes) |
Maros Ondrejicka | 8753180 | 2022-12-19 20:35:27 +0100 | [diff] [blame] | 19 | s.log("client running") |
Filip Tehlar | f3ee2b6 | 2023-01-09 12:07:09 +0100 | [diff] [blame] | 20 | s.log(<-clnRes) |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 21 | err = <-clnCh |
Maros Ondrejicka | 98a91e8 | 2022-12-06 15:38:05 +0100 | [diff] [blame] | 22 | s.assertNil(err) |
Maros Ondrejicka | 8753180 | 2022-12-19 20:35:27 +0100 | [diff] [blame] | 23 | s.log("Test completed") |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 24 | } |