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

Function TestLoadWithMissingSubsystems

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

Source from the content-addressed store, hash-verified

407}
408
409func TestLoadWithMissingSubsystems(t *testing.T) {
410 mock, err := newMock(t)
411 if err != nil {
412 t.Fatal(err)
413 }
414 defer func() {
415 if err := mock.delete(); err != nil {
416 t.Errorf("failed delete: %v", err)
417 }
418 }()
419 subsystems, err := mock.hierarchy()
420 if err != nil {
421 t.Error(err)
422 return
423 }
424 control, err := mockNewNotInRdma(subsystems, StaticPath("test"), &specs.LinuxResources{})
425 if err != nil {
426 t.Error(err)
427 return
428 }
429 if control == nil {
430 t.Error("control is nil")
431 return
432 }
433 if control, err = Load(StaticPath("test"), WithHierarchy(mock.hierarchy)); err != nil {
434 t.Error(err)
435 return
436 }
437 if control == nil {
438 t.Error("control is nil")
439 return
440 }
441 if len(control.Subsystems()) != len(subsystems)-1 {
442 t.Error("wrong number of active subsystems")
443 return
444 }
445}
446
447func TestDelete(t *testing.T) {
448 mock, err := newMock(t)

Callers

nothing calls this directly

Calls 8

newMockFunction · 0.85
mockNewNotInRdmaFunction · 0.85
StaticPathFunction · 0.85
WithHierarchyFunction · 0.85
deleteMethod · 0.80
hierarchyMethod · 0.80
LoadFunction · 0.70
SubsystemsMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…