testing

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFullGPU

func NewFullGPU() resource.Device

NewFullGPU creates a device that can be treated as a full GPU for testing

func NewMigDevice

func NewMigDevice(gi int, ci int, gb uint64, attributes ...map[string]interface{}) *resource.DeviceMock

NewMigDevice creates a MIG devices with the specified attributes for testing

func NewMigEnabledDevice

func NewMigEnabledDevice(migs ...*resource.DeviceMock) resource.Device

NewMigEnabledDevice creates a GPU with MIG enabled and the specified MIG devices

Types

type DeviceMock

type DeviceMock struct {
	resource.DeviceMock
}

DeviceMock provides an alias that allows for additional functions to be defined.

func NewDeviceMock

func NewDeviceMock(migEnabled bool) *DeviceMock

NewDeviceMock creates a devices for testing which can have MIG enabled or disabled.

func (*DeviceMock) WithMigDevices

func (d *DeviceMock) WithMigDevices(migs ...*resource.DeviceMock) *DeviceMock

WithMigDevices adds the specified MIG devices to the mocked device

type ManagerMock

type ManagerMock struct {
	resource.ManagerMock
}

ManagerMock provides an alias that allows for additional functions to be defined.

func NewManagerMockWithDevices

func NewManagerMockWithDevices(devices ...resource.Device) *ManagerMock

NewManagerMockWithDevices creates a mocked manager with the specified devices

func (*ManagerMock) WithErrorOnInit

func (m *ManagerMock) WithErrorOnInit(err error) *ManagerMock

WithErrorOnInit sets the Init function for the ManagerMock to error if called.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL