aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test/iperf_linux_test.go
diff options
context:
space:
mode:
authorAdrian Villin <avillin@cisco.com>2024-12-06 16:00:25 +0100
committerFlorin Coras <florin.coras@gmail.com>2024-12-10 05:03:54 +0000
commit8b2a67c8f3977291fbafca37a435b5cd1ef4c214 (patch)
tree812e0d31415dd6d0730b39814a7e239696363a14 /extras/hs-test/iperf_linux_test.go
parenta661b90a4c27eee810887b106d5e1e32205c0ee0 (diff)
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 <avillin@cisco.com>
Diffstat (limited to 'extras/hs-test/iperf_linux_test.go')
-rw-r--r--extras/hs-test/iperf_linux_test.go9
1 files changed, 6 insertions, 3 deletions
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)
}