-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libcontainer/intelrdt: add basic "MON" groups support.
More info: https://www.kernel.org/doc/Documentation/x86/intel_rdt_ui.txt Signed-off-by: Paweł Szulik <[email protected]>
- Loading branch information
Paweł Szulik
committed
Dec 1, 2022
1 parent
2da0194
commit e5ce002
Showing
12 changed files
with
338 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package configs_test | ||
|
||
import ( | ||
"encoding/json" | ||
"reflect" | ||
"testing" | ||
|
||
"github.com/opencontainers/runc/libcontainer/configs" | ||
) | ||
|
||
func TestUnmarshalIntelRDT(t *testing.T) { | ||
testCases := []struct { | ||
JSON string | ||
Expected configs.IntelRdt | ||
}{ | ||
{ | ||
"{\"enableMBM\": true}", | ||
configs.IntelRdt{EnableMBM: true, EnableCMT: false}, | ||
}, | ||
{ | ||
"{\"enableMBM\": true,\"enableCMT\": false}", | ||
configs.IntelRdt{EnableMBM: true, EnableCMT: false}, | ||
}, | ||
{ | ||
"{\"enableMBM\": false,\"enableCMT\": true}", | ||
configs.IntelRdt{EnableMBM: false, EnableCMT: true}, | ||
}, | ||
} | ||
|
||
for _, tc := range testCases { | ||
got := configs.IntelRdt{} | ||
|
||
err := json.Unmarshal([]byte(tc.JSON), &got) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
if !reflect.DeepEqual(tc.Expected, got) { | ||
t.Errorf("expected unmarshalled IntelRDT config %+v, got %+v", tc.Expected, got) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.