go func() {
defer GinkgoRecover()
- cmd := "iperf3 -4 -s -p " + s.Ports.Port1 + " --logfile " + s.IperfLogFileName(s.Containers.ServerApp)
+ cmd := "sh -c \"iperf3 -4 -s -p " + s.Ports.Port1 + " > " + s.IperfLogFileName(s.Containers.ServerApp) + " 2>&1\""
s.StartServerApp(s.Containers.ServerApp, "iperf3", cmd, srvCh, stopServerCh)
}()
s.AssertChannelClosed(time.Minute*4, clnCh)
output := <-clnRes
- result := s.ParseJsonIperfOutput(output)
+ // VCL/LDP debugging can pollute output so find the first occurrence of a curly brace to locate the start of JSON data
+ jsonStart := -1
+ jsonEnd := len(output)
+ braceCount := 0
+ for i := 0; i < len(output); i++ {
+ if output[i] == '{' {
+ if jsonStart == -1 {
+ jsonStart = i
+ }
+ braceCount++
+ } else if output[i] == '}' {
+ braceCount--
+ if braceCount == 0 {
+ jsonEnd = i + 1
+ break
+ }
+ }
+ }
+ result := s.ParseJsonIperfOutput(output[jsonStart:jsonEnd])
s.LogJsonIperfOutput(result)
return result