()
| 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() { |
nothing calls this directly
no outgoing calls
no test coverage detected