2018-09-01 00:08:36 +00:00
|
|
|
package nvidia
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/nomad/plugins/device/cmd/nvidia/nvml"
|
|
|
|
)
|
|
|
|
|
|
|
|
type MockNvmlClient struct {
|
|
|
|
FingerprintError error
|
|
|
|
FingerprintResponseReturned *nvml.FingerprintData
|
2018-09-07 17:13:50 +00:00
|
|
|
|
|
|
|
StatsError error
|
|
|
|
StatsResponseReturned []*nvml.StatsData
|
2018-09-01 00:08:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (c *MockNvmlClient) GetFingerprintData() (*nvml.FingerprintData, error) {
|
|
|
|
return c.FingerprintResponseReturned, c.FingerprintError
|
|
|
|
}
|
2018-09-07 17:13:50 +00:00
|
|
|
|
|
|
|
func (c *MockNvmlClient) GetStatsData() ([]*nvml.StatsData, error) {
|
|
|
|
return c.StatsResponseReturned, c.StatsError
|
|
|
|
}
|