[no-relnote] Update CDI tests for new whitespace formatting

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar 2025-04-02 11:25:38 +02:00
parent 5549824559
commit 1c845ea2d5
No known key found for this signature in database
4 changed files with 125 additions and 125 deletions
cmd
nvidia-ctk-installer/container/toolkit
nvidia-ctk/cdi/generate
pkg/nvcdi

View File

@ -71,45 +71,45 @@ func TestInstall(t *testing.T) {
cdiVersion: 0.5.0
kind: example.com/class
devices:
- name: all
containerEdits:
deviceNodes:
- path: /dev/nvidia0
hostPath: /host/driver/root/dev/nvidia0
- path: /dev/nvidiactl
hostPath: /host/driver/root/dev/nvidiactl
- path: /dev/nvidia-caps-imex-channels/channel0
hostPath: /host/driver/root/dev/nvidia-caps-imex-channels/channel0
- path: /dev/nvidia-caps-imex-channels/channel1
hostPath: /host/driver/root/dev/nvidia-caps-imex-channels/channel1
- path: /dev/nvidia-caps-imex-channels/channel2047
hostPath: /host/driver/root/dev/nvidia-caps-imex-channels/channel2047
- name: all
containerEdits:
deviceNodes:
- path: /dev/nvidia0
hostPath: /host/driver/root/dev/nvidia0
- path: /dev/nvidiactl
hostPath: /host/driver/root/dev/nvidiactl
- path: /dev/nvidia-caps-imex-channels/channel0
hostPath: /host/driver/root/dev/nvidia-caps-imex-channels/channel0
- path: /dev/nvidia-caps-imex-channels/channel1
hostPath: /host/driver/root/dev/nvidia-caps-imex-channels/channel1
- path: /dev/nvidia-caps-imex-channels/channel2047
hostPath: /host/driver/root/dev/nvidia-caps-imex-channels/channel2047
containerEdits:
env:
- NVIDIA_VISIBLE_DEVICES=void
hooks:
- hookName: createContainer
path: {{ .toolkitRoot }}/nvidia-cdi-hook
args:
- nvidia-cdi-hook
- create-symlinks
- --link
- libcuda.so.1::/lib/x86_64-linux-gnu/libcuda.so
- hookName: createContainer
path: {{ .toolkitRoot }}/nvidia-cdi-hook
args:
- nvidia-cdi-hook
- update-ldcache
- --folder
- /lib/x86_64-linux-gnu
mounts:
- hostPath: /host/driver/root/lib/x86_64-linux-gnu/libcuda.so.999.88.77
containerPath: /lib/x86_64-linux-gnu/libcuda.so.999.88.77
options:
- ro
- nosuid
- nodev
- bind
env:
- NVIDIA_VISIBLE_DEVICES=void
hooks:
- hookName: createContainer
path: {{ .toolkitRoot }}/nvidia-cdi-hook
args:
- nvidia-cdi-hook
- create-symlinks
- --link
- libcuda.so.1::/lib/x86_64-linux-gnu/libcuda.so
- hookName: createContainer
path: {{ .toolkitRoot }}/nvidia-cdi-hook
args:
- nvidia-cdi-hook
- update-ldcache
- --folder
- /lib/x86_64-linux-gnu
mounts:
- hostPath: /host/driver/root/lib/x86_64-linux-gnu/libcuda.so.999.88.77
containerPath: /lib/x86_64-linux-gnu/libcuda.so.999.88.77
options:
- ro
- nosuid
- nodev
- bind
`,
},
}

View File

@ -67,51 +67,51 @@ func TestGenerateSpec(t *testing.T) {
cdiVersion: 0.5.0
kind: example.com/device
devices:
- name: "0"
containerEdits:
deviceNodes:
- path: /dev/nvidia0
hostPath: {{ .driverRoot }}/dev/nvidia0
- name: all
containerEdits:
deviceNodes:
- path: /dev/nvidia0
hostPath: {{ .driverRoot }}/dev/nvidia0
- name: "0"
containerEdits:
deviceNodes:
- path: /dev/nvidia0
hostPath: {{ .driverRoot }}/dev/nvidia0
- name: all
containerEdits:
deviceNodes:
- path: /dev/nvidia0
hostPath: {{ .driverRoot }}/dev/nvidia0
containerEdits:
env:
- NVIDIA_VISIBLE_DEVICES=void
deviceNodes:
- path: /dev/nvidiactl
hostPath: {{ .driverRoot }}/dev/nvidiactl
hooks:
- hookName: createContainer
path: /usr/bin/nvidia-cdi-hook
args:
- nvidia-cdi-hook
- create-symlinks
- --link
- libcuda.so.1::/lib/x86_64-linux-gnu/libcuda.so
- hookName: createContainer
path: /usr/bin/nvidia-cdi-hook
args:
- nvidia-cdi-hook
- enable-cuda-compat
- --host-driver-version=999.88.77
- hookName: createContainer
path: /usr/bin/nvidia-cdi-hook
args:
- nvidia-cdi-hook
- update-ldcache
- --folder
- /lib/x86_64-linux-gnu
mounts:
- hostPath: {{ .driverRoot }}/lib/x86_64-linux-gnu/libcuda.so.999.88.77
containerPath: /lib/x86_64-linux-gnu/libcuda.so.999.88.77
options:
- ro
- nosuid
- nodev
- bind
env:
- NVIDIA_VISIBLE_DEVICES=void
deviceNodes:
- path: /dev/nvidiactl
hostPath: {{ .driverRoot }}/dev/nvidiactl
hooks:
- hookName: createContainer
path: /usr/bin/nvidia-cdi-hook
args:
- nvidia-cdi-hook
- create-symlinks
- --link
- libcuda.so.1::/lib/x86_64-linux-gnu/libcuda.so
- hookName: createContainer
path: /usr/bin/nvidia-cdi-hook
args:
- nvidia-cdi-hook
- enable-cuda-compat
- --host-driver-version=999.88.77
- hookName: createContainer
path: /usr/bin/nvidia-cdi-hook
args:
- nvidia-cdi-hook
- update-ldcache
- --folder
- /lib/x86_64-linux-gnu
mounts:
- hostPath: {{ .driverRoot }}/lib/x86_64-linux-gnu/libcuda.so.999.88.77
containerPath: /lib/x86_64-linux-gnu/libcuda.so.999.88.77
options:
- ro
- nosuid
- nodev
- bind
`,
},
}

