diff --git a/libcontainer/intelrdt/intelrdt.go b/libcontainer/intelrdt/intelrdt.go index 40e738b03..e8dfc272d 100644 --- a/libcontainer/intelrdt/intelrdt.go +++ b/libcontainer/intelrdt/intelrdt.go @@ -180,12 +180,6 @@ func NewManager(config *configs.Config, id, path string) *Manager { } } - return newManager(config, id, path) -} - -// newManager is the same as NewManager, except it does not check if the feature -// is actually available. Used by unit tests that mock intelrdt paths. -func newManager(config *configs.Config, id, path string) *Manager { return &Manager{ config: config, id: id, diff --git a/libcontainer/intelrdt/intelrdt_test.go b/libcontainer/intelrdt/intelrdt_test.go index 1ed05860e..9c79b1df8 100644 --- a/libcontainer/intelrdt/intelrdt_test.go +++ b/libcontainer/intelrdt/intelrdt_test.go @@ -108,7 +108,10 @@ func TestIntelRdtSet(t *testing.T) { helper := NewIntelRdtTestUtil(t) helper.config.IntelRdt = tc.config - intelrdt := newManager(helper.config, "", helper.IntelRdtPath) + intelrdt := &Manager{ + config: helper.config, + path: helper.IntelRdtPath, + } if err := intelrdt.Set(helper.config); err != nil { t.Fatal(err) } @@ -195,7 +198,11 @@ func TestApply(t *testing.T) { t.Fatal(err) } } - m := newManager(&configs.Config{IntelRdt: &tt.config}, id, closPath) + m := &Manager{ + config: &configs.Config{IntelRdt: &tt.config}, + id: id, + path: closPath, + } err := m.Apply(pid) if tt.isError && err == nil { t.Fatal("expected error, got nil") @@ -292,7 +299,11 @@ func TestDestroy(t *testing.T) { t.Fatal(err) } } - m := newManager(&configs.Config{IntelRdt: &tt.config}, id, closPath) + m := &Manager{ + config: &configs.Config{IntelRdt: &tt.config}, + id: id, + path: closPath, + } if err := m.Apply(1234); err != nil { t.Fatalf("Apply() failed: %v", err) }