From 8b2a67c8f3977291fbafca37a435b5cd1ef4c214 Mon Sep 17 00:00:00 2001 From: Adrian Villin Date: Fri, 6 Dec 2024 16:00:25 +0100 Subject: hs-test: improved iperf testing - set iperf to json output - added iperf json parsing function - we can now check if iperf transferred more than X megabytes (other asserts can be added) Type: test Change-Id: I560104a153456b46f22a1affee4301018063b99d Signed-off-by: Adrian Villin --- extras/hs-test/iperf_linux_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'extras/hs-test/iperf_linux_test.go') diff --git a/extras/hs-test/iperf_linux_test.go b/extras/hs-test/iperf_linux_test.go index ff1467c48eb..0a59f6a4e0f 100644 --- a/extras/hs-test/iperf_linux_test.go +++ b/extras/hs-test/iperf_linux_test.go @@ -21,7 +21,7 @@ func IperfUdpLinuxTest(s *IperfSuite) { clnCh := make(chan error) stopServerCh := make(chan struct{}) srvCh := make(chan error, 1) - clnRes := make(chan string, 1) + clnRes := make(chan []byte, 1) defer func() { stopServerCh <- struct{}{} @@ -39,9 +39,12 @@ func IperfUdpLinuxTest(s *IperfSuite) { go func() { defer GinkgoRecover() cmd := "iperf3 -c " + serverIpAddress + " -B " + clientIpAddress + - " -u -l 1460 -b 10g -p " + s.GetPortFromPpid() + " -u -l 1460 -b 10g -J -p " + s.GetPortFromPpid() s.StartClientApp(clientContainer, cmd, clnCh, clnRes) }() s.AssertChannelClosed(time.Minute*3, clnCh) - s.Log(<-clnRes) + output := <-clnRes + result := s.ParseJsonIperfOutput(output) + s.LogJsonIperfOutput(result) + s.AssertIperfMinTransfer(result, 800) } -- cgit