Add ability to consider container mounts to generate nvidiaConfig

Signed-off-by: Kevin Klues <kklues@nvidia.com>
This commit is contained in:
Kevin Klues
2020-07-23 13:50:42 +00:00
parent da36874e91
commit 2ae7cb07cf
2 changed files with 14 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ import (
"testing"
)
func TestGetNvidiaConfig(t *testing.T) {
func TestGetNvidiaConfigEnvvar(t *testing.T) {
var tests = []struct {
description string
env map[string]string
@@ -407,7 +407,7 @@ func TestGetNvidiaConfig(t *testing.T) {
// Wrap the call to getNvidiaConfig() in a closure.
var config *nvidiaConfig
getConfig := func() {
config = getNvidiaConfig(tc.env, tc.privileged)
config = getNvidiaConfig(tc.env, nil, tc.privileged)
}
// For any tests that are expected to panic, make sure they do.