xref: /openbmc/google-misc/acpi-power-state-daemon/subprojects/nemora-postd/README.md (revision f75f29be7a14984dd6e7db76837d7e57c26d8fe1)
1*f75f29beSPatrick Williams# Nemora-postd
214fe6698SNan Zhou
314fe6698SNan ZhouNemora-postd is a daemon running on the BMC to stream host POST codes.
414fe6698SNan Zhou
514fe6698SNan Zhou## Tests
614fe6698SNan Zhou
725c55c54SPatrick WilliamsThe following instruction is for manual testing, but the Robot Framework test
825c55c54SPatrick Williamscan follow the same logic.
914fe6698SNan Zhou
1014fe6698SNan Zhou### Prerequisites
1125c55c54SPatrick Williams
1225c55c54SPatrick WilliamsInstall the latest version of
1325c55c54SPatrick Williams[Protocol Buffers](https://github.com/protocolbuffers/protobuf/releases/tag/v3.13.0),
1425c55c54SPatrick Williamsand the latest version of
1525c55c54SPatrick Williams[Linux / UNIX TCP Port Forwarder](http://www.dest-unreach.org/socat/).
1614fe6698SNan Zhou
1714fe6698SNan Zhou### Functional Tests
1825c55c54SPatrick Williams
1914fe6698SNan Zhou1. On BMC, stop the existing Nemora-postd;
2025c55c54SPatrick Williams
2114fe6698SNan Zhou   ```bash
2214fe6698SNan Zhou   systemctl stop nemora-postd@eth0
2314fe6698SNan Zhou   ```
2425c55c54SPatrick Williams
2525c55c54SPatrick Williams2. On any machine, start a testing server at IP_SERVER listening to upcoming UDP
2625c55c54SPatrick Williams   datagrams;
2725c55c54SPatrick Williams
28*f75f29beSPatrick Williams   ```bash
2914fe6698SNan Zhou   DECODE_CMD="protoc --decode=platforms.nemora.proto.EventSeries event_message.proto"
3014fe6698SNan Zhou   exec socat udp-recvfrom:3960,fork exec:"$DECODE_CMD",fdout=stdout
3114fe6698SNan Zhou   ```
3225c55c54SPatrick Williams
3325c55c54SPatrick Williams3. On BMC, start a new nemora session which sends POST codes to the testing
3425c55c54SPatrick Williams   server;
3525c55c54SPatrick Williams
36*f75f29beSPatrick Williams   ```bash
3714fe6698SNan Zhou   nemora-postd eth0 --udp4 $IP_SERVER
3814fe6698SNan Zhou   ```
3925c55c54SPatrick Williams
4014fe6698SNan Zhou4. On BMC, manually change the DBus property via `busctl`;
4125c55c54SPatrick Williams
42*f75f29beSPatrick Williams   ```bash
4314fe6698SNan Zhou   busctl set-property xyz.openbmc_project.State.Boot.Raw /xyz/openbmc_project/state/boot/raw0 xyz.openbmc_project.State.Boot.Raw Value '('tay')' 10000004 3 1 2 3
4414fe6698SNan Zhou   ```
4525c55c54SPatrick Williams
4614fe6698SNan Zhou5. The testing server should receive the following packet in about 20 seconds.
4725c55c54SPatrick Williams
4814fe6698SNan Zhou   ```bash
4914fe6698SNan Zhou   magic: 9876039085048616960
5014fe6698SNan Zhou   mac: ...
5114fe6698SNan Zhou   sent_time_us: ...
5214fe6698SNan Zhou   postcodes: 0x989684
5314fe6698SNan Zhou   postcodes_protocol: NATIVE_32_BIT
5414fe6698SNan Zhou   ```
5525c55c54SPatrick Williams
5625c55c54SPatrick Williams   Note that, `magic` and `postcodes_protocol` are fixed. `postcodes` should be
5725c55c54SPatrick Williams   what you set via `busctl`.
58