Repository navigation
Commit 0aa13d1
committed
vmotherboard: add chipset, base chipset, and PCIe unit tests
Before this change, vmotherboard had no unit tests for how the chipset routes
guest I/O to devices, how the base chipset wires up its devices, or the errors
its builder reports. This PR adds 24 tests. Each one builds a real chipset with
a small test device and checks only what callers can see. Tests prefixed with
gen1_ cover devices used only by Gen1 VMs.
| Test | Checks |
|---|---|
| accesses_reach_owning_device | Only owner gets I/O |
| unclaimed_accesses_read_all_ones | Unclaimed reads all 1s |
| device_errors_read_all_ones | Errors read all 1s |
| deferred_accesses_complete_with_device_result | Deferred I/O completes |
| fallback_device_receives_only_unclaimed_mmio | Fallback gets MMIO |
| overlapping_static_ranges_fail_build | Overlaps fail build |
| pci_device_wiring_errors_are_reported | Bad PCI wiring fails |
| runtime_region_mapping_moves_dispatch | Remap moves I/O |
| pic_and_eoi_route_to_registered_handlers | PIC/EOI reach handlers |
| generic_pci_bus_routes_config_space | Config space routed |
| gen1_piix4_pci_bus_resets_and_hosts_legacy_pci_devices | PIIX4 bus works |
| base_chipset_forwards_unclaimed_mmio_to_fallback | Fallback gets MMIO |
| generic_cmos_rtc_exposes_cmos_ram | CMOS RAM works |
| gen1_piix4_cmos_rtc_exposes_cmos_ram | CMOS RAM works |
| gen1_isa_dma_controller_is_resolved_and_programmable | DMA programmable |
| gen1_floppy_controllers_require_isa_dma | Floppy needs DMA |
| irq_lines_reach_the_pic_and_external_targets | IRQ to CPU vector |
| pcie_config_space_reaches_root_complex_devices | ECAM reaches devices |
| pcie_placement_errors_fail_build | Misplaced fails |
| integrated_endpoint_at_nonzero_device_is_reachable | Ignored: known bug |
| dynamic_device_is_reachable_until_removed | Removal unmaps |
| vm_state_transitions_reach_devices | Lifecycle reaches all |
| inspect_controls_debug_breaks_and_lists_ranges | Break filters match |
| device_builder_variants | Builder variants work |
This PR changes tests only. Coverage of the crate's production code rises from
32.5% to 92.4% (540 to 1,535 of 1,661 lines).1 parent bf35346 commit 0aa13d1
4 files changed
Lines changed: 1864 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11461 | 11461 | | |
11462 | 11462 | | |
11463 | 11463 | | |
| 11464 | + | |
11464 | 11465 | | |
11465 | 11466 | | |
11466 | 11467 | | |
11467 | 11468 | | |
11468 | 11469 | | |
11469 | 11470 | | |
| 11471 | + | |
11470 | 11472 | | |
11471 | 11473 | | |
11472 | 11474 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
0 commit comments