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

Function test_sysfs_root_paths

crates/openshell-vfio/src/sysfs.rs:274–302  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

272
273 #[test]
274 fn test_sysfs_root_paths() {
275 let sysfs = SysfsRoot::system();
276 assert_eq!(
277 sysfs.pci_device("0000:2d:00.0"),
278 PathBuf::from("/sys/bus/pci/devices/0000:2d:00.0")
279 );
280 assert_eq!(
281 sysfs.pci_devices_dir(),
282 PathBuf::from("/sys/bus/pci/devices")
283 );
284 assert_eq!(
285 sysfs.drivers_probe(),
286 PathBuf::from("/sys/bus/pci/drivers_probe")
287 );
288 assert_eq!(
289 sysfs.vfio_pci_new_id(),
290 PathBuf::from("/sys/bus/pci/drivers/vfio-pci/new_id")
291 );
292 assert_eq!(
293 sysfs.vfio_pci_remove_id(),
294 PathBuf::from("/sys/bus/pci/drivers/vfio-pci/remove_id")
295 );
296
297 let custom = SysfsRoot::new("/tmp/test-sys");
298 assert_eq!(
299 custom.pci_device("0000:01:00.0"),
300 PathBuf::from("/tmp/test-sys/bus/pci/devices/0000:01:00.0")
301 );
302 }
303
304 #[test]
305 fn test_sysfs_root_iommu_group() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected