(t *testing.T)
| 547 | } |
| 548 | |
| 549 | func 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 | |
| 575 | func TestCpusetParent(t *testing.T) { |
| 576 | const expected = "0-3" |
nothing calls this directly
no test coverage detected
searching dependent graphs…