summaryrefslogtreecommitdiffstats
path: root/extras/hs-test/mem_leak_test.go
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2024-07-19 16:04:09 +0200
committerFlorin Coras <florin.coras@gmail.com>2024-07-22 17:44:42 +0000
commite99d266612b53163d460f3ceab96934b1d961ac8 (patch)
treeb0bf01f2802f2a7c282ff268b48bd412edfd3c98 /extras/hs-test/mem_leak_test.go
parent7f163b682a57f42bd9b39a7f2d7e4c1c67df8386 (diff)
hs-test: memory leak testing
add infra for memory leak testing Type: test Change-Id: I882e8dbb360597cdb82ad52682725f7d39b2df24 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'extras/hs-test/mem_leak_test.go')
-rw-r--r--extras/hs-test/mem_leak_test.go24
1 files changed, 24 insertions, 0 deletions
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)
+}