mirror of
				https://github.com/NVIDIA/nvidia-container-toolkit
				synced 2025-06-26 18:18:24 +00:00 
			
		
		
		
	Update root transformer tests to ensure container path is not modified
Signed-off-by: Christopher Desiniotis <cdesiniotis@nvidia.com>
This commit is contained in:
		
							parent
							
								
									45ed3b0412
								
							
						
					
					
						commit
						87e406eee6
					
				| @ -52,18 +52,18 @@ func TestRootTransformer(t *testing.T) { | |||||||
| 			spec: &specs.Spec{ | 			spec: &specs.Spec{ | ||||||
| 				ContainerEdits: specs.ContainerEdits{ | 				ContainerEdits: specs.ContainerEdits{ | ||||||
| 					DeviceNodes: []*specs.DeviceNode{ | 					DeviceNodes: []*specs.DeviceNode{ | ||||||
| 						{HostPath: "/root/dev/nvidia0"}, | 						{HostPath: "/root/dev/nvidia0", Path: "/root/dev/nvidia0"}, | ||||||
| 						{HostPath: "/target-root/dev/nvidia1"}, | 						{HostPath: "/target-root/dev/nvidia1", Path: "/target-root/dev/nvidia1"}, | ||||||
| 						{HostPath: "/different-root/dev/nvidia2"}, | 						{HostPath: "/different-root/dev/nvidia2", Path: "/different-root/dev/nvidia2"}, | ||||||
| 					}, | 					}, | ||||||
| 				}, | 				}, | ||||||
| 			}, | 			}, | ||||||
| 			expectedSpec: &specs.Spec{ | 			expectedSpec: &specs.Spec{ | ||||||
| 				ContainerEdits: specs.ContainerEdits{ | 				ContainerEdits: specs.ContainerEdits{ | ||||||
| 					DeviceNodes: []*specs.DeviceNode{ | 					DeviceNodes: []*specs.DeviceNode{ | ||||||
| 						{HostPath: "/target-root/dev/nvidia0"}, | 						{HostPath: "/target-root/dev/nvidia0", Path: "/root/dev/nvidia0"}, | ||||||
| 						{HostPath: "/target-root/dev/nvidia1"}, | 						{HostPath: "/target-root/dev/nvidia1", Path: "/target-root/dev/nvidia1"}, | ||||||
| 						{HostPath: "/different-root/dev/nvidia2"}, | 						{HostPath: "/different-root/dev/nvidia2", Path: "/different-root/dev/nvidia2"}, | ||||||
| 					}, | 					}, | ||||||
| 				}, | 				}, | ||||||
| 			}, | 			}, | ||||||
| @ -75,18 +75,18 @@ func TestRootTransformer(t *testing.T) { | |||||||
| 			spec: &specs.Spec{ | 			spec: &specs.Spec{ | ||||||
| 				ContainerEdits: specs.ContainerEdits{ | 				ContainerEdits: specs.ContainerEdits{ | ||||||
| 					Mounts: []*specs.Mount{ | 					Mounts: []*specs.Mount{ | ||||||
| 						{HostPath: "/root/lib/lib1.so"}, | 						{HostPath: "/root/lib/lib1.so", ContainerPath: "/root/lib/lib1.so"}, | ||||||
| 						{HostPath: "/target-root/lib/lib2.so"}, | 						{HostPath: "/target-root/lib/lib2.so", ContainerPath: "/target-root/lib/lib2.so"}, | ||||||
| 						{HostPath: "/different-root/lib/lib3.so"}, | 						{HostPath: "/different-root/lib/lib3.so", ContainerPath: "/different-root/lib/lib3.so"}, | ||||||
| 					}, | 					}, | ||||||
| 				}, | 				}, | ||||||
| 			}, | 			}, | ||||||
| 			expectedSpec: &specs.Spec{ | 			expectedSpec: &specs.Spec{ | ||||||
| 				ContainerEdits: specs.ContainerEdits{ | 				ContainerEdits: specs.ContainerEdits{ | ||||||
| 					Mounts: []*specs.Mount{ | 					Mounts: []*specs.Mount{ | ||||||
| 						{HostPath: "/target-root/lib/lib1.so"}, | 						{HostPath: "/target-root/lib/lib1.so", ContainerPath: "/root/lib/lib1.so"}, | ||||||
| 						{HostPath: "/target-root/lib/lib2.so"}, | 						{HostPath: "/target-root/lib/lib2.so", ContainerPath: "/target-root/lib/lib2.so"}, | ||||||
| 						{HostPath: "/different-root/lib/lib3.so"}, | 						{HostPath: "/different-root/lib/lib3.so", ContainerPath: "/different-root/lib/lib3.so"}, | ||||||
| 					}, | 					}, | ||||||
| 				}, | 				}, | ||||||
| 			}, | 			}, | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user