diff --git a/cmd/plugins/topology-aware/policy/mocks_test.go b/cmd/plugins/topology-aware/policy/mocks_test.go index f3b291d67..85d284b66 100644 --- a/cmd/plugins/topology-aware/policy/mocks_test.go +++ b/cmd/plugins/topology-aware/policy/mocks_test.go @@ -22,6 +22,7 @@ import ( resmgr "github.com/containers/nri-plugins/pkg/apis/resmgr/v1alpha1" "github.com/containers/nri-plugins/pkg/cpuallocator" "github.com/containers/nri-plugins/pkg/resmgr/cache" + libmem "github.com/containers/nri-plugins/pkg/resmgr/lib/memory" "github.com/containers/nri-plugins/pkg/sysfs" system "github.com/containers/nri-plugins/pkg/sysfs" "github.com/containers/nri-plugins/pkg/topology" @@ -186,6 +187,9 @@ func (c *mockCPU) GetCachesByLevel(int) []*sysfs.Cache { func (c *mockCPU) GetCacheByIndex(int) *sysfs.Cache { panic("unimplemented") } +func (c *mockCPU) GetNthLevelCacheCPUSet(n int) cpuset.CPUSet { + panic("unimplemented") +} func (c *mockCPU) GetLastLevelCaches() []*sysfs.Cache { panic("unimplemented") } @@ -531,6 +535,9 @@ func (m *mockContainer) PreserveCpuResources() bool { func (m *mockContainer) PreserveMemoryResources() bool { return false } +func (m *mockContainer) MemoryTypes() (libmem.TypeMask, error) { + return libmem.TypeMaskDRAM, nil +} type mockPod struct { name string @@ -669,6 +676,8 @@ func (m *mockCache) EvaluateAffinity(*cache.Affinity) map[string]int32 { func (m *mockCache) AddImplicitAffinities(map[string]cache.ImplicitAffinity) error { return nil } +func (m *mockCache) DeleteImplicitAffinities(...string) { +} func (m *mockCache) GetActivePolicy() string { panic("unimplemented") } diff --git a/cmd/plugins/topology-aware/policy/pools_test.go b/cmd/plugins/topology-aware/policy/pools_test.go index b4111b3a2..00a530950 100644 --- a/cmd/plugins/topology-aware/policy/pools_test.go +++ b/cmd/plugins/topology-aware/policy/pools_test.go @@ -276,20 +276,6 @@ func TestWorkloadPlacement(t *testing.T) { expectedRemainingNodes: []int{0, 1, 2, 3, 4, 5, 6}, expectedLeafNode: false, }, - { - path: path.Join(dir, "sysfs", "server", "sys"), - name: "workload placement on a server system root node: memory doesn't fit to leaf", - req: &request{ - memReq: 190000000000, - memLim: 190000000000, - memType: memoryUnspec, - isolate: false, - full: 28, - container: &mockContainer{}, - }, - expectedRemainingNodes: []int{2, 6}, - expectedLeafNode: false, - }, } for _, tc := range tcases { t.Run(tc.name, func(t *testing.T) {