kubernetes/pkg/kubelet/cm/cpumanager/cpu_manager_test.go

type mockState

func (s *mockState) GetCPUSet(podUID string, containerName string) (cpuset.CPUSet, bool) {}

func (s *mockState) GetDefaultCPUSet() cpuset.CPUSet {}

func (s *mockState) GetCPUSetOrDefault(podUID string, containerName string) cpuset.CPUSet {}

func (s *mockState) SetCPUSet(podUID string, containerName string, cset cpuset.CPUSet) {}

func (s *mockState) SetDefaultCPUSet(cset cpuset.CPUSet) {}

func (s *mockState) Delete(podUID string, containerName string) {}

func (s *mockState) ClearState() {}

func (s *mockState) SetCPUAssignments(a state.ContainerCPUAssignments) {}

func (s *mockState) GetCPUAssignments() state.ContainerCPUAssignments {}

type mockPolicy

func (p *mockPolicy) Name() string {}

func (p *mockPolicy) Start(s state.State) error {}

func (p *mockPolicy) Allocate(s state.State, pod *v1.Pod, container *v1.Container) error {}

func (p *mockPolicy) RemoveContainer(s state.State, podUID string, containerName string) error {}

func (p *mockPolicy) GetTopologyHints(s state.State, pod *v1.Pod, container *v1.Container) map[string][]topologymanager.TopologyHint {}

func (p *mockPolicy) GetPodTopologyHints(s state.State, pod *v1.Pod) map[string][]topologymanager.TopologyHint {}

func (p *mockPolicy) GetAllocatableCPUs(m state.State) cpuset.CPUSet {}

type mockRuntimeService

func (rt mockRuntimeService) UpdateContainerResources(_ context.Context, id string, resources *runtimeapi.ContainerResources) error {}

type mockPodStatusProvider

func (psp mockPodStatusProvider) GetPodStatus(uid types.UID) (v1.PodStatus, bool) {}

func makePod(podUID, containerName, cpuRequest, cpuLimit string) *v1.Pod {}

func makeMultiContainerPod(initCPUs, appCPUs []struct{}

func makeMultiContainerPodWithOptions(initCPUs, appCPUs []*containerOptions) *v1.Pod {}

func TestCPUManagerAdd(t *testing.T) {}

func TestCPUManagerAddWithInitContainers(t *testing.T) {}

func TestCPUManagerGenerate(t *testing.T) {}

func TestCPUManagerRemove(t *testing.T) {}

func TestReconcileState(t *testing.T) {}

// above test cases are without kubelet --reserved-cpus cmd option
// the following tests are with --reserved-cpus configured
func TestCPUManagerAddWithResvList(t *testing.T) {}

func TestCPUManagerHandlePolicyOptions(t *testing.T) {}

func TestCPUManagerGetAllocatableCPUs(t *testing.T) {}