vpp/extras/hs-test/mem_leak_test.go
Adrian Villin af5fcbfa71 hs-test: replaced container/interface getter func
- replaced s.GetContainerByName("xyz") with s.Containers.Xyz in tests
  and suites
- same thing for interfaces
- each suite has its own structs with containers/interfaces
- structs are initialized in SetupSuite

Type: test

Change-Id: I5bd99605b40921b7b8c844e8650f6fb0915e9e99
Signed-off-by: Adrian Villin <avillin@cisco.com>
2024-12-11 17:47:04 +00:00

26 lines
494 B
Go

package main
import (
"fmt"
. "fd.io/hs-test/infra"
)
func init() {
RegisterNoTopoSoloTests(MemLeakTest)
}
func MemLeakTest(s *NoTopoSuite) {
s.SkipUnlessLeakCheck()
vpp := s.Containers.Vpp.VppInstance
/* no goVPP less noise */
vpp.Disconnect()
vpp.EnableMemoryTrace()
traces1, err := vpp.GetMemoryTrace()
s.AssertNil(err, fmt.Sprint(err))
vpp.Vppctl("test mem-leak")
traces2, err := vpp.GetMemoryTrace()
s.AssertNil(err, fmt.Sprint(err))
vpp.MemLeakCheck(traces1, traces2)
}