Files
runc/libcontainer/configs/validate/intelrdt.go
T
Kir Kolyshkin 2d2ae8809c libct/configs/validate: simplify intelrtd tests
The whole struct intelRdtStatus with its methods and a sync.Once is not
needed, since intelrtd.Is*Enabled methods are already run-once (or use
run-once and a simple comparison).

Yet it is still needed for the test to fake values returned by *Enabled.

Simplify to use func pointers which a test case overwrites.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-05-15 17:14:15 -07:00

13 lines
272 B
Go

package validate
import (
"github.com/opencontainers/runc/libcontainer/intelrdt"
)
// Allow mocking for TestValidateIntelRdt.
var (
intelRdtIsEnabled = intelrdt.IsEnabled
intelRdtIsCATEnabled = intelrdt.IsCATEnabled
intelRdtIsMBAEnabled = intelrdt.IsMBAEnabled
)