aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test/ldp_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/ldp_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/ldp_test.go')
-rw-r--r--extras/hs-test/ldp_test.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/extras/hs-test/ldp_test.go b/extras/hs-test/ldp_test.go
index 32473d54afd..76bc3669fb6 100644
--- a/extras/hs-test/ldp_test.go
+++ b/extras/hs-test/ldp_test.go
@@ -48,7 +48,7 @@ func ldPreloadIperfVpp(s *LdpSuite, useUdp bool) {
stopServerCh := make(chan struct{}, 1)
srvCh := make(chan error, 1)
clnCh := make(chan error)
- clnRes := make(chan string, 1)
+ clnRes := make(chan []byte, 1)
defer func() {
stopServerCh <- struct{}{}
@@ -65,12 +65,15 @@ func ldPreloadIperfVpp(s *LdpSuite, useUdp bool) {
go func() {
defer GinkgoRecover()
- cmd := "iperf3 -c " + serverVethAddress + " -l 1460 -b 10g -p " + s.GetPortFromPpid() + protocol
+ cmd := "iperf3 -c " + serverVethAddress + " -l 1460 -b 10g -J -p " + s.GetPortFromPpid() + protocol
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, 400)
}
func RedisBenchmarkTest(s *LdpSuite) {
@@ -83,7 +86,7 @@ func RedisBenchmarkTest(s *LdpSuite) {
runningSrv := make(chan error)
doneSrv := make(chan struct{})
clnCh := make(chan error)
- clnRes := make(chan string, 1)
+ clnRes := make(chan []byte, 1)
defer func() {
doneSrv <- struct{}{}
@@ -112,5 +115,5 @@ func RedisBenchmarkTest(s *LdpSuite) {
// 4.5 minutes
s.AssertChannelClosed(time.Second*270, clnCh)
- s.Log(<-clnRes)
+ s.Log(string(<-clnRes))
}