kubernetes/pkg/kubelet/cm/devicemanager/manager_test.go

const testResourceName

func newWrappedManagerImpl(socketPath string, manager *ManagerImpl) *wrappedManagerImpl {}

type wrappedManagerImpl

func (m *wrappedManagerImpl) PluginListAndWatchReceiver(r string, resp *pluginapi.ListAndWatchResponse) {}

func tmpSocketDir() (socketDir, socketName, pluginSocketName string, err error) {}

func TestNewManagerImpl(t *testing.T) {}

func TestNewManagerImplStart(t *testing.T) {}

func TestNewManagerImplStartProbeMode(t *testing.T) {}

// Tests that the device plugin manager correctly handles registration and re-registration by
// making sure that after registration, devices are correctly updated and if a re-registration
// happens, we will NOT delete devices; and no orphaned devices left.
func TestDevicePluginReRegistration(t *testing.T) {}

// Tests that the device plugin manager correctly handles registration and re-registration by
// making sure that after registration, devices are correctly updated and if a re-registration
// happens, we will NOT delete devices; and no orphaned devices left.
// While testing above scenario, plugin discovery and registration will be done using
// Kubelet probe based mechanism
func TestDevicePluginReRegistrationProbeMode(t *testing.T) {}

func setupDeviceManager(t *testing.T, devs []*pluginapi.Device, callback monitorCallback, socketName string,
	topology []cadvisorapi.Node) (Manager, <-chan interface{}

func setupDevicePlugin(t *testing.T, devs []*pluginapi.Device, pluginSocketName string) *plugin.Stub {}

func setupPluginManager(t *testing.T, pluginSocketName string, m Manager) pluginmanager.PluginManager {}

func runPluginManager(pluginManager pluginmanager.PluginManager) {}

func setup(t *testing.T, devs []*pluginapi.Device, callback monitorCallback, socketName string, pluginSocketName string) (Manager, <-chan interface{}

func setupInProbeMode(t *testing.T, devs []*pluginapi.Device, callback monitorCallback, socketName string, pluginSocketName string) (Manager, <-chan interface{}

func cleanup(t *testing.T, m Manager, p *plugin.Stub) {}

func TestUpdateCapacityAllocatable(t *testing.T) {}

func TestGetAllocatableDevicesMultipleResources(t *testing.T) {}

func TestGetAllocatableDevicesHealthTransition(t *testing.T) {}

func checkAllocatableDevicesConsistsOf(as *assert.Assertions, devInstances DeviceInstances, expectedDevs []string) {}

func constructDevices(devices []string) checkpoint.DevicesPerNUMA {}

type containerAllocateResponseBuilder

type containerAllocateResponseBuilderOption

// withDevices sets the devices for the containerAllocateResponseBuilder
func withDevices(devices map[string]string) containerAllocateResponseBuilderOption {}

// withMounts sets the mounts for the containerAllocateResponseBuilder
func withMounts(mounts map[string]string) containerAllocateResponseBuilderOption {}

// withEnvs sets the envs for the containerAllocateResponseBuilder
func withEnvs(envs map[string]string) containerAllocateResponseBuilderOption {}

// withCDIDevices sets the cdiDevices for the containerAllocateResponseBuilder
func withCDIDevices(cdiDevices ...string) containerAllocateResponseBuilderOption {}

// newContainerAllocateResponse creates a ContainerAllocateResponse with the given options.
func newContainerAllocateResponse(opts ...containerAllocateResponseBuilderOption) *pluginapi.ContainerAllocateResponse {}

// Build uses the configured builder to create a ContainerAllocateResponse.
func (b *containerAllocateResponseBuilder) Build() *pluginapi.ContainerAllocateResponse {}

func TestCheckpoint(t *testing.T) {}

type activePodsStub

func (a *activePodsStub) getActivePods() []*v1.Pod {}

func (a *activePodsStub) updateActivePods(newPods []*v1.Pod) {}

type MockEndpoint

func (m *MockEndpoint) preStartContainer(devs []string) (*pluginapi.PreStartContainerResponse, error) {}

func (m *MockEndpoint) getPreferredAllocation(available, mustInclude []string, size int) (*pluginapi.PreferredAllocationResponse, error) {}

func (m *MockEndpoint) allocate(devs []string) (*pluginapi.AllocateResponse, error) {}

func (m *MockEndpoint) setStopTime(t time.Time) {}

func (m *MockEndpoint) isStopped() bool {}

func (m *MockEndpoint) stopGracePeriodExpired() bool {}

func makePod(limits v1.ResourceList) *v1.Pod {}

func getTestManager(tmpDir string, activePods ActivePodsFunc, testRes []TestResource) (*wrappedManagerImpl, error) {}

type TestResource

func TestFilterByAffinity(t *testing.T) {}

func TestPodContainerDeviceAllocation(t *testing.T) {}

func TestPodContainerDeviceToAllocate(t *testing.T) {}

func TestDevicesToAllocateConflictWithUpdateAllocatedDevices(t *testing.T) {}

func TestGetDeviceRunContainerOptions(t *testing.T) {}

func TestInitContainerDeviceAllocation(t *testing.T) {}

func TestRestartableInitContainerDeviceAllocation(t *testing.T) {}

func TestUpdatePluginResources(t *testing.T) {}

func TestDevicePreStartContainer(t *testing.T) {}

func TestResetExtendedResource(t *testing.T) {}

func allocateStubFunc() func(devs []string) (*pluginapi.AllocateResponse, error) {}

func makeDevice(devOnNUMA checkpoint.DevicesPerNUMA, topology bool) map[string]pluginapi.Device {}

func TestGetTopologyHintsWithUpdates(t *testing.T) {}

func TestUpdateAllocatedResourcesStatus(t *testing.T) {}

// Helper function to sort ResourceHealth slices
func sortResourceHealth(resources []v1.ResourceHealth) {}

// Helper function to sort ContainerStatus slices
func sortContainerStatuses(statuses []v1.ContainerStatus) {}

func TestFeatureGateResourceHealthStatus(t *testing.T) {}