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

Function TestSubsystems

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

Source from the content-addressed store, hash-verified

547}
548
549func TestSubsystems(t *testing.T) {
550 mock, err := newMock(t)
551 if err != nil {
552 t.Fatal(err)
553 }
554 defer func() {
555 if err := mock.delete(); err != nil {
556 t.Errorf("failed delete: %v", err)
557 }
558 }()
559 control, err := New(StaticPath("test"), &specs.LinuxResources{}, WithHierarchy(mock.hierarchy))
560 if err != nil {
561 t.Error(err)
562 return
563 }
564 cache := make(map[Name]struct{})
565 for _, s := range control.Subsystems() {
566 cache[s.Name()] = struct{}{}
567 }
568 for _, s := range Subsystems() {
569 if _, ok := cache[s]; !ok {
570 t.Errorf("expected subsystem %q but not found", s)
571 }
572 }
573}
574
575func TestCpusetParent(t *testing.T) {
576 const expected = "0-3"

Callers

nothing calls this directly

Calls 8

newMockFunction · 0.85
NewFunction · 0.85
StaticPathFunction · 0.85
WithHierarchyFunction · 0.85
SubsystemsFunction · 0.85
deleteMethod · 0.80
SubsystemsMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…