fib: fix ip drop path crashes
[vpp.git] / extras / hs-test / linux_iperf_test.go
1 package main
2
3 import (
4         . "fd.io/hs-test/infra"
5         "fmt"
6         . "github.com/onsi/ginkgo/v2"
7 )
8
9 func init() {
10         RegisterTapTests(LinuxIperfTest)
11 }
12
13 func LinuxIperfTest(s *TapSuite) {
14         clnCh := make(chan error)
15         stopServerCh := make(chan struct{})
16         srvCh := make(chan error, 1)
17         clnRes := make(chan string, 1)
18         defer func() {
19                 stopServerCh <- struct{}{}
20         }()
21
22         go func() {
23                 defer GinkgoRecover()
24                 s.StartServerApp(srvCh, stopServerCh, nil)
25         }()
26         err := <-srvCh
27         s.AssertNil(err, fmt.Sprint(err))
28         s.Log("server running")
29
30         ipAddress := s.GetInterfaceByName(TapInterfaceName).Ip4AddressString()
31         go func() {
32                 defer GinkgoRecover()
33                 s.StartClientApp(ipAddress, nil, clnCh, clnRes)
34         }()
35         s.Log("client running")
36         s.Log(<-clnRes)
37         err = <-clnCh
38         s.AssertNil(err, "err: '%s', ip: '%s'", err, ipAddress)
39         s.Log("Test completed")
40 }