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

Function TestAddTask

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

Source from the content-addressed store, hash-verified

174}
175
176func TestAddTask(t *testing.T) {
177 mock, err := newMock(t)
178 if err != nil {
179 t.Fatal(err)
180 }
181 defer func() {
182 if err := mock.delete(); err != nil {
183 t.Errorf("failed delete: %v", err)
184 }
185 }()
186 control, err := New(StaticPath("test"), &specs.LinuxResources{}, WithHierarchy(mock.hierarchy))
187 if err != nil {
188 t.Error(err)
189 return
190 }
191 if err := control.AddTask(Process{Pid: 1234}); err != nil {
192 t.Error(err)
193 return
194 }
195 for _, s := range Subsystems() {
196 if err := checkTaskid(mock, filepath.Join(string(s), "test"), 1234); err != nil {
197 t.Error(err)
198 return
199 }
200 }
201}
202
203func TestAddTaskFilteredSubsystems(t *testing.T) {
204 mock, err := newMock(t)

Callers

nothing calls this directly

Calls 8

newMockFunction · 0.85
NewFunction · 0.85
StaticPathFunction · 0.85
WithHierarchyFunction · 0.85
SubsystemsFunction · 0.85
checkTaskidFunction · 0.85
deleteMethod · 0.80
AddTaskMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…