testutil

package
v0.12.13 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClockSpeedDevice

func CreateClockSpeedDevice(graphicsClock uint32, graphicsClockRet nvml.Return, memClock uint32, memClockRet nvml.Return, uuid string) device.Device

CreateClockSpeedDevice creates a new mock device specifically for clock speed testing

func CreateGPMSampleDevice

func CreateGPMSampleDevice(
	uuid string,
	sampleGetRet nvml.Return,
) device.Device

CreateGPMSampleDevice creates a mock device for GPM sample testing

func CreateGPMSupportedDevice

func CreateGPMSupportedDevice(
	uuid string,
	gpmDeviceSupport nvml.GpmSupport,
	gpmDeviceSupportRet nvml.Return,
) device.Device

CreateGPMSupportedDevice creates a mock device for GPM support testing

func CreateGSPFirmwareDevice

func CreateGSPFirmwareDevice(
	uuid string,
	gspEnabled bool,
	gspSupported bool,
	gspFirmwareRet nvml.Return,
) device.Device

CreateGSPFirmwareDevice creates a new mock device specifically for GSP firmware tests

func CreateMemoryDevice

func CreateMemoryDevice(uuid string, memoryV2 nvml.Memory_v2, memoryV2Ret nvml.Return, memory nvml.Memory, memoryRet nvml.Return) device.Device

CreateMemoryDevice creates a new mock device specifically for memory tests

func CreatePersistenceModeDevice

func CreatePersistenceModeDevice(
	uuid string,
	persistenceMode nvml.EnableState,
	persistenceModeRet nvml.Return,
) device.Device

CreatePersistenceModeDevice creates a new mock device for persistence mode testing

Types

type MockDevice

type MockDevice struct {
	*mock.Device
	Architecture          string
	Brand                 string
	CudaComputeCapability string
	BusID                 string
	DeviceUUID            string
	Serial                string
	MinorNumber           int
	BoardID               uint32
}

func NewMockDevice

func NewMockDevice(device *mock.Device, architecture, brand, cudaComputeCapability, pciBusID string) *MockDevice

NewMockDevice creates a new mock device with the given parameters

func NewMockDeviceWithIDs

func NewMockDeviceWithIDs(device *mock.Device, architecture, brand, cudaComputeCapability, pciBusID, uuid, serial string, minorNumber int, boardID uint32) *MockDevice

NewMockDeviceWithIDs creates a new mock device with the given parameters including serial and minor number

func (*MockDevice) GetArchitectureAsString

func (d *MockDevice) GetArchitectureAsString() (string, error)

func (*MockDevice) GetBoardId

func (d *MockDevice) GetBoardId() (uint32, nvml.Return)

func (*MockDevice) GetBrandAsString

func (d *MockDevice) GetBrandAsString() (string, error)

func (*MockDevice) GetCudaComputeCapabilityAsString

func (d *MockDevice) GetCudaComputeCapabilityAsString() (string, error)

func (*MockDevice) GetFabricState

func (d *MockDevice) GetFabricState() (device.FabricState, error)

func (*MockDevice) GetMigDevices

func (d *MockDevice) GetMigDevices() ([]nvlibdevice.MigDevice, error)

func (*MockDevice) GetMigProfiles

func (d *MockDevice) GetMigProfiles() ([]nvlibdevice.MigProfile, error)

func (*MockDevice) GetMinorNumber

func (d *MockDevice) GetMinorNumber() (int, nvml.Return)

func (*MockDevice) GetPCIBusID

func (d *MockDevice) GetPCIBusID() (string, error)

func (*MockDevice) GetSerial

func (d *MockDevice) GetSerial() (string, nvml.Return)

func (*MockDevice) IsCoherent

func (d *MockDevice) IsCoherent() (bool, error)

func (*MockDevice) IsFabricAttached

func (d *MockDevice) IsFabricAttached() (bool, error)

func (*MockDevice) IsMigCapable

func (d *MockDevice) IsMigCapable() (bool, error)

func (*MockDevice) IsMigEnabled

func (d *MockDevice) IsMigEnabled() (bool, error)

func (*MockDevice) PCIBusID

func (d *MockDevice) PCIBusID() string

func (*MockDevice) UUID

func (d *MockDevice) UUID() string

func (*MockDevice) VisitMigDevices

func (d *MockDevice) VisitMigDevices(func(j int, m nvlibdevice.MigDevice) error) error

func (*MockDevice) VisitMigProfiles

func (d *MockDevice) VisitMigProfiles(func(p nvlibdevice.MigProfile) error) error

Jump to

Keyboard shortcuts

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