Matus Fabian | e99d266 | 2024-07-19 16:04:09 +0200 | [diff] [blame] | 1 | package main |
| 2 | |
| 3 | import ( |
Matus Fabian | e99d266 | 2024-07-19 16:04:09 +0200 | [diff] [blame] | 4 | "fmt" |
Adrian Villin | 5a4c7a9 | 2024-09-26 11:24:34 +0200 | [diff] [blame] | 5 | |
| 6 | . "fd.io/hs-test/infra" |
Matus Fabian | e99d266 | 2024-07-19 16:04:09 +0200 | [diff] [blame] | 7 | ) |
| 8 | |
| 9 | func init() { |
| 10 | RegisterNoTopoSoloTests(MemLeakTest) |
| 11 | } |
| 12 | |
| 13 | func MemLeakTest(s *NoTopoSuite) { |
| 14 | s.SkipUnlessLeakCheck() |
| 15 | vpp := s.GetContainerByName("vpp").VppInstance |
| 16 | /* no goVPP less noise */ |
| 17 | vpp.Disconnect() |
| 18 | vpp.EnableMemoryTrace() |
| 19 | traces1, err := vpp.GetMemoryTrace() |
| 20 | s.AssertNil(err, fmt.Sprint(err)) |
| 21 | vpp.Vppctl("test mem-leak") |
| 22 | traces2, err := vpp.GetMemoryTrace() |
| 23 | s.AssertNil(err, fmt.Sprint(err)) |
| 24 | vpp.MemLeakCheck(traces1, traces2) |
| 25 | } |