From e99d266612b53163d460f3ceab96934b1d961ac8 Mon Sep 17 00:00:00 2001 From: Matus Fabian Date: Fri, 19 Jul 2024 16:04:09 +0200 Subject: hs-test: memory leak testing add infra for memory leak testing Type: test Change-Id: I882e8dbb360597cdb82ad52682725f7d39b2df24 Signed-off-by: Matus Fabian --- extras/hs-test/mem_leak_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 extras/hs-test/mem_leak_test.go (limited to 'extras/hs-test/mem_leak_test.go') diff --git a/extras/hs-test/mem_leak_test.go b/extras/hs-test/mem_leak_test.go new file mode 100644 index 00000000000..76966ae968a --- /dev/null +++ b/extras/hs-test/mem_leak_test.go @@ -0,0 +1,24 @@ +package main + +import ( + . "fd.io/hs-test/infra" + "fmt" +) + +func init() { + RegisterNoTopoSoloTests(MemLeakTest) +} + +func MemLeakTest(s *NoTopoSuite) { + s.SkipUnlessLeakCheck() + vpp := s.GetContainerByName("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) +} -- cgit 1.2.3-korg