blob: 04556a8fe452e73926dfdea504fba6fa6880b07f [file] [log] [blame]
Filip Tehlar229f5fc2022-08-09 14:44:47 +00001package main
2
3func (s *TapSuite) TestLinuxIperf() {
Filip Tehlar229f5fc2022-08-09 14:44:47 +00004 clnCh := make(chan error)
5 stopServerCh := make(chan struct{})
6 srvCh := make(chan error, 1)
Maros Ondrejicka87531802022-12-19 20:35:27 +01007 clnRes := make(chan string, 1)
Filip Tehlar229f5fc2022-08-09 14:44:47 +00008 defer func() {
9 stopServerCh <- struct{}{}
10 }()
11
Maros Ondrejickae7625d02023-02-28 16:55:01 +010012 go startServerApp(srvCh, stopServerCh, nil)
Filip Tehlar229f5fc2022-08-09 14:44:47 +000013 err := <-srvCh
Maros Ondrejicka98a91e82022-12-06 15:38:05 +010014 s.assertNil(err)
Maros Ondrejicka87531802022-12-19 20:35:27 +010015 s.log("server running")
Maros Ondrejicka2908f8c2023-02-02 08:58:04 +010016
Maros Ondrejickae7625d02023-02-28 16:55:01 +010017 ipAddress := s.netInterfaces[tapInterfaceName].ip4AddressString()
18 go startClientApp(ipAddress, nil, clnCh, clnRes)
Maros Ondrejicka87531802022-12-19 20:35:27 +010019 s.log("client running")
Filip Tehlarf3ee2b62023-01-09 12:07:09 +010020 s.log(<-clnRes)
Filip Tehlar229f5fc2022-08-09 14:44:47 +000021 err = <-clnCh
Maros Ondrejicka98a91e82022-12-06 15:38:05 +010022 s.assertNil(err)
Maros Ondrejicka87531802022-12-19 20:35:27 +010023 s.log("Test completed")
Filip Tehlar229f5fc2022-08-09 14:44:47 +000024}