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

Function TestLoad

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

Source from the content-addressed store, hash-verified

377}
378
379func TestLoad(t *testing.T) {
380 mock, err := newMock(t)
381 if err != nil {
382 t.Fatal(err)
383 }
384 defer func() {
385 if err := mock.delete(); err != nil {
386 t.Errorf("failed delete: %v", err)
387 }
388 }()
389 control, err := New(StaticPath("test"), &specs.LinuxResources{}, WithHierarchy(mock.hierarchy))
390 if err != nil {
391 t.Error(err)
392 return
393 }
394 defer func() {
395 if err := control.Delete(); err != nil {
396 t.Errorf("failed to delete cgroup: %v", err)
397 }
398 }()
399 if control, err = Load(StaticPath("test"), WithHierarchy(mock.hierarchy)); err != nil {
400 t.Error(err)
401 return
402 }
403 if control == nil {
404 t.Error("control is nil")
405 return
406 }
407}
408
409func TestLoadWithMissingSubsystems(t *testing.T) {
410 mock, err := newMock(t)

Callers

nothing calls this directly

Calls 7

newMockFunction · 0.85
NewFunction · 0.85
StaticPathFunction · 0.85
WithHierarchyFunction · 0.85
deleteMethod · 0.80
LoadFunction · 0.70
DeleteMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…