libct/intelrdt: fix unit test

1. These tests can't be run in parallel since they do check
   a global variable (mbaScEnabled).

2. findIntelRdtMountpointDir() relies on mbaScEnabled to be initially
   set to the default value (false) and this the test fails if run
   more than once:

> go test -count 2
> ...
> intelrdt_test.go:243: expected mbaScEnabled=false, got true
>    --- FAIL: TestFindIntelRdtMountpointDir/Valid_mountinfo_with_MBA_Software_Controller_disabled (0.00s)

Fixes: 2c70d2384
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2021-05-05 13:08:49 -07:00
parent f9176c909a
commit e1d842cfa6
+1 -1
View File
@@ -217,10 +217,10 @@ func TestFindIntelRdtMountpointDir(t *testing.T) {
},
}
t.Parallel()
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
mbaScEnabled = false
mp, err := findIntelRdtMountpointDir(tc.input)
if tc.isNotFoundError {
if !IsNotFound(err) {