Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFullGPU ¶
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.