View File

@ -41,24 +41,24 @@ func TestImexMode(t *testing.T) {
cdiVersion: 0.5.0
kind: nvidia.com/imex-channel
devices:
- name: "0"
containerEdits:
deviceNodes:
- path: /dev/nvidia-caps-imex-channels/channel0
hostPath: {{ .hostRoot }}/dev/nvidia-caps-imex-channels/channel0
- name: "1"
containerEdits:
deviceNodes:
- path: /dev/nvidia-caps-imex-channels/channel1
hostPath: {{ .hostRoot }}/dev/nvidia-caps-imex-channels/channel1
- name: "2047"
containerEdits:
deviceNodes:
- path: /dev/nvidia-caps-imex-channels/channel2047
hostPath: {{ .hostRoot }}/dev/nvidia-caps-imex-channels/channel2047
- name: "0"
containerEdits:
deviceNodes:
- path: /dev/nvidia-caps-imex-channels/channel0
hostPath: {{ .hostRoot }}/dev/nvidia-caps-imex-channels/channel0
- name: "1"
containerEdits:
deviceNodes:
- path: /dev/nvidia-caps-imex-channels/channel1
hostPath: {{ .hostRoot }}/dev/nvidia-caps-imex-channels/channel1
- name: "2047"
containerEdits:
deviceNodes:
- path: /dev/nvidia-caps-imex-channels/channel2047
hostPath: {{ .hostRoot }}/dev/nvidia-caps-imex-channels/channel2047
containerEdits:
env:
- NVIDIA_VISIBLE_DEVICES=void
env:
- NVIDIA_VISIBLE_DEVICES=void
`
expectedSpec = strings.ReplaceAll(expectedSpec, "{{ .hostRoot }}", hostRoot)

View File

@ -54,10 +54,10 @@ func TestSpec(t *testing.T) {
cdiVersion: 0.8.0
kind: nvidia.com/gpu
devices:
- name: one
containerEdits:
env:
- DEVICE_FOO=bar
- name: one
containerEdits:
env:
- DEVICE_FOO=bar
`,
},
{
@ -80,10 +80,10 @@ devices:
cdiVersion: 0.5.0
kind: nvidia.com/gpu
devices:
- name: one
containerEdits:
env:
- DEVICE_FOO=bar
- name: one
containerEdits:
env:
- DEVICE_FOO=bar
`,
},
{
@ -105,10 +105,10 @@ devices:
cdiVersion: 0.3.0
kind: nvidia.com/gpu
devices:
- name: one
containerEdits:
env:
- DEVICE_FOO=bar
- name: one
containerEdits:
env:
- DEVICE_FOO=bar
`,
},
{
@ -138,14 +138,14 @@ devices:
cdiVersion: 0.5.0
kind: nvidia.com/gpu
devices:
- name: one
containerEdits:
env:
- DEVICE_FOO=bar
- name: one
containerEdits:
env:
- DEVICE_FOO=bar
containerEdits:
deviceNodes:
- path: /dev/dev0
hostPath: /some/dev/dev0
deviceNodes:
- path: /dev/dev0
hostPath: /some/dev/dev0
`,
},
{
@ -183,14 +183,14 @@ containerEdits:
cdiVersion: 0.5.0
kind: nvidia.com/gpu
devices:
- name: one
containerEdits:
env:
- DEVICE_FOO=bar
- name: one
containerEdits:
env:
- DEVICE_FOO=bar
containerEdits:
deviceNodes:
- path: /dev/dev0
hostPath: /dev/dev0
deviceNodes:
- path: /dev/dev0
hostPath: /dev/dev0
`,
},
}