summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Implemented close session cmd in host interfaceRajashekar Gade Reddy2019-09-252-0/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This command can close any session via host interface. Tested: Close the existing valid session by session id ipmitool raw 0x6 0x3c <valid sesssion id > Response : 00 // success Close the existing valid session by session handle ipmitool raw 0x6 0x3c <zero session id> <valid session handle> Response : 00 // success Close the session by zero session id ipmitool raw 0x6 0x3c <zero session id> Response : 0x87 // inavlid session id Close the session by zero session handle ipmitool raw 0x6 0x3c <zero session id> <zero session handle> Response : 0x88 // inavlid session handle Close an inactive session. ipmitool raw 0x6 0x3c <valid session id> Response : 0xcc // invalid data field in request Close an inactive session. ipmitool raw 0x6 0x3c <zero session id> <valid session hnadle> Response : 0xcc // invalid data field in request Signed-off-by: Rajashekar Gade Reddy <raja.sekhar.reddy.gade@linux.intel.com> Change-Id: I8af290001d8effbbcdbbe2dd93aabf1b015e7a88
* drop entity YAML in favor of json provided filePatrick Venture2019-09-191-1/+1
| | | | | | | | | | Step 5 of moving from entity map from YAML to JSON drops support for a built-in YAML mapping of the entity containers. Tested: Not tested. No platform upstream updates this YAML file in their builds. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: Ic2918f568f5a6f4a9f9135990889b3bb84a0c81d
* entitymap: move accessor to separate modulePatrick Venture2019-09-171-1/+1
| | | | | Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I8c80acb694d067043b77d81dbb9a7ba0057fef56
* fix logic error for unpack vector of tupleVernon Mauery2019-09-161-3/+48
| | | | | | | | | | | | | | | | | | | | | Unpacking a vector of tuples is failing if the correct number of bytes does not match an integral number of bytes needed to fully unpack all the tuples. Unpacking a tuple should return an error if it does not fully unpack all the items. This will signal the vector unpack to bail and return however many items it has unpacked to that point. A vector unpack should always return success because no matter how many items it has unpacked, it is fine, because a vector can have any number of items. Tested: Unit tests updated to check for proper unpacking of vectors and tuples (and optionals) as well as new unit tests added for more targetted testing. Change-Id: I4b45198f8bc4a49913beb923d10079983179402a Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* entitymap: add json parsing supportPatrick Venture2019-08-202-0/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a json parsing method that given an entity map in the format: [ { "id" : 1, "containerEntityId" : 2, "containerEntityInstance" : 3, "isList" : false, "isLinked" : false, "entities" : [ {"id" : 1, "instance" : 2}, {"id" : 1, "instance" : 3}, {"id" : 1, "instance" : 4}, {"id" : 1, "instance" : 5} ] } ] is constructed into the entity map used by sensorhandler. This is meant as part of the transition from the entity map in YAML to JSON. This is step 2. Step 1 moved access to the object behind a method. This adds JSON validation and parsing. Step 3 will add a file path to check and parse. Step 4 will provide a call to parse that file if present and use its data if non-empty. Tested: The method added has not been tested beyond unit-test validation. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: Ic29f022d3812fa9e3af775d542ad055629fd5a01
* message: Support prepending payloadsWilliam A. Kennington III2019-04-291-0/+26
| | | | | | | | | Needed solely so that we can support adding the necessary bits for oem and group commands. We shouldn't be using this anywhere else, which is why it is not generalized to non-payload types. Change-Id: I6573f981fbe68cebb89abcdfb3de5de5d139e1e0 Signed-off-by: William A. Kennington III <wak@google.com>
* message/pack: Allow packing payloadsWilliam A. Kennington III2019-04-291-0/+24
| | | | | | | | | Some IPMI handlers need the ability to support variable return types. The easiest way to do that is to be able to return payloads and pack them into the final payload. Change-Id: I5098a1ab0998ada712096929eae40a3c88a6dea0 Signed-off-by: William A. Kennington III <wak@google.com>
* message/pack: Support packing string_viewsWilliam A. Kennington III2019-04-291-0/+14
| | | | | | | | Now we don't need to make an intermediate copy of our data into an array before packing it into a payload. Change-Id: Iac79a79e0ae95835cb67d617a966a92ce8dcd5f8 Signed-off-by: William A. Kennington III <wak@google.com>
* message/pack: Check for outstanding bitsWilliam A. Kennington III2019-04-291-0/+7
| | | | | | | | | | Currently, if you pack a non-byte aligned member into a message and then pack an array, it will do the wrong thing and treat the unaligned data as being appended to the end of the message. Allowing for this behavior is convoluted and probably not useful, so just return an error. Change-Id: I6f200dbea96c41f49a110ba7536ccfd37115d277 Signed-off-by: William A. Kennington III <wak@google.com>
* message/payload: Ignore unchecked unpack warning during unwindWilliam A. Kennington III2019-04-291-0/+15
| | | | | | | | | | | If we are caught in an exception unwind we don't care that the payload is not be fully checked. Otherwise, this encourages the pattern of wrapping all handler code in try catch blocks that set trailingOk as it is not required to read the entire payload when throwing an exception. Change-Id: I35149eedd33bd9fd41968e89d5a8614df7436872 Signed-off-by: William A. Kennington III <wak@google.com>
* message/payload: Clean up check / trailing stateWilliam A. Kennington III2019-04-291-0/+119
| | | | | | | | | | | | | | | | We want to be able to trivially re-use payloads for marshalling data from a buffer into other formats. This change tries to make the meaning of trailingOk and unpackCheck consistent, since the meanings didn't seem clear in the previous code. Now, unpackCheck is only used to determine if unpacking was checked, and trailingOk determines if unpackCheck is required. This also fixes lots of spurious warnings being printed for commands which were checking their output correctly, or were legacy and unable to check output. Change-Id: Id7aa9266693b4e3f896027acf6b3e5d757fdf981 Signed-off-by: William A. Kennington III <wak@google.com>
* Add a tuple type for packingVernon Mauery2019-04-091-0/+61
| | | | | | | | | | | | | At the top level, payload had the ability to pack a tuple, but it did it by splitting it into its parts and packing those individually. But if one of those parts was a tuple, it would fail. This moves the tuple packing code into the packing templates so that it is possible to pack a nested tuple of tuples. Tested-by: newly written tuple unit tests pass Change-Id: Icd80926314072df78b0083a823dcfb46e944e365 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Add support for returning optional valuesVernon Mauery2019-04-051-0/+26
| | | | | | | | | | | Some commands have optional return values. This allows the handlers to be defined as returning an optional<T> value and then in the body of the handler set the value in the optional or not. Tested-by: unit test runs successfully Change-Id: Ib38a4589609fb1eb192106e511c9ee3a507ac42f Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* message: pack: add variant supportJames Feist2019-04-041-0/+15
| | | | | | | | | | | Add variant support to allow return of mutliple specific types. Also change types to const as this is required by the visitor and these could have been const all along. Tested: Added unit test and used in oem provider Change-Id: I5cb056c15d4813b9eee58eecb707664477d019d9 Signed-off-by: James Feist <james.feist@linux.intel.com>
* ipmid: add message packing/unpacking unit testsVernon Mauery2019-02-254-2/+1536
| | | | | | | | | | This adds unit tests for the various types that the message packer/unpacker handles. This includes tests for simple messages as well as complex messages. It also includes positive and negative testing to make sure that failed packing and unpacking gets reported properly. Change-Id: I9360c867cccbeba6a707dda6df6c5e29fa585c5c Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Create libipmid and libipmid-hostWilliam A. Kennington III2019-02-071-2/+2
| | | | | | | | | | | | | | | | | | | This starts a transition to common ipmid libraries that providers can link against. It will allow for a cleaner separation between common ipmid functionality and daemon type specific code. This is needed so we can resolve all of the symbols in the providers at link time instead of discovering bad linkage by building and running a full ipmi daemon. In future commits libraries will be packaged for libipmid and libipmid-host which provide all of the symbols used by the current set of ipmid providers. This is the first step, it just separates and renames the headers. Legacy symlinks are still kept around for compatability. It also adds stub libraries so that external users can start linking as intended. Change-Id: I6bbd7a146362012d26812a7b039d1c4075862cbd Signed-off-by: William A. Kennington III <wak@google.com>
* rename headers to match stylePatrick Venture2018-09-251-2/+2
| | | | | | | | | | | | | | | | | | Moving headers from ".h" to ".hpp" Reworked the header inclusion a bit so that host-ipmid is treated as a library, and local headers aren't. renamed apphandler.h => apphandler.hpp renamed chassishandler.h => chassishandler.hpp renamed globalhandler.h => globalhandler.hpp renamed sensorhandler.h => sensorhandler.hpp renamed storageaddsel.h => storageaddsel.hpp renamed storagehandler.h => storagehandler.hpp renamed systemintfcmds.h => systemintfcmds.hpp Change-Id: I9d4ce3dd57e2e996800f9020a10cc10cdf2c3914 Signed-off-by: Patrick Venture <venture@google.com>
* add .clang-formatPatrick Venture2018-09-072-39/+41
| | | | | Change-Id: I7c2a527b4751a560703a61fcbe9638b150546af5 Signed-off-by: Patrick Venture <venture@google.com>
* test: disable OEM router unit-testsPatrick Venture2018-07-251-3/+4
| | | | | | | Until Issue #3325 is resolved, this will make the CI stable again. Change-Id: I5156f1fed153586512d184c973a8be4036620d19 Signed-off-by: Patrick Venture <venture@google.com>
* Add OemRouter facility.Peter Hanson2018-07-252-2/+184
| | | | | | | | | | | | | OemRouter adds a facility to register OEM Group Message handlers, then dispatch matching messages to the registered handler. Added as a core source so that any dynamic provider can register its messages without requiring any specific load order. Includes code fixes for x86 portability. Change-Id: I47b8fe7873e3c7fdf35a00d3c8a7e17d30c398c4 Signed-off-by: Peter Hanson <peterh@google.com> Signed-off-by: Patrick Venture <venture@google.com>
* Add code coverage for phosphor-host-ipmid.Emily Shaffer2018-07-181-5/+8
| | | | | Change-Id: I940aadefdf0f78182aad1d4e586e3178e2d2fe97 Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
* build: fix out of tree buildsPatrick Williams2016-11-041-1/+2
| | | | | | | | | | The test directory needs -I$(top_srcdir) in order to find the header files provided by the project itself. When doing an in-tree build, this is done automatically by automake due to 'config.h' being generated in the root. Change-Id: I5e59715657684a8019e9c48c835b29eb326f01a8 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Propose and implement unit test frameworkMatthew Barth2016-09-282-0/+18
Enable use of GoogleTest and created a sample unit test case. Change-Id: Ie370745a32777d4ed81ee24145364029c8e7bf02 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
OpenPOWER on IntegriCloud