Add file-backed gBMC HAL drivers for the lightweight integration tests.
gpowerd runs out of process in the lightweight integration tests, so in-process
gmock HAL doubles cannot reach it. The IMC path -- ImcFruScanner and
GnicMonitor -- is therefore untestable at the integration level today, even
though it is the part of gpowerd that talks to hardware and so the part most
worth exercising end to end.
This adds the pieces needed to present simulated I2C devices to a real gpowerd
process:
* `FileI2cBus` and `FileEeprom` implement the gBMC HAL interfaces against a
directory of EEPROM images. `FileI2cBus` performs no I/O of its own; it
remembers a directory, and the EEPROM driver reaches it through
`EepromConfig::i2c_bus`, so the drivers hold no global state.
* `hal_image` builds the device images themselves: an IPMI FRU image carrying
a MAC address, and a gNIC vEEPROM image carrying telemetry.
Nothing links these yet, and linking them would change nothing on its own: they
register under their own driver names in the HAL registry, so they are
unreachable until a GnicMonitorConfig asks for them by name.
PiperOrigin-RevId: 993756256
Change-Id: I9ba455219f79c6c55498ebee2efa9ff1c4c45bdf
5 files changed