testutil

package
v0.0.0-...-ed416e0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package testutil holds different utilities and stubs for testing

Index

Constants

View Source
const DefaultGpuCores = 10

DefaultGpuCores is the default number of cores for a GPU device in the mock.

Variables

View Source
var DefaultGpuUUID = GPUUUIDs[0]

DefaultGpuUUID is the UUID for the default device returned by the mock

View Source
var GPUCores = []int{DefaultGpuCores, 20, 30}

GPUCores is a list of number of cores for the devices returned by the mock, should be the same length as GPUUUIDs

View Source
var GPUUUIDs = []string{
	"GPU-12345678-1234-1234-1234-123456789012",
	"GPU-99999999-1234-1234-1234-123456789013",
	"GPU-00000000-1234-1234-1234-123456789014",
}

GPUUUIDs is a list of UUIDs for the devices returned by the mock

Functions

func GetBasicNvmlMock

func GetBasicNvmlMock() *nvmlmock.Interface

GetBasicNvmlMock returns a mock of the nvml.Interface with a single device with 10 cores, useful for basic tests that need only the basic interaction with NVML to be working.

func GetDeviceMock

func GetDeviceMock(deviceIdx int) *nvmlmock.Device

GetDeviceMock returns a mock of the nvml.Device with the given UUID.

Types

This section is empty.

Jump to

Keyboard shortcuts

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