Skip to content

Commit 95a152a

Browse files
committed
Fix generate tests when cdi hook exists in path
The TestGenerateSpec unit tests resolve the path to the nvidia-cdi-hook binary if it exists on the system making the results dependent on system configuration. This change sets the path to the binary explicitly to skip the resolution in the path. Signed-off-by: Evan Lezar <[email protected]>
1 parent 8a85cad commit 95a152a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/nvidia-ctk/cdi/generate/generate_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,9 @@ containerEdits:
450450
}
451451

452452
for _, tc := range testCases {
453+
// Apply overrides for all test cases:
454+
tc.options.nvidiaCDIHookPath = "/usr/bin/nvidia-cdi-hook"
455+
453456
t.Run(tc.description, func(t *testing.T) {
454457
c := command{
455458
logger: logger,

0 commit comments

Comments
 (0)