MCPcopy Create free account
hub / github.com/NVIDIA/gpu-operator / TestTransformDriverRDMA

Function TestTransformDriverRDMA

controllers/transforms_test.go:3751–3838  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3749}
3750
3751func TestTransformDriverRDMA(t *testing.T) {
3752 node := &corev1.Node{
3753 ObjectMeta: metav1.ObjectMeta{
3754 Name: "test-node",
3755 Labels: map[string]string{
3756 nfdOSReleaseIDLabelKey: "ubuntu",
3757 nfdOSVersionIDLabelKey: "20.04",
3758 nfdKernelLabelKey: "6.8.0-60-generic",
3759 commonGPULabelKey: "true",
3760 },
3761 },
3762 }
3763 mockClient := fake.NewFakeClient(node)
3764 ds := NewDaemonset().WithContainer(corev1.Container{Name: "nvidia-driver-ctr"}).
3765 WithContainer(corev1.Container{Name: "nvidia-fs"}).
3766 WithContainer(corev1.Container{Name: "nvidia-gdrcopy"}).
3767 WithContainer(corev1.Container{Name: "nvidia-peermem"}).
3768 WithInitContainer(corev1.Container{Name: "k8s-driver-manager"})
3769 cpSpec := &gpuv1.ClusterPolicySpec{
3770 Driver: gpuv1.DriverSpec{
3771 Repository: "nvcr.io/nvidia",
3772 Image: "driver",
3773 Version: "570.172.08",
3774 Manager: gpuv1.DriverManagerSpec{
3775 Repository: "nvcr.io/nvidia/cloud-native",
3776 Image: "k8s-driver-manager",
3777 Version: "v0.8.0",
3778 },
3779 GPUDirectRDMA: &gpuv1.GPUDirectRDMASpec{
3780 Enabled: newBoolPtr(true),
3781 UseHostMOFED: newBoolPtr(true),
3782 },
3783 },
3784 }
3785
3786 expectedDs := NewDaemonset().WithContainer(corev1.Container{
3787 Name: "nvidia-driver-ctr",
3788 Image: "nvcr.io/nvidia/driver:570.172.08-ubuntu20.04",
3789 ImagePullPolicy: corev1.PullIfNotPresent,
3790 Env: []corev1.EnvVar{
3791 {
3792 Name: "GPU_DIRECT_RDMA_ENABLED",
3793 Value: "true",
3794 },
3795 {
3796 Name: "USE_HOST_MOFED",
3797 Value: "true",
3798 },
3799 {
3800 Name: "DRIVER_CONFIG_DIGEST",
3801 Value: "785503300",
3802 },
3803 },
3804 }).WithInitContainer(corev1.Container{
3805 Name: "k8s-driver-manager",
3806 Image: "nvcr.io/nvidia/cloud-native/k8s-driver-manager:v0.8.0",
3807 Env: []corev1.EnvVar{
3808 {

Callers

nothing calls this directly

Calls 6

NewDaemonsetFunction · 0.85
newBoolPtrFunction · 0.85
TransformDriverFunction · 0.85
WithContainerMethod · 0.80
WithNameMethod · 0.80
WithInitContainerMethod · 0.45

Tested by

no test coverage detected