mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
log/sockstatlog: add resource cleanup test
Updates tailscale/corp#10030 Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
@@ -8,8 +8,29 @@ import (
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"tailscale.com/net/sockstats"
|
||||
"tailscale.com/tstest"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/types/logid"
|
||||
)
|
||||
|
||||
func TestResourceCleanup(t *testing.T) {
|
||||
if !sockstats.IsAvailable {
|
||||
t.Skip("sockstats not available")
|
||||
}
|
||||
tstest.ResourceCheck(t)
|
||||
td := t.TempDir()
|
||||
id, err := logid.NewPrivateID()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
lg, err := NewLogger(td, logger.Discard, id.Public())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
lg.Write([]byte("hello"))
|
||||
lg.Shutdown()
|
||||
}
|
||||
|
||||
func TestDelta(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
|
Reference in New Issue
Block a user