mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-15 19:09:19 +00:00
[no-relnote] Update CDI tests for new whitespace formatting
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
5549824559
commit
1c845ea2d5
@ -71,45 +71,45 @@ func TestInstall(t *testing.T) {
|
|||||||
cdiVersion: 0.5.0
|
cdiVersion: 0.5.0
|
||||||
kind: example.com/class
|
kind: example.com/class
|
||||||
devices:
|
devices:
|
||||||
- name: all
|
- name: all
|
||||||
containerEdits:
|
containerEdits:
|
||||||
deviceNodes:
|
deviceNodes:
|
||||||
- path: /dev/nvidia0
|
- path: /dev/nvidia0
|
||||||
hostPath: /host/driver/root/dev/nvidia0
|
hostPath: /host/driver/root/dev/nvidia0
|
||||||
- path: /dev/nvidiactl
|
- path: /dev/nvidiactl
|
||||||
hostPath: /host/driver/root/dev/nvidiactl
|
hostPath: /host/driver/root/dev/nvidiactl
|
||||||
- path: /dev/nvidia-caps-imex-channels/channel0
|
- path: /dev/nvidia-caps-imex-channels/channel0
|
||||||
hostPath: /host/driver/root/dev/nvidia-caps-imex-channels/channel0
|
hostPath: /host/driver/root/dev/nvidia-caps-imex-channels/channel0
|
||||||
- path: /dev/nvidia-caps-imex-channels/channel1
|
- path: /dev/nvidia-caps-imex-channels/channel1
|
||||||
hostPath: /host/driver/root/dev/nvidia-caps-imex-channels/channel1
|
hostPath: /host/driver/root/dev/nvidia-caps-imex-channels/channel1
|
||||||
- path: /dev/nvidia-caps-imex-channels/channel2047
|
- path: /dev/nvidia-caps-imex-channels/channel2047
|
||||||
hostPath: /host/driver/root/dev/nvidia-caps-imex-channels/channel2047
|
hostPath: /host/driver/root/dev/nvidia-caps-imex-channels/channel2047
|
||||||
containerEdits:
|
containerEdits:
|
||||||
env:
|
env:
|
||||||
- NVIDIA_VISIBLE_DEVICES=void
|
- NVIDIA_VISIBLE_DEVICES=void
|
||||||
hooks:
|
hooks:
|
||||||
- hookName: createContainer
|
- hookName: createContainer
|
||||||
path: {{ .toolkitRoot }}/nvidia-cdi-hook
|
path: {{ .toolkitRoot }}/nvidia-cdi-hook
|
||||||
args:
|
args:
|
||||||
- nvidia-cdi-hook
|
- nvidia-cdi-hook
|
||||||
- create-symlinks
|
- create-symlinks
|
||||||
- --link
|
- --link
|
||||||
- libcuda.so.1::/lib/x86_64-linux-gnu/libcuda.so
|
- libcuda.so.1::/lib/x86_64-linux-gnu/libcuda.so
|
||||||
- hookName: createContainer
|
- hookName: createContainer
|
||||||
path: {{ .toolkitRoot }}/nvidia-cdi-hook
|
path: {{ .toolkitRoot }}/nvidia-cdi-hook
|
||||||
args:
|
args:
|
||||||
- nvidia-cdi-hook
|
- nvidia-cdi-hook
|
||||||
- update-ldcache
|
- update-ldcache
|
||||||
- --folder
|
- --folder
|
||||||
- /lib/x86_64-linux-gnu
|
- /lib/x86_64-linux-gnu
|
||||||
mounts:
|
mounts:
|
||||||
- hostPath: /host/driver/root/lib/x86_64-linux-gnu/libcuda.so.999.88.77
|
- 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
|
containerPath: /lib/x86_64-linux-gnu/libcuda.so.999.88.77
|
||||||
options:
|
options:
|
||||||
- ro
|
- ro
|
||||||
- nosuid
|
- nosuid
|
||||||
- nodev
|
- nodev
|
||||||
- bind
|
- bind
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -67,51 +67,51 @@ func TestGenerateSpec(t *testing.T) {
|
|||||||
cdiVersion: 0.5.0
|
cdiVersion: 0.5.0
|
||||||
kind: example.com/device
|
kind: example.com/device
|
||||||
devices:
|
devices:
|
||||||
- name: "0"
|
- name: "0"
|
||||||
containerEdits:
|
containerEdits:
|
||||||
deviceNodes:
|
deviceNodes:
|
||||||
- path: /dev/nvidia0
|
- path: /dev/nvidia0
|
||||||
hostPath: {{ .driverRoot }}/dev/nvidia0
|
hostPath: {{ .driverRoot }}/dev/nvidia0
|
||||||
- name: all
|
- name: all
|
||||||
containerEdits:
|
containerEdits:
|
||||||
deviceNodes:
|
deviceNodes:
|
||||||
- path: /dev/nvidia0
|
- path: /dev/nvidia0
|
||||||
hostPath: {{ .driverRoot }}/dev/nvidia0
|
hostPath: {{ .driverRoot }}/dev/nvidia0
|
||||||
containerEdits:
|
containerEdits:
|
||||||
env:
|
env:
|
||||||
- NVIDIA_VISIBLE_DEVICES=void
|
- NVIDIA_VISIBLE_DEVICES=void
|
||||||
deviceNodes:
|
deviceNodes:
|
||||||
- path: /dev/nvidiactl
|
- path: /dev/nvidiactl
|
||||||
hostPath: {{ .driverRoot }}/dev/nvidiactl
|
hostPath: {{ .driverRoot }}/dev/nvidiactl
|
||||||
hooks:
|
hooks:
|
||||||
- hookName: createContainer
|
- hookName: createContainer
|
||||||
path: /usr/bin/nvidia-cdi-hook
|
path: /usr/bin/nvidia-cdi-hook
|
||||||
args:
|
args:
|
||||||
- nvidia-cdi-hook
|
- nvidia-cdi-hook
|
||||||
- create-symlinks
|
- create-symlinks
|
||||||
- --link
|
- --link
|
||||||
- libcuda.so.1::/lib/x86_64-linux-gnu/libcuda.so
|
- libcuda.so.1::/lib/x86_64-linux-gnu/libcuda.so
|
||||||
- hookName: createContainer
|
- hookName: createContainer
|
||||||
path: /usr/bin/nvidia-cdi-hook
|
path: /usr/bin/nvidia-cdi-hook
|
||||||
args:
|
args:
|
||||||
- nvidia-cdi-hook
|
- nvidia-cdi-hook
|
||||||
- enable-cuda-compat
|
- enable-cuda-compat
|
||||||
- --host-driver-version=999.88.77
|
- --host-driver-version=999.88.77
|
||||||
- hookName: createContainer
|
- hookName: createContainer
|
||||||
path: /usr/bin/nvidia-cdi-hook
|
path: /usr/bin/nvidia-cdi-hook
|
||||||
args:
|
args:
|
||||||
- nvidia-cdi-hook
|
- nvidia-cdi-hook
|
||||||
- update-ldcache
|
- update-ldcache
|
||||||
- --folder
|
- --folder
|
||||||
- /lib/x86_64-linux-gnu
|
- /lib/x86_64-linux-gnu
|
||||||
mounts:
|
mounts:
|
||||||
- hostPath: {{ .driverRoot }}/lib/x86_64-linux-gnu/libcuda.so.999.88.77
|
- hostPath: {{ .driverRoot }}/lib/x86_64-linux-gnu/libcuda.so.999.88.77
|
||||||
containerPath: /lib/x86_64-linux-gnu/libcuda.so.999.88.77
|
containerPath: /lib/x86_64-linux-gnu/libcuda.so.999.88.77
|
||||||
options:
|
options:
|
||||||
- ro
|
- ro
|
||||||
- nosuid
|
- nosuid
|
||||||
- nodev
|
- nodev
|
||||||
- bind
|
- bind
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -41,24 +41,24 @@ func TestImexMode(t *testing.T) {
|
|||||||
cdiVersion: 0.5.0
|
cdiVersion: 0.5.0
|
||||||
kind: nvidia.com/imex-channel
|
kind: nvidia.com/imex-channel
|
||||||
devices:
|
devices:
|
||||||
- name: "0"
|
- name: "0"
|
||||||
containerEdits:
|
containerEdits:
|
||||||
deviceNodes:
|
deviceNodes:
|
||||||
- path: /dev/nvidia-caps-imex-channels/channel0
|
- path: /dev/nvidia-caps-imex-channels/channel0
|
||||||
hostPath: {{ .hostRoot }}/dev/nvidia-caps-imex-channels/channel0
|
hostPath: {{ .hostRoot }}/dev/nvidia-caps-imex-channels/channel0
|
||||||
- name: "1"
|
- name: "1"
|
||||||
containerEdits:
|
containerEdits:
|
||||||
deviceNodes:
|
deviceNodes:
|
||||||
- path: /dev/nvidia-caps-imex-channels/channel1
|
- path: /dev/nvidia-caps-imex-channels/channel1
|
||||||
hostPath: {{ .hostRoot }}/dev/nvidia-caps-imex-channels/channel1
|
hostPath: {{ .hostRoot }}/dev/nvidia-caps-imex-channels/channel1
|
||||||
- name: "2047"
|
- name: "2047"
|
||||||
containerEdits:
|
containerEdits:
|
||||||
deviceNodes:
|
deviceNodes:
|
||||||
- path: /dev/nvidia-caps-imex-channels/channel2047
|
- path: /dev/nvidia-caps-imex-channels/channel2047
|
||||||
hostPath: {{ .hostRoot }}/dev/nvidia-caps-imex-channels/channel2047
|
hostPath: {{ .hostRoot }}/dev/nvidia-caps-imex-channels/channel2047
|
||||||
containerEdits:
|
containerEdits:
|
||||||
env:
|
env:
|
||||||
- NVIDIA_VISIBLE_DEVICES=void
|
- NVIDIA_VISIBLE_DEVICES=void
|
||||||
`
|
`
|
||||||
expectedSpec = strings.ReplaceAll(expectedSpec, "{{ .hostRoot }}", hostRoot)
|
expectedSpec = strings.ReplaceAll(expectedSpec, "{{ .hostRoot }}", hostRoot)
|
||||||
|
|
||||||
|
@ -54,10 +54,10 @@ func TestSpec(t *testing.T) {
|
|||||||
cdiVersion: 0.8.0
|
cdiVersion: 0.8.0
|
||||||
kind: nvidia.com/gpu
|
kind: nvidia.com/gpu
|
||||||
devices:
|
devices:
|
||||||
- name: one
|
- name: one
|
||||||
containerEdits:
|
containerEdits:
|
||||||
env:
|
env:
|
||||||
- DEVICE_FOO=bar
|
- DEVICE_FOO=bar
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -80,10 +80,10 @@ devices:
|
|||||||
cdiVersion: 0.5.0
|
cdiVersion: 0.5.0
|
||||||
kind: nvidia.com/gpu
|
kind: nvidia.com/gpu
|
||||||
devices:
|
devices:
|
||||||
- name: one
|
- name: one
|
||||||
containerEdits:
|
containerEdits:
|
||||||
env:
|
env:
|
||||||
- DEVICE_FOO=bar
|
- DEVICE_FOO=bar
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -105,10 +105,10 @@ devices:
|
|||||||
cdiVersion: 0.3.0
|
cdiVersion: 0.3.0
|
||||||
kind: nvidia.com/gpu
|
kind: nvidia.com/gpu
|
||||||
devices:
|
devices:
|
||||||
- name: one
|
- name: one
|
||||||
containerEdits:
|
containerEdits:
|
||||||
env:
|
env:
|
||||||
- DEVICE_FOO=bar
|
- DEVICE_FOO=bar
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -138,14 +138,14 @@ devices:
|
|||||||
cdiVersion: 0.5.0
|
cdiVersion: 0.5.0
|
||||||
kind: nvidia.com/gpu
|
kind: nvidia.com/gpu
|
||||||
devices:
|
devices:
|
||||||
- name: one
|
- name: one
|
||||||
containerEdits:
|
containerEdits:
|
||||||
env:
|
env:
|
||||||
- DEVICE_FOO=bar
|
- DEVICE_FOO=bar
|
||||||
containerEdits:
|
containerEdits:
|
||||||
deviceNodes:
|
deviceNodes:
|
||||||
- path: /dev/dev0
|
- path: /dev/dev0
|
||||||
hostPath: /some/dev/dev0
|
hostPath: /some/dev/dev0
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -183,14 +183,14 @@ containerEdits:
|
|||||||
cdiVersion: 0.5.0
|
cdiVersion: 0.5.0
|
||||||
kind: nvidia.com/gpu
|
kind: nvidia.com/gpu
|
||||||
devices:
|
devices:
|
||||||
- name: one
|
- name: one
|
||||||
containerEdits:
|
containerEdits:
|
||||||
env:
|
env:
|
||||||
- DEVICE_FOO=bar
|
- DEVICE_FOO=bar
|
||||||
containerEdits:
|
containerEdits:
|
||||||
deviceNodes:
|
deviceNodes:
|
||||||
- path: /dev/dev0
|
- path: /dev/dev0
|
||||||
hostPath: /dev/dev0
|
hostPath: /dev/dev0
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user