Enable leak checker for tcp_conntrack tests.

PiperOrigin-RevId: 424374964
This commit is contained in:
Bhasker Hariharan
2022-01-26 09:59:02 -08:00
committed by gVisor bot
parent daea5b7674
commit b57e94c303
2 changed files with 12 additions and 0 deletions
+2
View File
@@ -18,6 +18,8 @@ go_test(
srcs = ["tcp_conntrack_test.go"],
deps = [
":tcpconntrack",
"//pkg/refs",
"//pkg/refsvfs2",
"//pkg/tcpip/header",
],
)
@@ -15,8 +15,11 @@
package tcpconntrack_test
import (
"os"
"testing"
"gvisor.dev/gvisor/pkg/refs"
"gvisor.dev/gvisor/pkg/refsvfs2"
"gvisor.dev/gvisor/pkg/tcpip/header"
"gvisor.dev/gvisor/pkg/tcpip/transport/tcpconntrack"
)
@@ -515,3 +518,10 @@ func TestIgnoreBadResetOnSynSent(t *testing.T) {
func dataLen(tcp header.TCP) int {
return len(tcp) - int(tcp.DataOffset())
}
func TestMain(m *testing.M) {
refs.SetLeakMode(refs.LeaksPanic)
code := m.Run()
refsvfs2.DoLeakCheck()
os.Exit(code)
}