Skip to content

Commit

Permalink
Merge pull request #3305 from kolyshkin/rdt-4
Browse files Browse the repository at this point in the history
libct/intelrdt: remove unused type
  • Loading branch information
thaJeztah authored Dec 2, 2021
2 parents 0c0ec3f + 25112dd commit 45c31f9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
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

0 comments on commit 45c31f9

Please sign in to comment.