blob: 154a9b543b9dfb95bbfa209ae374cb2b870742c8 [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
12 go StartServerApp(srvCh, stopServerCh, nil)
13 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
17 ipAddress := s.netInterfaces["tap0"].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}