summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Data checking fix for watchdog set/get commandsYong Li2019-10-113-26/+31
| | | | | | | | | | | | | | | | | | data length check for timeout action and byte 1 reserved field check are missing, causing not to throw the error; Log flags is on bit 7, also needs to right-shift this flag; This commit fixes these issues; Tested: Set different timer use/actions: ipmitool raw 0x06 0x24 0x85 0x0 0x0 0x0 0x64 0x00 ipmitool raw 0x06 0x24 0x84 0x1 0x0 0x0 0x64 0x00 Check the settings are correct: ipmitool raw 0x06 0x25 Signed-off-by: Yong Li <yong.b.li@linux.intel.com> Change-Id: Ia4226bb4597d2c670f93522aa763e43d15eb6cf1
* add "set system info" commandJia, chunhui2019-10-111-15/+108
| | | | | | | | | | | | | | | | | | | | | | Set/get system info commands are pair commands that customer could use to save/restore system specified infomation like machine serial numbner/OS version/.. etc. One typical scenario is that customer could check current OS version even when tareget system is powered off. Current openbmc implements "Get system info" but "Set system info" is not available. This changes implements "Set system info" command. Tested: :~# ipmitool raw 0x6 0x58 0x1 0x0 0x0 0x2 0x30 0x31 :~# ipmitool raw 0x6 0x59 0x0 0x1 0x0 0x0 11 00 00 02 30 31 :~# ipmitool raw 0x6 0x59 0x0 0x1 0x1 0x0 Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x59 rsp=0xc9): Parameter out of range Change-Id: Iaa66e30bcec708e28a01c2e81d612e6ffdd36383 Signed-off-by: Jia, chunhui <chunhui.jia@linux.intel.com>
* transporthandler: Rewrite + New HandlerWilliam A. Kennington III2019-09-277-1215/+993
| | | | | | | | | | | | | | | | | | This rewrites the old transport handler to use the new ipmi handler registration functions. It attempts to clean up the old code, by refactoring any business logic out of the code that parses the IPMI messages. This makes the code paths easier to understand and allows for better code re-use. This also gets rid of the concept of the settings change timer. Clients expect to see their settings take effect as soon as they are set, regardless of the "Set In Progress" flag. This means we no longer need a cache for our network settings that are about to be set by the daemon, and a client can hold the BMC in "Set In Progress" while it verifies settings like other BMC implementations. Change-Id: I5406a674f087600afdfc2c0b3adeacde10986abc Signed-off-by: William A. Kennington III <wak@google.com>
* Implemented close session cmd in host interfaceRajashekar Gade Reddy2019-09-256-0/+336
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix: execute get channel cipher suite in lan chanAyushi Smriti2019-09-251-0/+9
| | | | | | | | | | | | | | | | | | Get channel cipher suites command was executed for non lan channels. Fixing the same by adding active lan channel support check. Tested: ipmitool raw 0x06 0x54 0x01 0x00 0x80 01 c0 03 01 41 81 c0 11 03 44 81 //cmd executed for lan chan 1 ipmitool raw 0x06 0x54 0x00 0x00 0x80 Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x54 rsp=0xcc): Invalid data field in request //cc resulted for non lan chan 0 Signed-off-by: Ayushi Smriti <smriti.ayushi@linux.intel.com> Change-Id: Ic3c2dfa3f4537be789e2afc912fa8f4c2a49bda4
* Fix: refactor get channel cipher suite commandAyushi Smriti2019-09-254-78/+57
| | | | | | | | | | | | | | | Get channel cipher suites command updated as per new ipmi structure. Tested: ipmitool raw 0x06 0x54 0x01 0x00 0x80 01 c0 03 01 41 81 c0 11 03 44 81 //response Also verified by issuing cmd: ipmitool channel getciphers ipmi 0x01 which listed supported CIA algorithms as response Signed-off-by: Ayushi Smriti <smriti.ayushi@linux.intel.com> Change-Id: Ibc942f5b197c72071cd35a138fbe244db7519824
* Handle exceptions correctly in GetSelTime and SetSelTimeTom Joseph2019-09-251-2/+2
| | | | | | | | Tested: Ensured that the exception is caught in the command handler and printed on the journal Change-Id: I8b45bd154d0fe7f698487a19d01b1dd709c77c75 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Channel: Fix atomic lock issue for file copyRichard Marian Thomaiyar2019-09-241-0/+3
| | | | | | | | | | | | | | | Atomic lock was missing in between volatile / non-volatile channel configuration check and restore. This was causing random failure when instances init channel management code. Fixed the same, by having a lock for init channel. Tested: 1. Verified that existing ipmitool commands still works including user & channel commands 2. Verified that random failure doesn't happen. Change-Id: I612917ea1a767e353d0b16b7dd9144e0e99d46e7 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* Static code analysis scan issue fixChen,Yugang2019-09-233-4/+5
| | | | | | | | | | | | | Fix the issues found during code static scan Tested: test in board, function works fine. 1. busctl set-property for watchdog, it works fine. 2. It works by running "ipmitool chassis power soft". 3. run "ipmitool raw 0x6 0x46 1", get expected user information. Change-Id: I7a2cc3c934db6a7531f8a8ea05956cb6d6337633 Signed-off-by: Chen,Yugang <yugang.chen@linux.intel.com>
* Update GetSystemInfo with new APIJia, chunhui2019-09-231-132/+61
| | | | | | | | | | | | | | | | | | | Tested: verified with ipmitool raw command ipmitool raw 0x6 0x59 0x0 0x0 0x0 0x0 11 00 ipmitool raw 0x6 0x59 0x80 0x0 0x0 0x0 11 ipmitool raw 0x6 0x59 0x81 0x0 0x0 0x0 11 ipmitool raw 0x6 0x59 0x82 0x0 0x0 0x0 11 ipmitool raw 0x6 0x59 0x0 0x2 0x0 0x0 11 00 00 0a 69 6e 74 65 6c 2d 6f 62 6d 63 00 00 00 00 Change-Id: I2e648faa43fb8405b3cdd2f021fc1a12a78b4752 Signed-off-by: Jia, chunhui <chunhui.jia@linux.intel.com>
* drop entity YAML in favor of json provided filePatrick Venture2019-09-196-118/+30
| | | | | | | | | | 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
* sensorhandler: use entity-map from json if filledPatrick Venture2019-09-193-5/+57
| | | | | | | | | | Step 4 of the transition from YAML to JSON will return the data from the JSON file if present and valid, otherwise it'll fallback and return the default example YAML present in the repository. Tested: This was not tested. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I33c773fc53660a9eb5e27a8c8c3e231c64fe079d
* entitymap: move accessor to separate modulePatrick Venture2019-09-174-15/+14
| | | | | Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I8c80acb694d067043b77d81dbb9a7ba0057fef56
* move sensors into ipmi::sensor namespacePatrick Venture2019-09-173-19/+39
| | | | | | | | The object was left in the global namespace, but the type was in the ipmi::sensor namespace. Move the object into the namespace. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I88e46da4abda220d3b6fcc2ea64b8ef0decb0dc3
* move entities into ipmi::sensor namespacePatrick Venture2019-09-172-6/+18
| | | | | | | | The object was left in the global namespace, but the type was in the ipmi::sensor namespace. Move the object into the namespace. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: If3aa72ebbae980b0b837c45c8fcbc4b47b7fb742
* writeentity: add missing header utilityPatrick Venture2019-09-171-0/+2
| | | | | | | The code includes utility indirectly. Utility is required for make_pair(). Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I3cdca868a69ca67363f2e3692cbfd511dfde7b5f
* fix logic error for unpack vector of tupleVernon Mauery2019-09-162-8/+56
| | | | | | | | | | | | | | | | | | | | | 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>
* Change yield from ptr to objectJames Feist2019-09-133-5/+5
| | | | | | | | | | | | The ptr makes for ugly code: i.e. *(ctx->yield) all over the place. Change it to copy as it is just 4 pointers. Tested: ipmitool mc info still works Change-Id: I30c5bc395849875cd58925fac99bb23c1804cd5b Signed-off-by: James Feist <james.feist@linux.intel.com>
* Watchdog: move get and set watchdog to new api.Deepak Kumar Sahu2019-09-105-106/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite "get and set watchdog" command to use the newly introduced ipmi api. Tested: Verified using ipmitool "get and set watchdog", timer behavior is same before and after the changes. Testing Procedure: default watchdog timer is 11.2 seconds. ipmitool raw 0x06 0x25 ---> Get Output: 00 00 00 00 70 17 70 17 Note: Here 70 count(hex value)->112 count(decimal value)->112*100=11200ms [100ms per count]->11.2sec (watchdog timer) watchdog timer set to 20 seconds. ipmitool raw 0x06 0x24 0x44 0x01 0x00 0x10 0xc8 0x00 ----> Set output: ipmitool raw 0x06 0x25 ---> Get output: 04 01 00 00 c8 00 c8 00 Note: Here 20sec->20000ms->200count->c8 (hex value) Signed-off-by: Deepak Kumar Sahu <deepakx.sahu@intel.com> Change-Id: Id8c096bc1635d1900ee842a9726c49fb690fa8bc
* Move i2c WR api into libipmidYong Li2019-08-303-42/+80
| | | | | | | | | | | | Move the low-level i2c write-read api into libipmid, to allow provider libraries access to i2c without duplicating this code. Tested: I2c master write read command still works: ipmitool i2c bus=2 0x9c 8 0 Signed-off-by: Yong Li <yong.b.li@linux.intel.com> Change-Id: I0d5f82cf46ecf871eebb47aae25537b5da1f2e6a
* Add compile option to disable white list checking for I2C master WR commandYong Li2019-08-302-1/+25
| | | | | | | | | | | | | | | | By default this white list checking is enabled, we can disable it by using the below command, ./configure --disable-i2c-whitelist-check Tested: Without the --disable-i2c-whitelist-check compile option, the white list checking works as before "ipmitool i2c bus=2 0x9c 8 0" command will fail with error message: Unable to perform I2C Master Write-Read After adding the compile option, there is no such error. Signed-off-by: Yong Li <yong.b.li@linux.intel.com> Change-Id: I91ced8b0dfb1dbf51292a6b3dea6fd5c03bdbde7
* legacy handlers need a bigger bufferVernon Mauery2019-08-301-4/+3
| | | | | | | | | | | | | | | | | In the original ipmi execution queue, handlers were passed a larger buffer. The current code was only passing in the configured channel size, or 64 if no size was configured. This is too small and leads to buffer overflows for responses greater than 64 bytes. This brings the buffer sizes up to a point that matches the legacy code and to a size that is larger than any of IPMI standard transport sizes. Tested: used a bogus handler to create a large response and found that the entire response was returned. Change-Id: I91b359812247ae5fdef105c7b7a9dfe003548494 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Added VLAN ID checking condition in Set LAN configSuryakanth Sekar2019-08-282-1/+15
| | | | | | | | | | According to the VLAN 802.1VLAN spec, VLAN ID should be 1-4095 Unit test: Verified VLAN ID 1-4095 is allowed and CC returns for 0 & > 4095 Signed-off-by: Suryakanth Sekar <suryakanth.sekar@linux.intel.com> Change-Id: I54bbc94c814c98dda11f8241fa31bfe0e5bbb150
* Set/Get LAN conf 0xCC return for invalid LAN chnlSuryakanth Sekar2019-08-271-1/+13
| | | | | | | | | | | | | | | | | | | | | In set /get LAN configuration Channel number should be validate before process the request and we have to handle only LAN medium Channel. Tested: In Get/ Set LAN configuraion,0xCC should be return for non LAN channel numbers. Trying to set the IP Source to the Invalid /Valid LAN channel ipmitool raw 0xc 0x1 <Invalid LAN channel> 0x4 2 Response : 0xCC ipmitool raw 0xc 0x1 <valid LAN channel number> 4 2 Response : 0x00 Signed-off-by: Suryakanth Sekar <suryakanth.sekar@linux.intel.com> Change-Id: I6d173f1ddaf22a5ee221b15dd3a4c7b2793ab0b5
* entitymap: add json file loading if presentPatrick Venture2019-08-232-0/+30
| | | | | | | | | | Step 3 to handle the entity-map transition from YAML to JSON. This patchset adds a method that will process the json file, if present to build the map. Tested: This patchset has not been tested. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I79297aef59844a21f20c0a77de7a21264e2ed96a
* entitymap: add json parsing supportPatrick Venture2019-08-205-0/+327
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* user_channel: passwd_mgr: minor cleanup from cppcheckPatrick Venture2019-08-201-3/+4
| | | | | | | | | | | | | [user_channel/passwd_mgr.cpp:220]: (style) The scope of the variable 'userEPos' can be reduced. [user_channel/passwd_mgr.cpp:358]: (style) The scope of the variable 'userEPos' can be reduced. [user_channel/passwd_mgr.cpp:444]: (style) Variable 'fd' is assigned a value that is never used. Tested: Not tested. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: If02125c422ab1e9c15c6420dbf8da6a52fb68541
* user_channel: user_mgmt: minor cleanup from cppcheckPatrick Venture2019-08-201-2/+3
| | | | | | | | | | [user_channel/user_mgmt.cpp:1628]: (style) The scope of the variable 'usrEnabled' can be reduced. [user_channel/user_mgmt.cpp:310]: (style) Unused variable: update Tested: Not tested. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: Id38469ab5d5b0fa9c512f5a77fff1f1372e794c2
* sensorhandler: ipmi_sen_get_sdr: drop null checkPatrick Venture2019-08-201-5/+0
| | | | | | | The pointer for the request is never null, therefore do not check. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I03639db3cb579260cb6579ad01837e7078520f1f
* sensorhandler: ipmi_sen_get_sdr: invert logic checkPatrick Venture2019-08-201-80/+82
| | | | | | | | | Reduce indentation of code by flipping logic check. It looks like the failure case should also set dataLen to 0, but it didn't previously, therefore that would qualify for a follow-on patch. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I4abe6ec9382e7c5632bc364ba123c31323677e11
* Revert "Add system interface as the channel for the legacy interface"Tom Joseph2019-08-201-2/+1
| | | | | | This reverts commit 152e98cd339f3df58d5832af5779eff541f0adc5. Change-Id: Ib36cdbb2d140de749335a3ae9cbb279563c33a1c
* Add system interface as the channel for the legacy interfaceTom Joseph2019-08-181-1/+2
| | | | | | | | | The legacy interface org.openbmc.HostIpmi is used by the btbridge interface and the channel number was set to 0 which implies the IPMB bridge. This is corrected to use the system interface. Change-Id: I870d8fc6c2461b7fc75a90f9576f08599038f211 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* user_mgmt: update default ipmi_user.json file.Saravanan Palanisamy2019-08-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | By default, Serial Over LAN (SOL) payload access should be enabled for all users in all channels. Ensure that this clause is met when default ipmi_user.json file is created, usually because of BMC re-flashing. Tested-by: 1. Check SOL payload access values in ipmi_user.json after reflashing. // Command - grep "std_payload1" /var/lib/ipmi/ipmi_user.json // Response - OK. ... "payload_enabled":{..."std_payload1":[true,true,...]...}, ... 2. Check SOL payload access values in ipmi_user.json after BMC FW update // Command and Response same as (1.). OK. // ipmi_user.json file is updated upon its first write after FW update. Signed-off-by: Saravanan Palanisamy <saravanan.palanisamy@linux.intel.com> Change-Id: I604aac6d000eac40a3a3460ea46c6fe81d285dee
* SensorReading: Move set SensorReading to new API.Deepak Kumar Sahu2019-08-131-40/+53
| | | | | | | | | | | | Rewrite "set SensorReading" command to use the newly introduced IPMI provider API. Tested: Verified using ipmitool "set SensorReading", behavior is same before and after the changes. Signed-off-by: Deepak Kumar Sahu <deepakx.sahu@intel.com> Change-Id: I9ee4276775e7c4a348c32a746e7fd7d55a943e06
* sensordatahandler: Throw on sensor's OperationalStatusBrandon Kim2019-08-124-0/+67
| | | | | | | | | | Add UPDATE_FUNCTIONAL_ON_FAIL and only when defined, read sensor's OperationalStatus interface for the functional property and throw if the sensor is not funcitonal. Bug: openbmc/phosphor-hwmon#10 Signed-off-by: Brandon Kim <brandonkim@google.com> Change-Id: I1144a6d3f8145bda73f3363664ca48b848a295db
* fru: support two time string formatsPatrick Venture2019-08-081-3/+26
| | | | | | | | | | | Support parsing two time string formats to enable use of ipmi-fru-parser and entity-manager to provide FRU details on dbus. Tested: Verified the entity-manager dbus output for the FRU MfgDate is now parsed correctly. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I053ec225b51166269c5a5a800ad8d607fd0cc233
* gitignore: add test and coverage artifactsPatrick Venture2019-08-081-3/+3
| | | | | Signed-off-by: Patrick Venture <venture@google.com> Change-Id: If630a4c2411a66b4995f6807e185bd5cd36d165e
* fru: remove assumption on object ownerPatrick Venture2019-08-011-7/+25
| | | | | | | | | | | | | The fru read yaml configuration allows specifying a dbus path and a dbus interface. Dynamically look up what service provides that interface with that dbus path. Continue supporting partial paths for devices owned by the Inventory Manager. Tested: Verified the module now reads the FRU properties over dbus if the object is owned by another service (exported via entity-manager). Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I5c0aeb11d0b33fab437a55dea3351a47feab0783
* fru: use ipmifruproperty for property lookupPatrick Venture2019-08-012-6/+7
| | | | | | | | | | | | | | | | | | The member IPMIFruData::property was unused and instead the property lookup was performed with the phosphor-dbus-interface property name. The IPMIFruData::property field is meant to map from dbus property to FRU property to allow a variety of dbus mappings. Tested: Verified the member was unused. Tested: Verified that a configuration yaml mapping is respected and ipmid will report the information expected given a FRU published to dbus. Note: The fields for IPMI FRU properties were taken from the example YAML and are expected to be what was used by machines leveraging this feature. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I44f73b67ecdeae2d772daa38cc21cc18cdf9c7ce
* user_mgmt: Enable SOL payload access by default.Saravanan Palanisamy2019-08-011-29/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | Enabling SOL payload access for all users in all channels, by default. It is not mandated by IPMI spec, but needed for backward-compatibility. Tested-by: 1. Run Get User Payload Access Command for random user on LAN channel. // Command - (channel 3 is of LAN channel type) ipmitool -I lanplus...raw 0x06 0x4D 3 7 02 00 00 00 // Response 2. Disable SOL payload and rerun Get User Payload Access Command. // Command ipmitool -I lanplus...raw 0x06 0x4C 3 0x48 0x02 0 0x00 0 ipmitool -I lanplus...raw 0x06 0x4D 3 8 00 00 00 00 // Response 3. Run Get User Payload Access on non-LAN, session-less channel. // Command - (channel 7 is KCS channel type) ipmitool -I lanplus...raw 0x06 0x4D 7 7 Error:(...rsp=0xcc): Invalid data field in request // Response 4. Check SOL session activation and 'ipmi_user.json' file contents. Change-Id: I48c50e6366a0025d5ae066c8a8f3694d2f710732 Signed-off-by: Saravanan Palanisamy <saravanan.palanisamy@linux.intel.com>
* sensorhandler: add accessor for entities singletonPatrick Venture2019-07-311-7/+16
| | | | | | | | | Add an accessor to grab the entities singleton as a step towards building it on first access from json. Tested: This change has not been tested beyond build verification. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I2cf1fbd7ad10b4e1b63af347c824ad37bc8a56c9
* Sensorhandler: move get SDR info & reserve SDR to new APIjayaprakash Mutyala2019-07-303-71/+44
| | | | | | | | | | | | | | | | | | | | Rewrite "Get SDR info and Reserve SDR" command to use the newly introduced IPMI provider API. Tested: verified using ipmitool sensor commands. a. get SDR info Command: ipmitool raw 0x04 0x20 0x01 Output: 02 01 Command: ipmitool raw 0x04 0x20 0x00 Output: 00 01 b. reserve sdr Command: ipmitool raw 0x04 0x22 Output: 01 00 Signed-off-by: jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> Change-Id: Id1d7015cec45c5524210033e4210c710da27e9ae Signed-off-by: jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
* chassishandler: move set chassis cap to new apianil kumar appana2019-07-251-53/+54
| | | | | | | | | | | | | | | Rewrite set chassis capabilities to use new ipmi provider api Tested: verified ipmitool raw get chassis capabilities command ipmitool raw 0 5 00 20 20 20 20 20 // set chassis cap command ipmitool raw 0 0 // get chassis cap command 00 14 14 14 14 14 // updated response in hex Signed-off-by: anil kumar appana <anil.kumarx.appana@intel.com> Change-Id: Idcc7c12250d4465ff838c15ba0d511701688a3a2
* storagehandler: move get & reserve SEL to new APIjayaprakash Mutyala2019-07-252-65/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite "Get sel info & Reserve SEL" commands to use the new API. Tested: 1. verified ipmitool sel info is same both before and after the changes Command: ipmitool sel info Output: SEL Information Version : 1.5 (v1.5, v2 compliant) Entries : 0 Free Space : 65535 bytes or more Percent Used : unknown Last Add Time : Not Available Last Del Time : Not Available Overflow : false Supported Cmds : 'Delete' 'Reserve' Command: ipmitool raw 0x0a 0x40 Output: 51 00 00 ff ff ff ff ff ff ff ff ff ff 0a 2. verfied the Reserve SEL command ipmitool raw 0x0a 0x42 01 00 ipmitool raw 0x0a 0x42 02 00 Change-Id: I37d602293066274a3fc417ad7e59cea3c73315f7 Signed-off-by: jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> Signed-off-by: jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
* user_layer: Add get/set user payload access.Saravanan Palanisamy2019-07-196-0/+534
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IPMI Spec reference: Section 24.6, 24.7. Support is added to get/set user access details for the unreserved, supported payload types defined by Spec. SOL is the only unreserved, supported payload currently. If support is needed for unreserved std/oem payload types in future, they can be enabled with minor source code changes to this implementation. All payload types are packed in a JSON object "payload_enabled" in ipmi_user.json file. Tested-by: 1. For user 8 in channel 3, Enable SOL payload. // Command - (channel 3 is of LAN channel type) ipmitool -I lanplus...raw 0x06 0x4C 3 0x8 0x02 0 0 0 // Verify it with Get User Payload Access Command ipmitool -I lanplus...raw 0x06 0x4D 3 8 02 00 00 00 // Response 2. Disable SOL payload. // Command ipmitool -I lanplus...raw 0x06 0x4C 3 0x48 0x02 0 0x00 0 // Verify it with Get User Payload Access Command ipmitool -I lanplus...raw 0x06 0x4D 3 8 00 00 00 00 // Response 3. Enable unsupported payload stdPayload7. // Command ipmitool -I lanplus...raw 0x06 0x4C 3 0x8 0x80 0 0 0 Error: Invalid data field in request // Response Change-Id: Idc57b04a747e55666407d928d8b2169223501e5b Signed-off-by: Saravanan Palanisamy <saravanan.palanisamy@linux.intel.com>
* sensorhandler: fix type of get_reservation_id()Emily Shaffer2019-07-121-1/+1
| | | | | | | | The implementation of get_reservation_id() is combining two uint8_t, but currently returns a uint8_t. Return instead a uint16_t to correct this. Change-Id: I5bbfdd230bcc2bb467b755ac90a39c6bf11167d1 Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
* storagehandler: move get sdr info to new APIPradeep Kumar2019-07-052-34/+18
| | | | | | | | | | | | | Rewrite: "Get SDR repository info" command to new IPMI provider API. Tested: Verified using ipmitool. ipmitool raw 0x0a 0x20 51 01 00 ff ff 00 00 00 00 00 00 00 00 00 Change-Id: I4b18631c4b4182f2c98caa145c151f3079cd7fc4 Signed-off-by: Pradeep Kumar <pradeep1x.kumar@intel.com> Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* docs: add reviewing chapter to testing.mdEmily Shaffer2019-06-251-0/+37
| | | | | | | | | | Cover some best practices while reviewing a test suite, as well as how to run tests locally without impacting your current environment. Tested: Viewed in Chrome Change-Id: I7356a90fcc9e6d2679e1f9e9a49515a1038a8914 Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
* doc: add writing test chapter to testing.mdEmily Shaffer2019-06-251-0/+279
| | | | | | | | | | | | | | Add a tutorial on writing a new test, based on writing unit tests for sensorhandler.hpp - specifically GetSdrReq, as it's a good candidate for unit testing. Included is a nonexhaustive list of testing best practices. More best practices are always welcome. Tested: Viewed testing.md with Chrome builtin Markdown interpreter Change-Id: I418af8f972a5a0ff36b786cda6fdf9b6b308e8d5 Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
* docs: add chapter on running testsEmily Shaffer2019-06-251-2/+134
| | | | | | | | | | | | | | | | | | | Add instructions for installing and setting up Docker, modifying the setup for phosphor-host-ipmid, and running the tests. This also covers reading the .log files generated during the testing run. These instructions cover how to use `git worktree` to make a copy of your working repo which is usable by Docker, but still up-to-date with the hacking you've been doing. There's also a brief method of coming up with a similar setup using a local remote or symlink. The worktree method was selected because it is impossible to make the code you're testing out-of-sync with the code you will submit to Gerrit for review. However, we need to mount the working repo to the Docker container too to make this work (since Git will look there for the .git/ dir). Tested: Viewed in Chrome Change-Id: I684664e2580637b34fbb79eceb838986425852c0
OpenPOWER on IntegriCloud