@@ -27,9 +27,26 @@ import (
2727
2828func TestGetConfigWithCustomConfig (t * testing.T ) {
2929 testDir := t .TempDir ()
30- t .Setenv (configOverride , testDir )
30+ t .Setenv (configRootOverride , testDir )
3131
32- filename := filepath .Join (testDir , configFilePath )
32+ filename := filepath .Join (testDir , RelativeFilePath )
33+
34+ // By default debug is disabled
35+ contents := []byte ("[nvidia-container-runtime]\n debug = \" /nvidia-container-toolkit.log\" " )
36+
37+ require .NoError (t , os .MkdirAll (filepath .Dir (filename ), 0766 ))
38+ require .NoError (t , os .WriteFile (filename , contents , 0600 ))
39+
40+ cfg , err := GetConfig ()
41+ require .NoError (t , err )
42+ require .Equal (t , "/nvidia-container-toolkit.log" , cfg .NVIDIAContainerRuntimeConfig .DebugFilePath )
43+ }
44+
45+ func TestGetConfigWithConfigFilePathOverride (t * testing.T ) {
46+ testDir := t .TempDir ()
47+ filename := filepath .Join (testDir , RelativeFilePath )
48+
49+ t .Setenv (FilePathOverrideEnvVar , filename )
3350
3451 // By default debug is disabled
3552 contents := []byte ("[nvidia-container-runtime]\n debug = \" /nvidia-container-toolkit.log\" " )
0 commit comments