summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-07-09Fix Cmake MessageJames Feist1-1/+1
Logging gets enabled in debug builds Tested: Message was right Signed-off-by: James Feist <james.feist@linux.intel.com> Change-Id: I184ed9b9e09a67144b83bf84a63da346437d4214
2020-07-09Fix -1 issue when fan collection size is 0.Kuiying Wang1-2/+5
When fan collection size is 0, the MinNumNeeded shown -1 (4294967295/0xffffffff) but not 0. "Redundancy": [ { "@odata.id": "/redfish/v1/Chassis/WC_Baseboard/Thermal#/Redundancy/0", "@odata.type": "#Redundancy.v1_3_2.Redundancy", "MemberId": "Tach", "MinNumNeeded": 4294967295, "Mode": "N+m", "Name": "Tach", "RedundancySet": [], "Status": { "Health": "OK", "State": "Enabled" } } Tested: "MinNumNeeded" is 0 correctly. https://bmc_ip/redfish/v1/Chassis/WC_Baseboard/Thermal "Redundancy": [ { "@odata.id": "/redfish/v1/Chassis/WC_Baseboard/Thermal#/Redundancy/0", "@odata.type": "#Redundancy.v1_3_2.Redundancy", "MemberId": "Tach", "MinNumNeeded": 0, "Mode": "N+m", "Name": "Tach", "RedundancySet": [], "Status": { "Health": "OK", "State": "Enabled" } } Change-Id: I8bf01dacd705e5309c161c5f04289d2df45ca583 Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
2020-07-08Fix: ignore D-Bus error if not mandatory propertyAppaRao Puli1-3/+4
Some platforms doesn't have PFR support. In such case D-Bus service or object may not exist. So corrected code to set the default value of PFR provisioning status(NotProvisioned) and don't return error as this is not mandatory property. Tested: - Get on /redfish/v1/Systems/system is success in all platforms. Change-Id: I622bab7fd64fa71f91d39a62c5830e65fa821fb5 Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-07-08Update the DBus path for hypervisor ethernet interfaceSunitha Harish2-19/+22
Tested by: GET commands for resource Systems-hypervisor Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: I7f6185d78b4867246b70e6e4a232afb287d1d962
2020-07-02Support the $filter query params for SSE streamAyushi Smriti2-4/+143
This commit adds the support for $filter query paramater in the URI for SSE stream. Method: GET URI: /redfish/v1/EventService/Subscriptions/SSE? $filter=(MessageIds%20eq%20DCPowerOn) or (MessageIds%20eq%20DCPowerOn) Tested: - From browser sent request using SSE URI along with filter query param - query params were read and parsed successfully. - used SubmitTestEvent and could see test events coming to BMC. - Ran redfish validator successfully. - Performed GET on Subscription collections and Subscription/<id> URI and checked for valid data. Change-Id: Ie18546749495175ede918ab933ff8dd1d65b775f Signed-off-by: Ayushi Smriti <smriti.ayushi@linux.intel.com> Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-07-02EventService: Support for Server Sent Events(SSE)AppaRao Puli4-16/+403
Add support for Server Sent Events(SSE) Filters support is not part of this commit. Tested: - GET on URI /redfish/v1/EventService/Subscriptions/SSE/ from chrome browser, can see all BMC Events on browser. - Redfish validator is successful. Change-Id: Icd10cdad20c4529f64c97b67d46f2e4a7e0c329c Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-07-02EventService: Add retry configuration supportAyushi Smriti3-16/+99
This commit is to pass configuration parameters: retry attempts, retry interval secs and retry policy to http client and take required delivery retry policy action. Also, perform async wait for retryTimeoutInterval before each retry attempts. Tested: - Set and verified config properties by sending PATCH req on EventService and EventDestination uri. - Verified the appropriate delivery retry policy action block reached. - Verified the async_wait logic by triggering retry case depending failed state of connection. - could see a wait for timeout interval before next retry. Signed-off-by: Ayushi Smriti <smriti.ayushi@linux.intel.com> Change-Id: Id1366fca59dc9e6543c553bfe5df95a59f468bc7 Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-07-02System: LastResetTimeGunnar Mills1-1/+50
System LastResetTime was added in Redfish release 2020.2. It maps to LastStateChangeTime on D-Bus. "Reset" is an overloaded term in Redfish, "Reset" includes power on and power off. Even though this is the "system" Redfish object look at the chassis D-Bus interface for LastStateChangeTime since this has the property and gives the needed information. LastStateChangeTime on D-Bus is in epoch time, in milliseconds. Redfish uses the ISO 8601 standard for dates. Will be used on the OpenBMC GUI. Tested: Validator passes. curl -k https://$bmc/redfish/v1/Systems/system ... "LastResetTime": "2020-06-30T14:36:17+00:00", Took the epoch time at LastStateChangeTime and verified when converted it was the same. GMT: Tuesday, June 30, 2020 2:36:17.532 PM Change-Id: Iac12ea15915bb0fd1f0e4ca0b4a4281283c2a5b7 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-07-01network_protocol: Fix for SSH portJayaprakash Mutyala1-0/+2
Issue: As per the OCP Redfish Profile v1.0 specification, SSH read only parameter. By default SSH is disable, but ProtocolEnabled and Port attributes are mandatory to display in Redfish. But Port property is not displayed in Redfish URI. Fix: As Port attribute is mandatory for SSH property, initialized with null. Tested: 1. Verified redfish validator passed 2. Verified details from Redfish GET: https://<BMC-IP>/redfish/v1/Managers/bmc/NetworkProtocol Before: Response: "SSH": { "ProtocolEnabled": false }, After: "SSH": { "Port": null, "ProtocolEnabled": false }, Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> Change-Id: I203b321c3b41bab2017e7c6b5e55aa3463ea6e83
2020-07-01Fix : Compilation issue when ssl is disabledManojkiran Eda1-0/+5
- When the SSL is disabled, the socket that bmcweb uses would be a basic_socket type , and that does not have a next_layer as that itself is the basic socket, we can directly read the socket object/ or use the lowest_layer() of the socket to get the ip address from it. - When SSL is enabled, the socket that bmcweb uses would be an ssl stream over basic_socket, and here the next_layer would be basic_socket, so the existing logic holds good. - The idea behind this commit is to , have a conditional check for SSL vs non-SSL configurations before reading the socket for ip address. Tested By: * cmake -DBMCWEB_INSECURE_DISABLE_SSL=1 -DCMAKE_BUILD_TYPE:type=Debug ../ ; make - The above Compilation was successfull. Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com> Change-Id: I2b9a127be30b11b056641342e0af06118c526528
2020-06-30Add Crashdump.Telemetry interface and triggerKenny L. Ku2-2/+79
Tested: - Sent post requests Crashdump.OnDemand & Crashdump.Telemetry and correct trigger is received in crashdump application. - Redfish validator is run successfully. Signed-off-by: Kenny K. Ku <kenny.k.ku@intel.com> Change-Id: Ie0f49d3230aeb4450e11dfa2d46e309946763a6a
2020-06-29openbmc_message_registry: update failure reason in FirmwareUpdateFailedChalapathi Venkataramashetty1-3/+3
Update the failure reason in FirmwareUpdateFailed redfish message entry. Tested: 1. Update the corrupted image so that fw update fails. POST: https://<BMC_IP>/redfish/v1/UpdateService/ with <Corrupted_Update_Capsule> binary file Check event logs in redfish. Command: GET: https://<BMC_IP>/redfish/v1/Systems/system/LogServices/ EventLog/Entries Response: { "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/ Entries/1591111739", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "2020-06-02T15:28:59+00:00", "EntryType": "Event", "Id": "1591111739", "Message": "BMC firmware update to version 00.59 started.", "MessageArgs": [ "BMC", "00.59", "" ], "MessageId": "OpenBMC.0.1.FirmwareUpdateStarted", "Name": "System Event Log Entry", "Severity": "OK" }, { "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/ Entries/1591111742", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "2020-06-02T15:29:02+00:00", "EntryType": "Event", "Id": "1591111742", "Message": "BMC firmware update to version 00.59 failed: due to image verification error.", "MessageArgs": [ "BMC", "00.59", "due to image verification error" ], "MessageId": "OpenBMC.0.1.FirmwareUpdateFailed", "Name": "System Event Log Entry", "Severity": "Warning" }, Signed-off-by: Chalapathi Venkataramashetty <chalapathix.venkataramashetty@intel.com> Change-Id: I79e9509f129a3b87fb21e961e7b7bd78809ca1e2
2020-06-29Fix: Replace span with vectorAppaRao Puli1-10/+7
The message args in the event service data is coming empty and also crashing bmcweb when multiple arguments present. The boost::beast::span has issue in passing it as reference to function for assignment. Replaced span with std::vector to avoid empty response to caller function. Tested: - All message arguments are working fine and resolved crash. Change-Id: I800247cfd0d5dba7698cdb3e60c1290e478bf3ac Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-06-29EventService: Add inotify on dir for event logAppaRao Puli1-15/+91
Redfish event log file (/var/log/redfish) may or may not exist while starting bmcweb. Also when event logs are cleared this file will be removed and rsync service will create it again. To handle above cases, Added inotify on /var/log/ directory. This directory watch will handle create/delete of log file and add/remove watch on event log file. Tested: - Removed event log file, re-started the bmcweb and did Ac cycle. Works fine. - Started bmcweb with existing event log file. - Verified the functionality by doing removal(clear event log) and creation of redfish event log file during run time. Change-Id: I6a6c48cf4a410ed6f11d73dae8484d4c21d01e37 Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-06-29Revert "Revert "EventService: Add event log support with inotify""AppaRao Puli2-1/+466
This reverts commit 29d2a95ba12f8b5abed040df7fd59790d6ba2517. Enable EventService back by fixing issue with not having '/var/log/redfish' file. Fix is at: https://gerrit.openbmc-project.xyz/#/c/openbmc/bmcweb/+/33639/ Tested: - Along with above mentioned change, removed '/var/log/redfish' file and restarted bmcweb. It works. Change-Id: Ia908bbdf5b9a643afee212a526074f62372208dc Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-06-27Update Service: Change error message based on error logsJames Feist4-3/+112
THis adds support for better error responses based on the logs generated by phosphor-software-manager. Tested: Got 400 error with different messages based on failure type { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "Invalid file uploaded to /redfish/v1/UpdateService: Invalid archive.", "MessageArgs": [ "/redfish/v1/UpdateService", "invalid archive" ], "MessageId": "OpenBMC.0.1.0.InvalidUpload", "Resolution": "None.", "Severity": "Warning" } ], "code": "OpenBMC.0.1.0.InvalidUpload", "message": "Invalid file uploaded to /redfish/v1/UpdateService: Invalid archive." } } { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "Invalid file uploaded to /redfish/v1/UpdateService: Invalid image format.", "MessageArgs": [ "/redfish/v1/UpdateService", "invalid image format" ], "MessageId": "OpenBMC.0.1.0.InvalidUpload", "Resolution": "None.", "Severity": "Warning" } ], "code": "OpenBMC.0.1.0.InvalidUpload", "message": "Invalid file uploaded to /redfish/v1/UpdateService: Invalid image format." } } { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_0_0.Message", "Message": "The resource /redfish/v1/UpdateService was unable to satisfy the request due to unavailability of resources.", "MessageArgs": [ "/redfish/v1/UpdateService" ], "MessageId": "Base.1.4.0.ResourceExhaustion", "Resolution": "Ensure that the resources are available and resubmit the request.", "Severity": "Critical" } ], "code": "Base.1.4.0.ResourceExhaustion", "message": "The resource /redfish/v1/UpdateService was unable to satisfy the request due to unavailability of resources." } } Change-Id: Ida9a23c10aedbf9a48c96f4050a04e06bddff284 Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-06-26Enable retrieving mapping of Redfish URI to D-Bus sensor pathAdrian Ambrożewicz3-46/+179
Background: Change is necessary to support TelemetryService implementation. TelemetryService specifies its own resource type for data - MetricDefinition. In principle - MetricDefinition might point to Redfish Sensor in the system. Each MetricDefinition requires MetricProperty - URI to specific property in resource wih the value. This change allows retrieving such data alongside corresponding D-Bus sensor to be used as source of Metrics value. This change: Function was implemented to allow retrieving mapping of Redfish URI paths to D-Bus sensors in the system. Some minor refactoring in regards to SensorsAsyncResponse were also introduced to enhance code locality. Idea for the changes was to be the least intrusive if possible, as retrieving sensors in the system requires lots of processing. Existing logic was used and left intact. Utilizing existing logic required to 'fake' a HTTP request to traverse the sensors in the system and build the response. It's crucial to use exact logic of building Redfish nodes representation, as goal of the function is to retrieve exact Redfish URI for sensor value. Extra parameter was introduced to SensorsAsyncResp - callback to be called when sensor data will be fully determined. After processing is complete caller is notified with the outcome (success or failure) and map<URI:D-Bus sensor>. Testing: - all positive cases (3 chassis, 3 subnodes) in the system, one of obtained mappings looked like the following: { /redfish/v1/Chassis/WP_Baseboard/Power#/Voltages/3/ReadingVolts : /xyz/openbmc_project/sensors/voltage/P1V8_PCH } - negative cases (wrong chassis, wrong subnode) - callback with error status was called - RedfishServiceValidator passed Signed-off-by: Adrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com> Change-Id: I4389eb3df275126974168d1bb9af33dbf5cdb5b7
2020-06-25Manager: LastResetTimeGunnar Mills1-1/+38
Manager LastResetTime was added in Redfish release 2020.2. It maps to LastRebootTime on D-Bus. LastRebootTime on D-Bus is in epoch time, in milliseconds. Redfish uses the ISO 8601 standard for dates. Will be used on the OpenBMC GUI. Tested: Validator passes. curl -k https://$bmc/redfish/v1/Managers/bmc ... "LastResetTime": "2020-06-23T19:43:24+00:00", Took the epoch time at state/bmc0/attr/LastRebootTime and verified when converted it was the same. GMT: Tuesday, June 23, 2020 7:43:24 PM Change-Id: I55da7ad87ccd6021e4a8e7d522333941afe4084d Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-06-25Remove done TODOGunnar Mills1-1/+0
ForceRestart support was added here: https://github.com/openbmc/bmcweb/commit/d22c8396f0bcec4488d0c98eae3092384b3a5929 Change-Id: I631d465861fb423b1915f5fcc384b8117adf6bd5 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-06-24Validation enhancement for Hypervisor EthernetInterface update.Sunitha Harish1-1/+8
This commit returns propertyNotWritable error for Hypervisor "IPv4Addresses" parameter. Without this, if the PATCH operation includes this parameter; then bmcweb returns the error as "PropertyUnknown" which is not meaningful. Tested By: PATCH -D patch.txt -d '{"IPv4Addresses": [null]}' https://${bmc}/redfish/v1/Systems/hypervisor/EthernetInterfaces/<intf> { "IPv4Addresses@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_0_0.Message", "Message": "The property IPv4Addresses is a read only property and cannot be assigned a value.", "MessageArgs": [ "IPv4Addresses" ], "MessageId": "Base.1.4.0.PropertyNotWritable", "Resolution": "Remove the property from the request body and resubmit the request if the operation failed.", "Severity": "Warning" } ] } Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: Ia3bf142068128ab742864030b867d12e5c2697e0
2020-06-23Add non-versioned NamespaceGunnar Mills2-0/+8
Redfish schemas have a non-versioned Namespace of the schema: https://github.com/openbmc/bmcweb/blob/master/static/redfish/v1/schema/OemSession_v1.xml#L19 https://github.com/openbmc/bmcweb/blob/master/static/redfish/v1/schema/Zone_v1.xml#L42 Add that to OemLogEntry and OemLogService. This fixes the "badNamespaceInclude" Redfish validator errors. These schemas used to have this but was removed in https://github.com/openbmc/bmcweb/commit/239c4b88e53fc39f1e3ac9597acfcd8378bdfc4e# Alternative to https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/33918/4/static/redfish/v1/%2524metadata/index.xml Tested: Validator passes. Change-Id: Ibcc831db3d5c243bd0fff2e527e04392aebeda5f Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-06-23Move to 2020.2Gunnar Mills166-2326/+6877
Point update_schemas.py at 2020.2 and run the script. An overview of 2020.2 can be found at: https://www.dmtf.org/sites/default/files/Redfish_Release_2020.2_Overview.pdf Tested: Loaded on a Witherspoon and ran the validator. See the new schemas. Change-Id: Idb6cbc58efe484dcffa0cc22deff3a4746af67ed Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-06-23Redfish: Add chassis resetP.K. Lee2-0/+76
Add chassis reset by using Redfish. Tested: Passed validator. Chassis reset worked. Usage: POST on /redfish/v1/Chassis/chassis/Actions/Chassis.Reset/ { "ResetType": "PowerCycle" } Change-Id: Ia8949e6695e60ee63776ac70e4f8cd85a4b186c3 Signed-off-by: P.K. Lee <p.k.lee@quantatw.com>
2020-06-22Dictionary translating ME Health to Redfish EventsAgnieszka Szlendak1-2/+330
This change follows commit intel-ipmi-oem/31645. Following code adds ME-specific event definitions to OpenBMC Message Registry. Testing: - injected all possible events with busctl call (faking ME) - tested on actual platform with manually triggered events by actual ME Signed-off-by: Agnieszka Szlendak <Agnieszka.Szlendak@intel.com> Change-Id: I36e26fc940d7fd279870504a19c3b37dd64d115e
2020-06-22Redfish: Changes in Oem schemas for dumpAsmitha Karunanithi4-172/+111
Implemented Oem schemas for extending LogService and LogEntry Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com> Change-Id: I37d56b33403700ee65cd6ec7dee06395525d335c
2020-06-19Drop the boost 1.7 related dependencyManojkiran Eda5-40/+14
- There are few pieces in the code, that depends on boost 1.71 & 1.70 library. - Now, that bmcweb is moving towards 1.73, we can safely remove those dependencies. Tested By: - Compiled in all sdks & unittests passed. Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com> Change-Id: I9ac6a002bf389afcad0ddb92f2e0205043ddb347
2020-06-19Migrate to boost 1.73Manojkiran Eda2-7/+5
- Poky already had moved to 1.73, and bmcweb is lagging behind. - There are lot of improvements in 1.73(especially better support for c++20 standard) that can be leveraged by developer community, so migrating the dependency boost library to 1.73 Tested By: - Compiled in all sdks, and unit tests passed. Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com> Change-Id: Ia1c53bb3c96151d41c18b67a6d0c82edb756e7fd
2020-06-17ipmi: Enable/Disable IPMI-over-LANTom Joseph1-1/+79
This patch adds support for enabling and disabling IPMI-over-LAN using Redfish API. If there are multiple instances of phosphor-ipmi-net service, then the PATCH action applies to all the instances. This patch does not add support for configuring the port of IPMI-over-LAN. Tested: 1) Ran the Redfish Validator. 2) Disabled IPMI-over-LAN from Redfish and verified network IPMI stopped and verified ProtocolEnabled is false for IPMI. 3) Enabled IPMI-over-LAN from Redfish and verified network IPMI is running and verified ProtocolEnabled is true for IPMI. Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com> Change-Id: Ie9b00c8195bbfea14a69cbe9a73492187e6b4e1c
2020-06-17Fetch the ClientIP during session creationSunitha Harish2-16/+28
This commit saves the IP Address of the client from where the session was created. - This is not a user supplied value. The BMC will internally pull the IP address from the incoming create-session request. - It should also be noted that ClientIP will not change if the same session token is used from some other IP address for further management of the BMC. Tested by: 1. Create session 2. Display the Session details with GET command to check the IP from where the session is created/updated. GET https://${bmc}/redfish/v1/SessionService/Sessions/<id> { "@odata.id": "/redfish/v1/SessionService/Sessions/<id>", "@odata.type": "#Session.v1_0_2.Session", "Description": "Manager User Session", "Id": "<id>", "Name": "User Session", "Oem": { "OpenBMC": { "@odata.type": "#OemSession.v1_0_0.Session", "ClientOriginIP": "<ip address>" } }, "UserName": "root" } 3. Redfish validator is run successfully. Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: I0076f260f50a991600ec060c72f3e46fb9a9cbb8
2020-06-17Lock Management : Add Support for Mutltiple HMC'sManojkiran Eda1-6/+5
- The Lock Structure already had the HMC-ID field which stores the corresponding unique Identifier that tells us which HMC has acquired the Lock. - Now, that the Know you client functionality is up, we can leverage the clientId field in the bmcweb session store to fill the lock structure with the corresponding hmc identifier. NOTE : Also note that a Single HMC can have mutliple session that can acquire different locks, So when the ownership of any lock is tied up to its cliendId as well as the SessionId. - Release Lock call on any Transaction ID can only be successful if the transactionID of corresponding lock has the complete owner-ship as per the NOTE mentioned above. Tested By: 1. CREATE Session with Client ID as mentioned below: '{"UserName":"root", "Password":"0penBmc", "Oem":{"OpenBMC" : {"ClientID":<unique id>}}}' 2. Make sure the GetLockList of the above session populates the CliendID field as per data mentioned in the login Request. 3. Release Lock on transaction ID with same HMC-ID but with different sessionID's should be successful only when both the HMC-ID(mapped to X-Auth tokens in the session store) & Session ID(from the session store) of the ReleaseLock request matches with the ownwership of the lock pertaining to the transaction ID in the request. Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com> Change-Id: I60161bea6007782a397fc60f19d44c2211d4cf7f
2020-06-17Session creation : Get and Set Oem ClientIDSunitha Harish2-10/+45
This commit implements handling the OemSession ClientID parameter for the IBM management console. Each session gets a random generated unique Id (Resource Id); but this Id is not a parameter that the client can set to a well known identifier. This Oem parameter ClientID is the string which the client can supply to uniquely identify itself among other sessions in the BMC. This is a read-only property which shall be passed in only during the session creation. 1. Create session by supplying the ClientID Oem parameter 2. Display the ClientID associated with the session 3. Persist the ClientID across BMC reboot Tested by: ============ 1. POST https://${bmc}/redfish/v1/SessionService/Sessions -d '{"UserName":"root", "Password":<>, "Oem":{"OpenBMC" : {"ClientID":"<client unique id>"}}}' 2. GET https://${bmc}/redfish/v1/SessionService/Sessions/<id> { "@odata.id": "/redfish/v1/SessionService/Sessions/<id>", "@odata.type": "#Session.v1_0_2.Session", "Description": "Manager User Session", "Id": "<id>", "Name": "User Session", "Oem": { "OpenBMC": { "@odata.type": "#OemSession.v1_0_0.Session", "ClientID": "<client unique id>" } }, "UserName": "root" } 3. Verified the session creation works fine without the Oem parameters. 4. Redfish validator Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: Ia740a610e3974dc3781bcee702c74ded9903944a
2020-06-12ManagerAccount: Implement AccountTypesGunnar Mills1-7/+8
Seeing "ERROR - AccountTypes: Mandatory prop does not exist" validator fails. This should not be an error, because bmcweb is using ManagerAccount.v1_3_0 which doesn't have this property. The workaround (implement AccountTypes) improves the code, more information and easier later when moving to a later schema, so bump the ManagerAccount schema and Implement AccountTypes. Taking this issue forward with Redfish. Believe this was introduced in the following Validator commit: https://github.com/DMTF/Redfish-Service-Validator/commit/de71f0388bf85c920ae48deb6b16aed124f4f23b From https://redfish.dmtf.org/schemas/ManagerAccount.v1_6_0.json: "AccountTypes": { "description": "The account types.", "items": { "anyOf": [ { "$ref": "#/definitions/AccountTypes" }, ... "versionAdded": "v1_4_0" }, ... "required": [ "@odata.id", "@odata.type", "Id", "Name", "AccountTypes" ], ... "AccountTypes": { "enum": [ "Redfish", "SNMP", "OEM" ], "enumDescriptions": { "OEM": "OEM account type.", "Redfish": "Allow access to the Redfish Service.", "SNMP": "Allow access to SNMP services." }, "type": "string" Tested: Built and latest validator passes on a Witherspoon. curl -k https://${bmc}/redfish/v1/AccountService/Accounts/root { "@odata.id": "/redfish/v1/AccountService/Accounts/root", "@odata.type": "#ManagerAccount.v1_4_0.ManagerAccount", "AccountTypes": [ "Redfish" ], Change-Id: If48c4b8deb5f199f459858bb2c7469f0ebd44781 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-06-11Remove include experimental/filesystemGunnar Mills1-1/+0
This include is no longer needed. Tested: bmcweb built. Change-Id: Id754779cc8340678f03b8841abee807c90b959ff Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-06-11clang-format: update to latest from docs repoGunnar Mills69-1836/+1926
This is from openbmc/docs/style/cpp/.clang-format Other OpenBMC repos are doing the same. Tested: Built and validator passed. Change-Id: Ief26c755c9ce012823e16a506342b0547a53517a Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-06-11Revert "EventService: Add event log support with inotify"James Feist2-466/+1
This reverts commit e9a14131650d30389eaf9dc38a3c32f1cb552f52. Reason for revert: if /var/log/redfish does not exist this causes bmcweb to crash on start Fixes #126 Change-Id: If6ba4717a32d4cd72aa92a9bc9c696d5813b5cac Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-06-10Memory: add health supportJames Feist2-1/+23
This adds health support to dimms. It also updates the health object to look for an individual inventory items health. Tested: Validator passed { "@odata.id": "/redfish/v1/Systems/system/Memory/memory_device11", "@odata.type": "#Memory.v1_6_0.Memory", "CapacityMiB": 129728, "DataWidthBits": 64, "Id": "memory_device11", "Manufacturer": "Intel", "MemoryDeviceType": "xyz.openbmc_project.Inventory.Item.Dimm.DeviceType.Logical", "Name": "DIMM Slot", "PartNumber": "", "SerialNumber": "", "Status": { "Health": "Critical", "HealthRollup": "Critical", "State": "Enabled" } } Change-Id: If2e1450b4228036f00ff78e6484e8da409a8039b Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-06-10New OpenBMC OEM schema for SessionSunitha Harish4-0/+99
This commit defines the OemSession schema for storing - the clients unique identifier - the IP Address from where the session is created. Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: I759cda25dbb2dadd9b3d14cca9076e6412b41287
2020-06-09Add unit test for the lock managementmanojkiraneda3-34/+400
- The idea behind this commit is to enable the unit test for the lock management algorithm, and below are the unit test cases that are written: Testedby: [----------] 20 tests from locktest [ RUN ] locktest.ValidationGoodTestCase [ OK ] locktest.ValidationGoodTestCase (3 ms) [ RUN ] locktest.ValidationBadTestWithLocktype [ OK ] locktest.ValidationBadTestWithLocktype (1 ms) [ RUN ] locktest.ValidationBadTestWithlockFlags [ OK ] locktest.ValidationBadTestWithlockFlags (0 ms) [ RUN ] locktest.ValidationBadTestWithSegmentlength [ OK ] locktest.ValidationBadTestWithSegmentlength (1 ms) [ RUN ] locktest.MultiRequestWithoutConflict [ OK ] locktest.MultiRequestWithoutConflict (3 ms) [ RUN ] locktest.MultiRequestWithConflictduetoSameSegmentLength [ OK ] locktest.MultiRequestWithConflictduetoSameSegmentLength (2 ms) [ RUN ] locktest.MultiRequestWithoutConflictduetoDifferentSegmentData [ OK ] locktest.MultiRequestWithoutConflictduetoDifferentSegmentData (1 ms) [ RUN ] locktest.MultiRequestWithConflictduetoSameSegmentData [ OK ] locktest.MultiRequestWithConflictduetoSameSegmentData (2 ms) [ RUN ] locktest.MultiRequestWithoutConflictduetoDifferentSegmentLength [ OK ] locktest.MultiRequestWithoutConflictduetoDifferentSegmentLength (1 ms) [ RUN ] locktest.MultiRequestWithoutConflictduetoReadLocktype [ OK ] locktest.MultiRequestWithoutConflictduetoReadLocktype (1 ms) [ RUN ] locktest.MultiRequestWithoutConflictduetoReadLocktypeAndLockall [ OK ] locktest.MultiRequestWithoutConflictduetoReadLocktypeAndLockall (2 ms) [ RUN ] locktest.RequestConflictedWithLockTableEntries [ OK ] locktest.RequestConflictedWithLockTableEntries (6 ms) [ RUN ] locktest.RequestNotConflictedWithLockTableEntries [ OK ] locktest.RequestNotConflictedWithLockTableEntries (3 ms) [ RUN ] locktest.TestGenerateTransactionIDFunction [ OK ] locktest.TestGenerateTransactionIDFunction (1 ms) [ RUN ] locktest.ValidateTransactionIDsGoodTestCase [ OK ] locktest.ValidateTransactionIDsGoodTestCase (3 ms) [ RUN ] locktest.ValidateTransactionIDsBadTestCase [ OK ] locktest.ValidateTransactionIDsBadTestCase (2 ms) [ RUN ] locktest.ValidateisItMyLockGoodTestCase [ OK ] locktest.ValidateisItMyLockGoodTestCase (2 ms) [ RUN ] locktest.ValidateisItMyLockBadTestCase [ OK ] locktest.ValidateisItMyLockBadTestCase (2 ms) [ RUN ] locktest.ValidateSessionIDForGetlocklistBadTestCase [ OK ] locktest.ValidateSessionIDForGetlocklistBadTestCase (3 ms) [ RUN ] locktest.ValidateSessionIDForGetlocklistGoodTestCase [ OK ] locktest.ValidateSessionIDForGetlocklistGoodTestCase (3 ms) [----------] 20 tests from locktest (82 ms total) Signed-off-by: manojkiraneda <manojkiran.eda@gmail.com> Change-Id: Id274ee356adfa7ba03da02d83b609d37c8c99f8d
2020-06-08[pam]: Restrict local user auth to redfish grpRichard Marian Thomaiyar1-0/+3
Restrict bmcweb local user authentication to redfish group only. This change makes sure that user without having redfish group user is not authenticated to query the details, and login will fail. Tested: 1. Verified by removing the redfish group role for a valid user and confirmed redfish session establishment fails using postman. 2. This will not change the behavior for ldap user. Change-Id: I5e1b495028c8d143381bcc91cafd756a12ffb1d9 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
2020-06-08Add 'utilization' sensor to 'Sensors' pageAdrian Ambrożewicz1-1/+6
Recent change to xyz.openbmc_project.Sensor.Value interface has introduced new type of sensor - 'utilization'. This change makes bmcweb able to expose this kind of sensors in Sensors schema under /Chassis/{}/Sensors. Testing: - implemented simple mocked sensor and verified that: -- sensor appears in /Chassis/{}/Sensors -- sensor values are properly shown in /Chassis/{}/Sensors/{} -- 'ReadingUnits' is shown in /Chassis/{}/Sensors/{} - RedfishServiceValidator passed Change-Id: I9e4dc0b9db049a9815e79a0a64df60f275eeb822 Signed-off-by: Adrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com>
2020-06-05bmcweb: Replace deprecated boost::asio::io_serviceZhenfei Tai1-1/+2
bmcweb will not build when boost library is version 1.71.0. Also fix code format. In CMakeLists.txt 271 if ("${Boost_VERSION}" STREQUAL "107100") 272 add_definitions (-DBOOST_ASIO_NO_DEPRECATED) 273 endif () Signed-off-by: Zhenfei Tai <ztai@google.com> Change-Id: I4ebbf3cfcfd767ea016b4efd19704d25b845f86c
2020-06-04MAINTAINERS: Add Gunnar as a maintainerGunnar Mills1-0/+1
Gunnar's commits to bmcweb can be found at: https://github.com/openbmc/bmcweb/commits?author=gtmills Change-Id: I7747569fcf4d54e1e657e11148315bc50178188c Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-06-04fix for bmcweb CI build failureAppaRao Puli1-2/+4
CI builds are failing due to formatting issue. Below commit reverted the format to clang-6 from clang-10 and causing the failure. https://gerrit.openbmc-project.xyz/#/c/openbmc/bmcweb/+/32702/ Tested: Build success. Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> Change-Id: Ic75f7baeed9ff1013df37575dc180fb1c7d196fc
2020-06-04Redfish: Manager: ResetToDefaultGunnar Mills2-1/+83
ResetToDefaults, called factory reset in OpenBMC, was added in 2020.1. Calls BMC code updater factory reset since BMC code updater factory reset wipes the whole BMC read-write filesystem which includes things like the network settings. OpenBMC only supports ResetToDefaultsType "ResetAll". Depends on https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-bmc-code-mgmt/+/32989 Tested: Along with 32989, validator passes and was able to factory reset. curl -k https://$bmc/redfish/v1/Managers/bmc { "@odata.id": "/redfish/v1/Managers/bmc", "@odata.type": "#Manager.v1_8_0.Manager", "Actions": { "#Manager.Reset": { "ResetType@Redfish.AllowableValues": [ "GracefulRestart" ], "target": "/redfish/v1/Managers/bmc/Actions/Manager.Reset" }, "#Manager.ResetToDefaults": { "ResetType@Redfish.AllowableValues": [ "ResetAll" ], "target": "/redfish/v1/Managers/bmc/Actions/Manager.ResetToDefaults" } }, ... curl -k -X POST \ https://${bmc}/redfish/v1/Managers/bmc/Actions/Manager.ResetToDefaults \ -d '{"ResetToDefaultsType": "ResetAll"}' { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_0_0.Message", "Message": "Successfully Completed Request", "MessageArgs": [], "MessageId": "Base.1.4.0.Success", "Resolution": "None", "Severity": "OK" } ] } Change-Id: Ia830fd05dc15fd6311f84dff191a3718c645c040 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-06-03log_services: Fix Severity Empty string found issue when running Redfish ↵Tim Lee1-5/+7
Service Validator Symptom: When running Redfish Service Validator, we found that Severity Empty string issue except first post code in PostCodesEntry. *** /redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-1 Regetting resource from URI /redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-1 Type (#LogEntry.v1_4_0.LogEntry), GET SUCCESS (time: 0) PASS *** /redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-2 Regetting resource from URI /redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-2 Type (#LogEntry.v1_4_0.LogEntry), GET SUCCESS (time: 0) Severity: Empty string found - Services should omit properties if not supported Severity: Invalid Enum value '' found, expected ['OK', 'Warning', 'Critical'] FAIL... Root cause: In fillPostCodeEntry(), this statement "severity = message->severity" only be executed once. And another statement {"Severity", std::move(severity)} in the end of this function will clear severity string to null after calling std::move() standard function. Thus, only first post code Severity is 'OK', but the others are NULL. Solution: Move this statement "severity = message->severity" to for loop in fillPostCodeEntry() then all post codes will be recorded with correct severity string 'OK'. Tested: Passed the Redfish Service Validator and verified "Severity": "OK" in /redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-2 { "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", "@odata.id": "/redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-2", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "2020-04-27T01:48:10+00:00", "EntryType": "Event", "Id": "B1-2", "Message": "Boot Count: 1: TS Offset: 0.0046; POST Code: 0x02", "MessageArgs": [ "1", "0.0046", "0x02" ], "MessageId": "OpenBMC.0.1.BIOSPOSTCode", "Name": "POST Code Log Entry", "Severity": "OK" } Signed-off-by: Tim Lee <timlee660101@gmail.com> Change-Id: Ibfccfa47cfe8e0f58e7f24650871edda5d248674
2020-06-03Fix duplicate NTP servers patchTony Lee2-4/+7
Duplicate NTP servers value should not be patch. Tested: 1. Patch duplicate NTP servers curl -k -H "X-Auth-Token: $bmc_token" -XPATCH https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol -d '{"NTP":{"NTPServers":["9.9.9.9","9.9.9.9","1.1.1.1","9.9.9.9"]}}' 2. GET NTP servers information curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol", "@odata.type": "#ManagerNetworkProtocol.v1_5_0.ManagerNetworkProtocol", "Description": "Manager Network Service", "FQDN": "", "HTTP": { "Port": 0, "ProtocolEnabled": false }, "HTTPS": { "Certificates": { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates" }, "Port": 443, "ProtocolEnabled": true }, "HostName": "", "IPMI": { "Port": 623, "ProtocolEnabled": true }, "Id": "NetworkProtocol", "NTP": { "NTPServers": [ "1.1.1.1", "9.9.9.9" ], "ProtocolEnabled": false }, Signed-off-by: Tony Lee <tony.lee@quantatw.com> Change-Id: Idb63cf5e28d36a5df1aae9b0a7d53a1b7a9c8d91
2020-06-02Manager: Refactor Reset ActionGunnar Mills2-58/+54
Updated comment and var name to follow camelCase. Moved doBMCGracefulRestart to common function so could be used by factory reset in later commit. Moved to BMCWEB_LOG_DEBUG. Tested: Passed validator. BMC reboot worked. Change-Id: I019c174c3db625666ab6601d08cd4fa13e9e0274 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-06-01sdbusplus: use meson buildPatrick Williams2-4/+4
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I3591e03c4f357efe19d6809c7456a00cc412b201
2020-05-29EventService:persistent config & subscription infoAyushi Smriti1-11/+238
This commit is to persist EventService configuration and subscription information across the bmcweb service restart or bmc reboot by reading/writing config store data to the json file (location: /var/lib/bmcweb/eventservice_config.json) and loads this while initializing bmcweb EventService. URI's: /redfish/v1/EventService /redfish/v1/EventService/Subscriptions /redfish/v1/EventService/Subscriptions/<id> Tested: - Validated initialization and reading of config and subscription info from persist store. - Validated updation and writing of config and subscription info to the persist store: - Added new subscription using POST and validated using GET. - Validated delete subscription. - Validated subscription list is persistent after multiple bmc reboots - Verified by GET req on subscription collection and getting specific subscription id's. - Ran redfish validator successfully - Created some subscriptions - Rebooted BMC - Previous subscriptions were intact - Ran validator and verified. Change-Id: I9f044887b0c5b7559be58a6564b04585dc384be2 Signed-off-by: Ayushi Smriti <smriti.ayushi@linux.intel.com> Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-05-29Update json helper function - readJsonAppaRao Puli1-37/+131
The json helper functions are currently coupled with response(crow::response) and limiting it to use only while sending response. There are some use cases where we don't send crow::response instead we extract json data from files and load configuration. Decoupled the business logic for validating json key existence, json value type checking and range validation with top level use cases. So this json helper functions can be used for validating json and extracting value from json object during init cases also(Ex: Used in EventService config initialization) Added new API in helper function which checks key existence, value is of desired Type and value is in acceptable range and assign value in output parameter. Tested: Verified post and patch methods with different kinds of value types( int, bool, string, vector array, json etc..) and it works. Change-Id: I21a6f9a12aef09f6ca79a02bc01d96efeeb3a20a Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>