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 | |
Filip Tehlar | 4b3598e | 2023-09-02 08:54:21 +0200 | [diff] [blame] | 12 | go s.startServerApp(srvCh, stopServerCh, nil) |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 13 | err := <-srvCh |
adrianvillin | 7c67547 | 2024-02-12 02:44:53 -0500 | [diff] [blame] | 14 | s.assertNil(err, 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 | |
adrianvillin | 28bd8f0 | 2024-02-13 06:00:02 -0500 | [diff] [blame^] | 17 | ipAddress := s.getInterfaceByName(tapInterfaceName).ip4AddressString() |
Filip Tehlar | 4b3598e | 2023-09-02 08:54:21 +0200 | [diff] [blame] | 18 | go s.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 |
adrianvillin | 7c67547 | 2024-02-12 02:44:53 -0500 | [diff] [blame] | 22 | s.assertNil(err, "err: '%s', ip: '%s'", err, ipAddress) |
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 | } |