summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Fix openFiles refcountKun Yi2019-11-251-0/+24
| | | | | | | | | The old code deletes session from the session map before doing a lookup of the path. Fix the order and add a unit test to catch the error case. (The unit test would fail without this fix). Signed-off-by: Kun Yi <kunyi731@gmail.com> Change-Id: If043d6aad7bbaafa19ae3b63a6d9cc7a836d25b5
* test: Add unit tests for session expirationKun Yi2019-11-212-0/+63
| | | | | | | | Add simple tests to ensure the session expire method is called when the timeout is set to zero. Signed-off-by: Kun Yi <kunyi731@gmail.com> Change-Id: Ic6e973ede760a6a6f15726d5b6c93a892d858c8b
* blobs: s/struct BlobMeta/BlobMeta/gPatrick Venture2019-06-176-23/+23
| | | | | | | | | | | | | | Because this structure is not anything special, simply use the cpp idiomatic way of referencing the object. Consistently, structures that are packed still have "struct" used in declarations. However, this distinction is only clear through its usage and nothing in the language. Perhaps a better approach would be notational naming struct PackedXYZ {};. However, that can get out of control quickly. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I3b7e48e4b6687ef2e15e9d07c0eeba96eb5d2552
* blobs-ipmid: use enum class for BlobOEMCommandsPatrick Venture2019-05-2012-33/+33
| | | | | Signed-off-by: Patrick Venture <venture@google.com> Change-Id: Ic5aa3e38b4df33a2cfa29c575f17097e38d06605
* build: split object to enable coveragePatrick Venture2019-03-191-26/+26
| | | | | | | | | Split the object into two pieces so we can pass part of it to the unit-tests. Tested: Verified the coverage output processed the files. Change-Id: Idf1bdf9d21eb1324395eb9a2c09ff8f1b4ecad6b Signed-off-by: Patrick Venture <venture@google.com>
* autotools: Fix for autoconf-archive 2019.01.19William A. Kennington III2019-03-191-1/+0
| | | | | | | | | The code coverage macros from the archive changed in a backward incompatible way. This adds a workaround to autodetect either version and do the right thing. Change-Id: I09b88e6b4792c99140a73a4ceb11d2896ee13562 Signed-off-by: William A. Kennington III <wak@google.com>
* use ipmiblob library from ipmi-blob-toolPatrick Venture2019-03-084-150/+59
| | | | | | | | | | Drop all code that is now handled by the ipmiblob library provided by the new ipmi-blob-tool. This is a library that can be included on the BMC if necessary, but relies on nothing that is strictly meant for the BMC. Change-Id: I2b02ae0d432e84c08e598d27eef85b57c06a70fc Signed-off-by: Patrick Venture <venture@google.com>
* use filesystem instead of experimentalPatrick Venture2019-03-081-2/+2
| | | | | | | | Use filesystem now that it should be available instead of experimental::filesystem. Change-Id: Ia9b17f33ced70fe2f1f12f11d8708d15ff422bfa Signed-off-by: Patrick Venture <venture@google.com>
* build: enable valgrindPatrick Venture2019-03-071-0/+1
| | | | | | | Enable valgrind tests. Change-Id: Ib5ec22a19c043ef45f5274e4716e2abbae9c19da Signed-off-by: Patrick Venture <venture@google.com>
* build: enable code coveragePatrick Venture2019-03-071-2/+10
| | | | | | | | Enable code coverage for the project. Valgrind not enabled in this step. Change-Id: I439d58b23d2bc29d6f602600319074c8fd8c04d6 Signed-off-by: Patrick Venture <venture@google.com>
* build: rework gtest checksPatrick Venture2019-03-061-4/+4
| | | | | | | Rework gtest checks to be modeled after openbmc/gpioplus. Change-Id: I263bf12c0323ebee5d95b569ce28da2042bd3c1d Signed-off-by: Patrick Venture <venture@google.com>
* manager: add hard-coded read checksPatrick Venture2019-02-011-1/+32
| | | | | | | | | | | | | The host-client cannot try to read back more than this number of bytes without hitting a memory overflow in phosphor-host-ipmid. The method we can call to dynamically receive that number isn't currently linking out of the userlayer library. Note: Once the configure_ac can find and provide the userlayer library from phosphor-host-ipmid, we can remove the hard-coded 64 and 0xe. Change-Id: I08f6bb59ce44279f76a494dccaa477ae75d532c4 Signed-off-by: Patrick Venture <venture@google.com>
* stop installing manager headerPatrick Venture2019-01-1527-36/+114
| | | | | | | | Stop installing the manager header as it is no longer meant to be exported, but rather used only internally within this repository. Change-Id: I2ab21a31fd745e1b3e36fc39ffea5e26d373ff51 Signed-off-by: Patrick Venture <venture@google.com>
* bugfix: process: can be only crcPatrick Venture2019-01-141-3/+3
| | | | | | | | | The read command, if returning 0 bytes of data, does return the CRC. Tested: Verified via a client implementation that it now behaves as expected on returning 0 bytes from a read (returns only the CRC). Change-Id: I84200c0fbe8400cc9234b55991fee750cb84faa2 Signed-off-by: Patrick Venture <venture@google.com>
* add dynamic library interface to enable testingPatrick Venture2018-11-283-1/+125
| | | | | | | | Add interface defining the methods for dynamic linking to enable testing. Change-Id: If4d090d3cedc019b426435a1f651191803bfc1a9 Signed-off-by: Patrick Venture <venture@google.com>
* bugfix: skip 0'd crc bytes on reply computationPatrick Venture2018-11-131-1/+1
| | | | | | | | | | Skip the 0'd CRC bytes on reply computation, mirroring the skipping during request validation. Tested: Verified via client the CRC for the reply now matches expectations. Change-Id: I18da28604a388fb4210c55f3e54410a067b9f10a Signed-off-by: Patrick Venture <venture@google.com>
* process: add IPMI error return mechanism and update errorsPatrick Venture2018-11-1310-20/+50
| | | | | | | | | | | The IPMI packet validation code must return specific IPMI errors corresponding to what error has occurred instead of the invalid command error. Update all IPMI handler pieces to return more specific errors. Change-Id: I8d21e92015d84cc0880e3b83991aed7288e19eab Signed-off-by: Patrick Venture <venture@google.com>
* new command: BmcBlobWriteMetaPatrick Venture2018-10-103-0/+172
| | | | | | | Implement new command BmcBlobWriteMeta. Change-Id: I2e148f4bde4ef5d24db7e30bb02bdde024d9166a Signed-off-by: Patrick Venture <venture@google.com>
* header: install test mock headersPatrick Venture2018-10-0423-87/+21
| | | | | | | | IPMI Blob handlers will need to include these mocks when building unit-tests. Therefore, they must be installed. Change-Id: I4c8ed0fa1a4a8912853c024206ef5e61f87707d8 Signed-off-by: Patrick Venture <venture@google.com>
* move blobs and manager header into installation dirPatrick Venture2018-09-2712-14/+18
| | | | | | | | The blobs and manager header will be used by handlers once we've transitioned to dynamic loading. Change-Id: Ieae8fcfe383007731cb4f8b2619612c3bfa47f50 Signed-off-by: Patrick Venture <venture@google.com>
* initial drop of phosphor-ipmi-blobsPatrick Venture2018-09-1528-0/+2362
This implements a majority of the OEM IPMI BLOBS protocol. The only piece missing from this is the timed expiration of sessions. Change-Id: I82c9d17b625c94fc3340edcfabbbf1ffeb5ad7ac Signed-off-by: Patrick Venture <venture@google.com>
OpenPOWER on IntegriCloud