(t *testing.T)
| 407 | } |
| 408 | |
| 409 | func 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 | |
| 447 | func TestDelete(t *testing.T) { |
| 448 | mock, err := newMock(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…