Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libct/intelrdt: remove unused type #3305

Merged
merged 1 commit into from
Dec 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions libcontainer/intelrdt/intelrdt.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,6 @@ var (
errNotFound = errors.New("Intel RDT resctrl mount point not found")
)

type intelRdtData struct {
config *configs.Config
}

// Check if Intel RDT sub-features are enabled in featuresInit()
func featuresInit() {
initOnce.Do(func() {
Expand Down
22 changes: 11 additions & 11 deletions libcontainer/intelrdt/intelrdt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ func TestIntelRdtSetL3CacheSchema(t *testing.T) {
"schemata": l3CacheSchemaBefore + "\n",
})

helper.IntelRdtData.config.IntelRdt.L3CacheSchema = l3CacheSchemeAfter
intelrdt := NewManager(helper.IntelRdtData.config, "", helper.IntelRdtPath)
if err := intelrdt.Set(helper.IntelRdtData.config); err != nil {
helper.config.IntelRdt.L3CacheSchema = l3CacheSchemeAfter
intelrdt := NewManager(helper.config, "", helper.IntelRdtPath)
if err := intelrdt.Set(helper.config); err != nil {
t.Fatal(err)
}

Expand Down Expand Up @@ -51,9 +51,9 @@ func TestIntelRdtSetMemBwSchema(t *testing.T) {
"schemata": memBwSchemaBefore + "\n",
})

helper.IntelRdtData.config.IntelRdt.MemBwSchema = memBwSchemeAfter
intelrdt := NewManager(helper.IntelRdtData.config, "", helper.IntelRdtPath)
if err := intelrdt.Set(helper.IntelRdtData.config); err != nil {
helper.config.IntelRdt.MemBwSchema = memBwSchemeAfter
intelrdt := NewManager(helper.config, "", helper.IntelRdtPath)
if err := intelrdt.Set(helper.config); err != nil {
t.Fatal(err)
}

Expand Down Expand Up @@ -81,9 +81,9 @@ func TestIntelRdtSetMemBwScSchema(t *testing.T) {
"schemata": memBwScSchemaBefore + "\n",
})

helper.IntelRdtData.config.IntelRdt.MemBwSchema = memBwScSchemeAfter
intelrdt := NewManager(helper.IntelRdtData.config, "", helper.IntelRdtPath)
if err := intelrdt.Set(helper.IntelRdtData.config); err != nil {
helper.config.IntelRdt.MemBwSchema = memBwScSchemeAfter
intelrdt := NewManager(helper.config, "", helper.IntelRdtPath)
if err := intelrdt.Set(helper.config); err != nil {
t.Fatal(err)
}

Expand All @@ -104,8 +104,8 @@ func TestApply(t *testing.T) {

const closID = "test-clos"

helper.IntelRdtData.config.IntelRdt.ClosID = closID
intelrdt := NewManager(helper.IntelRdtData.config, "", helper.IntelRdtPath)
helper.config.IntelRdt.ClosID = closID
intelrdt := NewManager(helper.config, "", helper.IntelRdtPath)
if err := intelrdt.Apply(1234); err == nil {
t.Fatal("unexpected success when applying pid")
}
Expand Down
11 changes: 4 additions & 7 deletions libcontainer/intelrdt/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import (
)

type intelRdtTestUtil struct {
// intelRdt data to use in tests
IntelRdtData *intelRdtData
config *configs.Config

// Path to the mock Intel RDT "resource control" filesystem directory
IntelRdtPath string
Expand All @@ -24,10 +23,8 @@ type intelRdtTestUtil struct {

// Creates a new test util
func NewIntelRdtTestUtil(t *testing.T) *intelRdtTestUtil {
d := &intelRdtData{
config: &configs.Config{
IntelRdt: &configs.IntelRdt{},
},
config := &configs.Config{
IntelRdt: &configs.IntelRdt{},
}
intelRdtRoot = t.TempDir()
testIntelRdtPath := filepath.Join(intelRdtRoot, "resctrl")
Expand All @@ -36,7 +33,7 @@ func NewIntelRdtTestUtil(t *testing.T) *intelRdtTestUtil {
if err := os.MkdirAll(testIntelRdtPath, 0o755); err != nil {
t.Fatal(err)
}
return &intelRdtTestUtil{IntelRdtData: d, IntelRdtPath: testIntelRdtPath, t: t}
return &intelRdtTestUtil{config: config, IntelRdtPath: testIntelRdtPath, t: t}
}

// Write the specified contents on the mock of the specified Intel RDT "resource control" files
Expand Down