MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / test_probe_discovers_nvidia_gpu

Function test_probe_discovers_nvidia_gpu

crates/openshell-vfio/src/gpu.rs:174–192  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

172
173 #[test]
174 fn test_probe_discovers_nvidia_gpu() {
175 let (tmp, sysfs) = setup_mock_sysfs();
176 create_pci_device(
177 &sysfs,
178 tmp.path(),
179 "0000:2d:00.0",
180 "0x10de",
181 "0x2684",
182 "0x030000",
183 42,
184 );
185
186 let gpus = probe_host_nvidia_vfio_readiness(&sysfs);
187 assert_eq!(gpus.len(), 1);
188 assert_eq!(gpus[0].bdf, "0000:2d:00.0");
189 assert_eq!(gpus[0].vendor, "0x10de");
190 assert_eq!(gpus[0].device, "0x2684");
191 assert_eq!(gpus[0].iommu_group, 42);
192 }
193
194 #[test]
195 fn test_probe_skips_non_nvidia() {

Callers

nothing calls this directly

Calls 4

setup_mock_sysfsFunction · 0.85
create_pci_deviceFunction · 0.85
pathMethod · 0.80

Tested by

no test coverage detected