- added AssertIperfMinTransfer to KindIperfVclTest
- fixed 'make cleanup-perf'
Type: test
Change-Id: I50f7d837b1d4d842cb7464a5ee08cbecdea7adcd
Signed-off-by: Adrian Villin <[email protected]>
fi
@echo "****************************"
@echo "Removing kubernetes pods:"
- @kubectl delete pods --all --grace-period=0 -n namespace$$(cat .last_hst_ppid)
+ @kubectl delete pods --all --grace-period=0 -n hs-test$$(cat .last_hst_ppid)
@echo "****************************"
@echo "Removing kubernetes namespace:"
- @kubectl delete namespace namespace$$(cat .last_hst_ppid)
+ @kubectl delete namespace hs-test$$(cat .last_hst_ppid)
@echo "****************************"
@echo "Done."
@echo "****************************"
func (s *HstCommon) ParseJsonIperfOutput(jsonResult []byte) IPerfResult {
var result IPerfResult
+
+ // 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(jsonResult)
+ braceCount := 0
+ for i := 0; i < len(jsonResult); i++ {
+ if jsonResult[i] == '{' {
+ if jsonStart == -1 {
+ jsonStart = i
+ }
+ braceCount++
+ } else if jsonResult[i] == '}' {
+ braceCount--
+ if braceCount == 0 {
+ jsonEnd = i + 1
+ break
+ }
+ }
+ }
+ jsonResult = jsonResult[jsonStart:jsonEnd]
+
// remove iperf warning line if present
if strings.Contains(string(jsonResult), "warning") {
index := strings.Index(string(jsonResult), "\n")
s.FixVersionNumber(s.Pods.ClientGeneric, s.Pods.ServerGeneric)
o, err := s.Pods.ServerGeneric.Exec(ctx, []string{"/bin/bash", "-c",
- vcl + " " + ldp + " iperf3 -s -D -4"})
+ vcl + " " + ldp + " iperf3 -s -D -4 -B " + s.Pods.ServerGeneric.IpAddress})
s.AssertNil(err, o)
o, err = s.Pods.ClientGeneric.Exec(ctx, []string{"/bin/bash", "-c",
- vcl + " " + ldp + " iperf3 -l 1460 -b 10g -c " + s.Pods.ServerGeneric.IpAddress})
- s.Log(o)
+ vcl + " " + ldp + " iperf3 -J -l 1460 -b 10g -c " + s.Pods.ServerGeneric.IpAddress})
+
s.AssertNil(err)
+ result := s.ParseJsonIperfOutput([]byte(o))
+ s.LogJsonIperfOutput(result)
+ s.AssertIperfMinTransfer(result, 2000)
}
func NginxRpsTest(s *KindSuite) {
s.AssertChannelClosed(time.Minute*4, clnCh)
output := <-clnRes
- // 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])
+ result := s.ParseJsonIperfOutput(output)
s.LogJsonIperfOutput(result)
return result