MCPcopy Create free account
hub / github.com/containerd/cgroups / TestStat

Function TestStat

cgroup1/cgroup_test.go:62–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

60}
61
62func TestStat(t *testing.T) {
63 mock, err := newMock(t)
64 if err != nil {
65 t.Fatal(err)
66 }
67 defer func() {
68 if err := mock.delete(); err != nil {
69 t.Errorf("failed delete: %v", err)
70 }
71 }()
72 control, err := New(StaticPath("test"), &specs.LinuxResources{}, WithHierarchy(mock.hierarchy))
73 if err != nil {
74 t.Error(err)
75 return
76 }
77 s, err := control.Stat(IgnoreNotExist)
78 if err != nil {
79 t.Error(err)
80 return
81 }
82 if s == nil {
83 t.Error("stat result is nil")
84 return
85 }
86}
87
88func TestAdd(t *testing.T) {
89 mock, err := newMock(t)

Callers

nothing calls this directly

Calls 6

newMockFunction · 0.85
NewFunction · 0.85
StaticPathFunction · 0.85
WithHierarchyFunction · 0.85
deleteMethod · 0.80
StatMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…