summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* PEL: Add PELs from ESELsMatt Spinler2020-02-141-0/+168
| | | | | | | | | | | | | | | | | When the OpenPower host firmware subsystem hostboot creates PELs, those PELs get added to OpenBMC event logs in the ESEL entry of the AdditionalData property. (Eventually hostboot will update their code to use PLDM to send down PELs.) This commit looks for that ESEL keyword on incoming event logs, extracts the PEL data, and adds it to the PEL repository with all of the other PELs. It extracts the PEL data by converting the string value to a vector of uint8_ts starting after the IPMI data fields contained in that string. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I2b7f2915dceb9c306466b8181cae05a3ddd65057
* PEL: New event log when receiving bad host PELMatt Spinler2020-02-141-0/+45
| | | | | | | | | | | | Create a new event log/PEL when a PEL comes in from the host but it isn't valid. The PEL subsystem used is 'platform firmware' because the code won't know which specific host subsystem it came from. The severity is unrecoverable as opposed to informational to make it easier to notice. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I933e5c82f1ef755c6266604fbdec6d0c1fe5b784
* PEL: Create error log for 'bad PEL'Matt Spinler2020-02-141-10/+40
| | | | | | | | | Create an event log (and a PEL) for the case when the host rejects a PEL because it is malformed. This requires a new message registry entry for the error. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ibd52921b5d6020f98b457b9ee0b3bb4f0b95e707
* PEL: Add ability to create event logsMatt Spinler2020-02-143-6/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are cases where the PEL code wants to be able to create OpenBMC event logs (and thus PELs) for problems it encounters when trying to create or import other PELs. For example, if the host were to send down a malformed PEL, this code would like to create a new event log and capture part of that bad PEL in the new PEL for debug purposes, as the malformed PEL cannot be reported anywhere since it is malformed. To handle this, create the EventLogger class that provides a log() function that allows the PEL extension code to create OpenBMC event logs (and thus PELs) from within. The underlying function to do the event log creating is passed in via the constructor so that it can be changed for testing. The sd_event_add_defer function (wrapped by sdeventplus) is used to dispatch the creation of a single event, so that the entry point is from the event loop. If there are still events left on the queue after that, then they will be also be scheduled with sd_event_add_defer so that the events are always created from event loop calls. EventLogger does not allow events to be added to the queue if it is being done from within the creation function so that the code can't get stuck in a loop of creating a new event every time an event is created. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I6a9062074dc62cfb6043139ff0a9f3dfcd06c708
* PEL: Allow adding to AdditionalDataMatt Spinler2020-02-141-0/+16
| | | | | | | | | Add an interface to add a key/value pair to the data stored in the AdditionalData class. Also add an interface to get to the raw underlying map of data. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I61200f92b45be8e86992d3f4888698d6a5bbe251
* PEL: Increase host full timeout val in testMatt Spinler2020-02-131-1/+1
| | | | | | | | | | | The host notifier testcase depends on catching the host full retry timer after it starts but before it trips. Occasionally in CI when a lot of of work is being done in parallel this wasn't happening so the testcase would fail. Increase the timeout value from 20ms to 400ms which is hopefully enough. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Id8d1c7a800f9da932d85da7ed3bf6d6e5400a24e
* PEL: Add Section::getJSON() implementer testMatt Spinler2020-02-131-0/+41
| | | | | | | | Test that the PEL section classes that provide a getJSON() implementation return valid JSON. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I10dc6bbd0e1e4d63e6416928e9951ac6f85ba774
* PEL: Print Failing MTMS section into JSONHarisuddin Mohamed Isa2020-02-072-0/+60
| | | | | | | | | | | | | | | | | Remove any trailing whitespace for serial number. "Failing MTMS": { "Section Version": "1", "Sub-section type": "0", "Created by": "0x4552", "Machine Type Model": "OPWR-131", "Serial Number": "1318ABA" }, Testing: Manually run peltool and verified output. All unit tests passed. Signed-off-by: Harisuddin Mohamed Isa <harisuddin@gmail.com> Change-Id: I7a05790bdf406ef6d7946ffae831a45ee6dd5cda
* PEL: Add SRC::getErrorDetails() unit testHarisuddin Mohamed Isa2020-02-071-3/+102
| | | | | | | Tests the registry message string placeholder substitution Signed-off-by: Harisuddin Mohamed Isa <harisuddin@gmail.com> Change-Id: If89609a911403a76bd6044f81e0f464e38aec8f2
* PEL: Print SRC section into JSONHarisuddin Mohamed Isa2020-02-033-4/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For BMC created errors, look up the reason code in the message registry for error description and also meaning of data stored in hexwords 6-9 (if any). Added registry message field in peltool list output. "Primary SRC": { "Section Version": "1", "Sub-section type": "1", "Created by": "0x1000", "SRC Version": "0x02", "SRC Format": "0x55", "Power Control Net Fault": "False", "Error Details": { "Message": "PS 0x64 had a PGOOD Fault", "PS_NUM": "0x64" }, "Valid Word Count": "0x09", "Reference Code": "BD8D1001", "Hex Word 2": "00000055", "Hex Word 3": "00000010", "Hex Word 4": "00000000", "Hex Word 5": "00000000", "Hex Word 6": "00000064", "Hex Word 7": "00000000", "Hex Word 8": "00000000", "Hex Word 9": "00000000" } "Primary SRC": { "Section Version": "1", "Sub-section type": "0", "Created by": "0x4552", "SRC Version": "0x02", "SRC Format": "0x2008000", "Power Control Net Fault": "False", "Valid Word Count": "0x04", "Reference Code": "B2001020", "Hex Word 2": "02008000", "Hex Word 3": "00000000", "Hex Word 4": "00000012", "Callout Section": { "Callout Count": "1", "Callouts": [{ "FRU Type": "Symbolic FRU", "Priority": "Medium Priority", "Part Number": "NEXTLVL" }] } } Testing: Manually run peltool and verified out. All unit tests passed. Signed-off-by: Harisuddin Mohamed Isa <harisuddin@gmail.com> Change-Id: I124627ba785413ebda02305b7d9f95431922e714
* PEL: HostNotifier testcase refactoringMatt Spinler2020-01-311-195/+60
| | | | | | | | | | | | | | | | | | | | | This commit doesn't change the behavior, it just makes the following changes to the testcase infrastructure so there is less duplication: * Move the hostIface, mockHostIface, repo, and dataIface instances into the test class HostNotifierTest so that all testcases can use them, and then remove creating them in every testcase. * MockHostIface is now a pointer, so have to change its use. * Make the DataInterface and HosttInterface mocks be NiceMocks so that gtest won't print warnings about functions called that don't have EXPECT_CALLs. * Have the default behavior of sendNewLogCmd be to send a command successfully so that it doesn't have to be specified in every testcase. Change-Id: Ic393933629753b884299ee4dfa30a8bb6007ee63
* PEL: Save BMC Version ID in UserData sectionMatt Spinler2020-01-312-1/+8
| | | | | | | | When creating a PEL, save the VERSION_ID value from the /etc/os-release file in the UserData section that keeps useful system information. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I6d9008b15c5347239bf8c21ef79219d3b6ee08e6
* PEL: Save process name in a UserData sectionMatt Spinler2020-01-311-1/+57
| | | | | | | | | | | | | | When creating a new PEL, add a UserData section that contains various pieces of system information that will be saved in every error log. In this first commit, just save the process name of the creator, provided they passed in the '_PID' AdditionalData item containing their PID. Future commits will add other items like certain D-Bus properties. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I7139b4056e494277ff3388bfa8a00002c9c89dc1
* PEL: Add function to get PEL sizeMatt Spinler2020-01-314-8/+9
| | | | | | | | | | | Add a size() function to the PEL class that adds up the size fields in the header of every PEL section. This required a fix to some testcases where the size field was wrong in a header. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I0d70deae116cd3835f2c0ab34e13811da471fb14
* PEL: Close PEL FD after getPEL callMatt Spinler2020-01-271-4/+15
| | | | | | | | | To close the file descriptor returned from the getPEL D-Bus method call, use the 'Defer' sdeventplus object to schedule it to happen from the event loop. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I2b850a1c92215e7f66166cc5440d7071663065c0
* PEL: Add PEL D-Bus methodsMatt Spinler2020-01-272-2/+89
| | | | | | | | | | | | | | | | | | Implement the org.open_power.Logging.PEL D-Bus interface on /xyz/openbmc_project/logging. It provides the following methods: * getPEL - Return a unix FD to the PEL data based on the PEL id. * getPELFromOBMCID - Return PEL data in a vector based on the corresponding OpenBMC event log id. * hostAck - Called when the host has sent the PEL up to the OS, which is the final step in the reporting process. * hostReject - Called when the host has an issue with a PEL, either: - The host doesn't have any more room for PELs at this moment. - The PEL was malformed. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I633ae9e26d8336973363a1a207e8fd493f7ff7d2
* PEL: Receive a 'bad PEL' indication from hostMatt Spinler2020-01-271-0/+67
| | | | | | | | | | | | | | | | | | | | If the code somehow sent the host a malformed PEL, it will respond with the 'Ack PEL' PLDM command with a special value that indicates this, and the PLDM daemon will relay it to this daemon. In this case, change the host transmission state to 'bad' so it doesn't get sent again. This should never happen as the Repository class already validates PELs and removes bad ones, though maybe the host and Repository have different ideas about what constitutes a malformed PEL. In the future, if event logging support is added to the PEL code running inside the logging daemon, it may be a good idea to create a new PEL for this case. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Id6f9fd37764bf5b5d09b4277a1e36b1f26b3e9a5
* PEL: Notifier support for 'host full'Matt Spinler2020-01-272-0/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | The host firmware may have a limited size for its staging area before it passes the PELs through to the OS, and this area may fill up with PELs it can't send if there are too many or the OS isn't up yet. In this case, it will send down an 'Ack PEL' PLDM command with a special response indicating this host full condition. The PLDM daemon will then call a method on this daemon to let it know. This command handles the host full condition on the HostNotifier class. When this is set: * The PEL that hit this condition will be put back on the queue to be sent again. * No new PELs will be sent up, except as noted below * A 60s timer will be started at the end of which another attempt will be made to send a PEL, in the hopes the condition went away. - If it didn't go away, this process will repeat. - If it did go away, a successful ack will be received and things will proceed as normal. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Iaeb38f43f7acc595bcff234ba50cedf8188b3d9b
* PEL: Support for the host acking a PELMatt Spinler2020-01-271-0/+72
| | | | | | | | | | | | | After the host firmware successfully transfers a PEL to the OS, it will respond with an 'Ack' command that the PLDM daemon sends over to this daemon via a D-Bus method call. Add support to the HostNotifier class for this. It will change the state field in the PEL to 'acked' so that it doesn't get sent up again. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Id2a9985965017d9431419c1375d5374a2d0ae00b
* PEL: On new PEL, send to host if necessaryMatt Spinler2020-01-271-0/+290
| | | | | | | | | | | | | | | | When a new PEL comes in, send it to the host now if the host is up and the class is currently idle. The PLDM command will be dispatched in a standalone function called from the event loop so that this function, which may be part of the 'Create new log' D-Bus method response, can return first. Also added testcases to start verifying these paths now that there is a full mock of the HostInterface class. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ib30a99cc61be9205122287ba310bc315d762e863
* PEL: Mock the new PEL available cmdMatt Spinler2020-01-271-1/+155
| | | | | | | | | | | | Instead of using PLDM, just write to a FIFO in the filesystem where what is written can be asynchronously read back from an event callback just like how PLDM commands behave. There is just a single byte written to the FIFO - a zero if the command is considered successful, something nonzero to indicate it should be a failure. Change-Id: I1fd79782126a6b1555597a4642b9ca3bfd030a79
* PEL: Take a PEL off the queue and send to hostMatt Spinler2020-01-271-0/+32
| | | | | | | | | | | | | Fill in the code that looks for the first PEL on the queue that still needs to be sent up, and send it. If the failure retry timer is active, or it has already retried the max number of times, then don't send anything. In the former case the timer callback will do the send, and in the latter the next time a log comes in it will start trying again. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ibb9692ca83b23e5e021db8b8a89b5549fb979df1
* PEL: Fill in host command response handlerMatt Spinler2020-01-271-2/+2
| | | | | | | | | | | | If notifying the host of a new PEL was successful, then it will modify the PEL's host transmission state to 'sent' and add it to the list of sent PELs. If there was a failure, then a timer will be started so a retry can be done. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I77000c603a18726d4cdbb3920ca349e69198fb7f
* PEL: Logic to enqueue a PEL to send to hostMatt Spinler2020-01-272-6/+122
| | | | | | | | | Fill in the function to determine if a PEL needs to be placed on the qeueue to be sent up to the host. It involves checking both the host and HMC transmission states, as well as the PEL action flags field. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I9f1a9fba1b7e6dc7a167f1c7e9dfd6c40d90883f
* PEL: Add HostNotifier classMatt Spinler2020-01-273-4/+203
| | | | | | | | | | | | | This class will watch for new PELs being created, and handle sending them up to the host. This first commit for this class mostly just fills in the constructor to set up the various callbacks it will use. It is only instantiated in the Manager class if the Manager constructor used is the one that passes in the HostInterface object, to allow for configurations that don't need PELs passed up. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I0ddcf94d047979eb78209d396c2351566c634dbe
* PEL: Print action flags into JSON alignedHarisuddin Mohamed Isa2020-01-091-1/+1
| | | | | | | | | | | | | | | | | | | "User Header": { "Section Version": "1", "Sub-section type": "0", "Log Committed by": "0x4552", "Subsystem": "System Hypervisor Firmware", "Event Scope": "Entire Platform", "Event Severity": "Informational Event", "Event Type": "Miscellaneous, Informational Only", "Action Flags": [ "Report Externally" ] } Testing: Manually run peltool and verified output Signed-off-by: Harisuddin Mohamed Isa <harisuddin@gmail.com> Change-Id: Ie8376953b5f1baa093fc0aa9564d50cd4208564e
* PEL: Add repo function to get a PEL FDMatt Spinler2019-12-171-0/+48
| | | | | | | | | | | Add Repository::getPELFD() to return a file descriptor to a PEL data file based on its ID. This will be used by a future D-Bus method to return the descriptor to the PLDM daemon. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I1110a514e30a9387d9672e42862139b988717c53
* PEL: Filled in PEL value descriptionsHarisuddin Mohamed Isa2019-12-121-0/+1
| | | | | | | | | | | Updated getValue to return value description instead of registry name. Updated unit test to add checking of value description. Testing: Ran unit test successfully on QEMU and also verified peltool output Signed-off-by: Harisuddin Mohamed Isa <harisuddin@gmail.com> Change-Id: Icf64f51a467c3bd4dd9bbcd78aea3df966b20eb7
* PEL: Add ExtendedUserHeader section classMatt Spinler2019-12-093-4/+353
| | | | | | | | | | | | | | This is a required PEL section. The section contains: * The machine type/model/SN * The server firmware version * The BMC firmware version * The 'Event Common Reference Time' (not used yet) * The symptom ID (a unique event signature) Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I223041f85965195fccf69542dbe86ce856073b36
* PEL: Add APIs to read the FW versionsMatt Spinler2019-12-091-0/+2
| | | | | | | | | | | | | Add methods to the DataInterface class to read the BMC and server firmware versions. The server firmware version represents the version of all firmware images that are in the flash image, not just the BMC. There is nowhere to get that version yet, so this commit just has a placeholder. These will be used by the ExtendedUserHeader section. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I47389714c987337cb96c72b6bf2b270c78003357
* PEL: Add Repo API to update transmission statesMatt Spinler2019-12-091-0/+86
| | | | | | | | | Provided APIs for the Repository class to update the host and HMC transmission states on a PEL it contains. It saves the updated PEL data in the filesystem. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Iadbc589ee85d4408339e1171c36b8324910f4f0a
* PEL: Keep PEL attributes in Repository mapMatt Spinler2019-12-031-0/+45
| | | | | | | | | | | | Instead of the Repository class only storing the path to a PEL file for a corresponding PEL ID, change it to a structure that includes the PEL's size and action flags as well as the path. This way, a PEL won't have to be read from the filesystem to find these values every time someone needs them. These new fields will be needed by the code that sends PELs to the host. Change-Id: I7650b6cbad12cc120426854767403f5cba2ee572
* PEL: Add subscriptions for new and deleted PELsMatt Spinler2019-12-031-0/+43
| | | | | | | | | | | Add functionality to the Repository class to be able to call functions provided by others when PELs are added or removed from the repository. This will be used in the future for things like knowing when a new PEL is added so it can be sent to the host. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I2effc9d5fa9a38890311a88bcfb07eed1292a453
* PEL: Create registry directory for testMatt Spinler2019-11-191-1/+4
| | | | | | | | | The PEL manager test wasn't creating the message registry directory before writing into it, and seemed to have just been lucking out that a previous test had created it. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I122242d65db02d8b80864c938cc28be434774304
* PEL: Support UserData padding in the testcasesMatt Spinler2019-11-192-4/+11
| | | | | | | | Some testcase updates were missed when the fix was made to pad the UserData section to 4 byte boundaries as required by the spec. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I8129a70cfd740155ca05089563dfc5d7e63bdc81
* PEL: Run a user defined function on every PELMatt Spinler2019-11-121-0/+36
| | | | | | | | | | | | | | | | | | | | | | | Add a for_each() function to the PEL repository that takes a user defined function that will be run on every PEL, unless that function says to stop early. The user defined function is a std::function<bool>(const PEL&); For example, to save up to 100 IDs in the repo into a vector: std::vector<uint32_t> ids; ForEachFunc f = [&ids](const PEL& pel) { ids.push_back(pel.id()); return ids.size() == 100 ? true : false; }; repo.for_each(f); This will be used to find which PELs still need to be sent up to the host after a reboot, among other things. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ic60525a8ab3dd593ba37e43a6cb0b3db8dda7cee
* PEL: Validate the Action Flags fieldMatt Spinler2019-11-082-1/+83
| | | | | | | | | | | | | | | | According to the PEL spec, the Action Flags and Event Type fields in the User Header section must be in agreement with the Severity field. So, when a PEL is being created from an OpenBMC event log, check those values for correctness and fix them up if required. In addition, as those fields are optional in the message registry, this code will also just set these two fields to valid values if they were left out. The rules being followed are documented in the PEL readme. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Iad88de5080ba79a9ff31f962ef99bfc11994b9ed
* PEL: Add license prologue to test source filesMatt Spinler2019-11-0627-0/+405
| | | | | Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I67c62ab5ac6e69ad0a84937834581f9a280a9167
* PEL: PELTool ApplicationAatir2019-11-061-0/+1
| | | | | | | | | PELTooL application would be used to interact with PELs. This commit has the first functionality, where a PEL file is passed and all PEL sections are hexdumped in a JSON object. Signed-off-by: Aatir <aatrapps@gmail.com> Change-Id: I155d75bb58cbd14a297b094314f7fd1f271f4f37
* PEL: Make action flags optional in the registryMatt Spinler2019-11-041-3/+2
| | | | | | | | A future commit will fill in the field if it isn't present. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I67371433162ce2198a362796d274695a1bd6a6dc
* PEL: Const accessors for Private/UserHeaderMatt Spinler2019-11-045-31/+17
| | | | | | | | | | | | | | | | | | | Change the combined non-const accessor/setter functions for the PrivateHeader and UserHeader fields to the standard const accessors, and have separate setters for the fields that need to be modified. In addition, make the 'get PrivateHeader' and 'get UserHeader' functions on the PEL class return a const reference. This allows const enforcement on the PEL class, for things like: void func(const PEL& pel) { auto id = pel.privateHeader().id(); } Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I840170e72b41e9e2465f716617500269244de6d9
* PEL: Save AdditionalData in a UserData sectionMatt Spinler2019-11-042-0/+36
| | | | | | | | | | | | | | | | | | | Save the contents of the AdditionalData OpenBMC event log property as JSON in a UserData PEL section. For example, if the AdditionalData property, which is an array of strings, looks like: ["KEY1=VALUE1", "KEY=VALUE2"] Then the data stored as ASCII text in the UserData section is: {"KEY1":"VALUE1","KEY2":"VALUE2"} If one of the keys is "ESEL", then that entry is removed from the UserData output as that contains a full raw PEL from the host sent down as ASCII text. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ia6ffabb39fdb4315ec2152744414e44f7d2ec4aa
* PEL: Create FailingMTMS section for new PELsMatt Spinler2019-11-041-4/+4
| | | | | | | | | When a PEL is created from an OpenBMC event log, add the FailingMTMS section to the PEL. This contains the machine type, model, and serial number fields. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I8d08e6dda00260efebd2c6ac165270d2aaf98d67
* PEL: Start creating PELs from event logsMatt Spinler2019-11-041-23/+88
| | | | | | | | | | | | Look up incoming OpenBMC event logs in the message registry and create PELs for them if a registry entry is found. What happens when an event log can't be found in the message registry, such as creating a different PEL, will be addressed in a separate commit. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I45c634830021fdf2efb54e3cbfd6d496fd3d7d01
* PEL: Create SRC section from message registryMatt Spinler2019-11-043-4/+77
| | | | | | | | | | | | | | | | | | | | This adds the ability to create an SRC PEL section based on the message registry entry for an OpenBMC event log. The event log's AdditionalData property is used as a source for the user defined data words of the SRC, while the other fields in the SRC's data words are filled in either from the message registry fields or from current system state or configuration. The ASCII string field of the SRC is filled in based on the message registry entry. This commit doesn't fill in every system status field, as many aren't even available anywhere yet. Also, this commit doesn't support adding callouts to an SRC, that will also be handled in the future. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I67fe44e07e4eda6bdeedb4af2eacfc197deb6eb3
* PEL: Enhance the real PEL testMatt Spinler2019-10-221-2/+6
| | | | | | | | Check the SRC ASCII string, and also check the full ID of the last section object. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ie5b5ef3783d316a31e370ef898e11ecaf16b9551
* PEL: Add 3 more sections to the test PEL dataMatt Spinler2019-10-222-2/+25
| | | | | | | | | Several testcases use pelDataFactory() for their PEL data. Add SRC, FailingMTMS, and UserData sections to this data to get some better coverage. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I2b09fc94c32df1a6fd5bd3cb96c98dc7c3bcc1f2
* PEL: Refactor the test data factoryMatt Spinler2019-10-229-160/+161
| | | | | | | | | | | | | | | This commit has no functional changes, it just does some things to make the PEL data creator for testcases, pelDataFactory(), be more manageable: - Change to return a plain vector instead of a unique_ptr<vector>. - Keeps the data for each section in separate vectors and then either returns those as-is or combines them into a PEL. - Change the TestPelType enum to TestPELType to match the style guide. - Have pelDataFactory provide the SRC section instead of srcDataFactory. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I4770aa6a8169e89b6b8f685a9994d845c9e93cfe
* PEL: Add SRC PEL section classMatt Spinler2019-10-224-1/+183
| | | | | | | | | | | | | | | | | | | | | This section consists of: - An 8B header - 8 4B words of hex data - Some data is predefined based on the SRC format, some is free format. - A 32B ASCII character string (The AsciiString class) - An optional section for FRU callouts (The Callouts class) Usually, the term SRC (System Reference Code) refers to the contents of the ASCII string and the hex data words, which can then be looked up in service documentation to find the meaning of the event log. This PEL section wraps this pure SRC with additional data like callouts. This commit only adds support for unflattening the section from an existing PEL, and flattening it again. Future commits will add support for creating an SRC from message registry data. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I3dd97c6aca59cc6d6d6fadef84465164090d5658
* PEL: SRC callouts subsection objectMatt Spinler2019-10-224-0/+128
| | | | | | | | | | | | This Callouts class represents the optional subsection of an SRC PEL section that contains FRU callouts. It is only present in the SRC when there are callouts, and it comes at the end of the section. It is basically just a container for the Callout objects that represent the actual callouts. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I1d4d95b82f9b4943728d7939e3bf89e4a7bcbb75
OpenPOWER on IntegriCloud