summaryrefslogtreecommitdiff
path: root/redfish-core/lib
AgeCommit message (Collapse)AuthorFilesLines
2021-03-16Redfish: Implement new event log propety ResolvedXiaochao Ma1-2/+70
In the new Redfish specification 2020.4,the eventlog propety "resolved" is added. This attribute indicates whether the log is marked as "resolved". Tested: Validator succeeded. The "Modified" attribute value will also change accordingly. This property can be changed as the "marked as resolved" is modified on the web page, or it can be modified directly using the redfish command. Before marked the log as resolved: ~$ curl -i -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Systems/system/LogServices/EventLog/Entries/1 { "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/1", "@odata.type": "#LogEntry.v1_8_0.LogEntry", "Created": "1970-01-01T00:01:09+00:00", "EntryType": "Event", "Id": "1", "Message": "xyz.openbmc_project.Common.Device.Error.ReadFailure", "Modified": "1970-01-01T00:01:09+00:00", "Name": "System Event Log Entry", "Resolved": false, "Severity": "Critical" }% after marked the log as resolved on webpage OR use the redfish commond: ~$ curl -k -H "X-Auth-Token: $token" -X PATCH -d '{"Resolved": true}' https://${bmc}/redfish/v1/Systems/system/LogServices/EventLog/Entries/1 ~$ curl -i -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Systems/system/LogServices/EventLog/Entries/1 { "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/1", "@odata.type": "#LogEntry.v1_8_0.LogEntry", "Created": "1970-01-01T00:00:57+00:00", "EntryType": "Event", "Id": "1", "Message": "xyz.openbmc_project.Common.Device.Error.ReadFailure", "Modified": "1970-01-01T00:03:05+00:00", "Name": "System Event Log Entry", "Resolved": true, "Severity": "Critical" } Signed-off-by: Xiaochao Ma <maxiaochao@inspur.com> Change-Id: Idd0cc0ca61ad56703303f90ba2bd1a372c321d94
2021-03-12led: Fix for Chassis IndicatorLED patch responseJayaprakash Mutyala1-0/+1
While Patching Chassis Indicator LED from Redfish, response is showing as empty but HTTPS status code is "200 OK" on successful case. So provided fix for Proper response on Success. Tested: 1. Verified RedFish validator passed 2. Verified the response on Redfish by updating IndicatorLED status. PATCH: https://<BMC-IP>/redfish/v1/Chassis/<Baseboard-ID> Body: { "IndicatorLED": "Blinking" } Response: { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "Successfully Completed Request", "MessageArgs": [], "MessageId": "Base.1.8.1.Success", "MessageSeverity": "OK", "Resolution": "None" } ] } Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> Change-Id: I2e1281e6c06c445fe8d0c350bb74ea18f3461a35
2021-03-11Redfish Session : Fix clientIp getting mapped to clientIdSunitha Harish1-2/+2
When the session is created using /login, the ClientOriginIPAddress is mapped to the clientId parameter which displayed the clientIP instead of the of clientId. The similar problem is observed with auth methods other than sessions created using the SessionService resource This commit swaps the clientId and clientIp parameters passed to generateUserSession API, so that the optional clientId is passed as the last parameter Tested by : 1. Create session using Redfish command POST https://${bmc}/login -d '{"username": <>,"password": <>}' POST https://${bmc}/redfish/v1/SessionService/Sessions -d '{"username": <>,"password": <>}' 2. Open the GUI session to check the clientId is not displaying the ClientOriginIPAddress Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: I6cee3de963c489e690d2ad0bb09ba78dca39e4f9
2021-03-11bmcweb build issue fixAppaRao Puli1-1/+1
The bmcweb compile is failing when Virtual Media is enabled(BMCWEB_ENABLE_VM_NBDPROXY). This patch correct the code which is introduced recently. Tested: - Builds successful with VM. Change-Id: Ib8f65dd648d342a5f5dee5c4ead43949e08ace32 Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2021-03-10Remove IBM copyrightGunnar Mills1-15/+0
These aren't needed and are not in all files. These aren't being updated. Would perfer these go away. Tested: Not Tested. Change-Id: I050874d58f86cae138ce2ab8c0c53831aeba5b21 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2021-03-08Chassis Location property on bmcwebSunnySrivastava19841-0/+35
This commit implements change to publish LocationCode property for Chassis on bmcweb. Location code of Motherboard FRU is published via chassis schema. LocationCode, a free form, implementation-defined string to provide the location. This is needed so an implementation can identify the FRU via system diagrams. Validator has been executed and no new error has been found. Sample output: { "@odata.id": "/redfish/v1/Chassis/chassis", "@odata.type": "#Chassis.v1_14_0.Chassis", "Actions": { "#Chassis.Reset": { "@Redfish.ActionInfo": "/redfish/v1/Chassis/chassis/ResetActionInfo", "target": "/redfish/v1/Chassis/chassis/Actions/Chassis.Reset" } }, "ChassisType": "RackMount", "Id": "chassis", "Links": { "ComputerSystems": [ { "@odata.id": "/redfish/v1/Systems/system" } ], "ManagedBy": [ { "@odata.id": "/redfish/v1/Managers/bmc" } ] }, "Location": { "PartLocation": { "ServiceLabel": "U78DA.ND1.1234567" } }, "Manufacturer": "", "Model": "", "Name": "chassis", "PCIeDevices": { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices" }, "PartNumber": "PN12345", "Power": { "@odata.id": "/redfish/v1/Chassis/chassis/Power" }, "PowerState": "Off", "Sensors": { "@odata.id": "/redfish/v1/Chassis/chassis/Sensors" }, "SerialNumber": "BBBE2D010000", "Status": { "Health": "OK", "HealthRollup": "OK", "State": "StandbyOffline" }, "Thermal": { "@odata.id": "/redfish/v1/Chassis/chassis/Thermal" } } Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com> Change-Id: Ib248b79156e8b04664e89e37bae49d4574e97086
2021-02-25log_services: Update PostCode D-Bus namesJonathan Doman1-8/+8
PostCode D-Bus service and object names are updated to include 0 suffix, based on updated POST code design for single host systems (see docs change Ibb0389c880243bf3a7c9de12bf409eee2eac9ad7). This change does not add any support for multi-host systems. Tested: With phosphor-host-postd: I89ab5f2eef7eab59823df3a063414f3ca3b2949f phosphor-post-code-manager: I59ed514f28c2bb9b159f51367c38557bf55bf226 1. Cleared POST code history by sending (HTTP)POST to /redfish/v1/Systems/system/LogServices/PostCodes/Actions/LogService.ClearLog/, and verify it returns 200 OK. 2. Verified the Entries collection was now empty at /redfish/v1/Systems/system/LogServices/PostCodes/Entries. 3. Power cycled host and repeat step 2 to verify that new entries are added. Signed-off-by: Jonathan Doman <jonathan.doman@intel.com> Change-Id: I2fdf97b7aaf8d6471d162f8ed1b72143491ac23f
2021-02-25hypervisor: add support to turn onAndrew Geissler1-0/+219
If the customer has requested the hypervisor stop at its Standby state vs. booting all the way to Running, then a mechanism is needed to request the hypervisor boot to Running. A common use case for IBM is the system user has requested the hypervisor stop at Standby so some manual debug can be performed and then they want to move the hypervisor into the Running state so they can boot their operating system. Asking the hypervisor to stop at Standby is done via the BootSourceOverrideEnabled and BootSourceOverrideTarget properties under the redfish/v1/Systems/system. Utilize the ComputerSystem.Reset action for this. Similar to how redfish/v1/Systems/system/Actions/ComputerSystem.Reset is utilized for the overall system, implement a limited subset of it for the hypervisor object. Tested: - Verified when phosphor-hypervisor-state-manager package is not installed that Redfish API returns same info it does currently - Verified when phosphor-hypervisor-state-manager was installed that the hypervisor state was returned correctly, the Actions field was filled in, and a post to the Action with ResetType set to "On" was correctly propagated to RequestedHostTransition - Verified that an invalid ResetType (i.e. "Off") returned the appropriate "invalid parameter" error message to the Redfish API - Verified no new errors logged by Redfish validator on system with this hypervisor package installed - Verify resource not found when hypervisor not enabled curl -k -H "X-Auth-Token: $TOKEN" -X POST https://${BMC_IP}/redfish/v1/Systems/hypervisor/Actions/ComputerSystem.Reset -d '{"ResetType": "On"}' { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type Actions named Reset was not found.", "MessageArgs": [ "Actions", "Reset" ], "MessageId": "Base.1.8.1.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.8.1.ResourceNotFound", "message": "The requested resource of type Actions named Reset was not found." } } - Verify ResourceNotFound returned when hypervisor not enabled curl -k -H "X-Auth-Token: $TOKEN" -X GET https://${BMC_IP}/redfish/v1/Systems/hypervisor/ResetActionInfo { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type hypervisor named ResetActionInfo was not found.", "MessageArgs": [ "hypervisor", "ResetActionInfo" ], "MessageId": "Base.1.8.1.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.8.1.ResourceNotFound", "message": "The requested resource of type hypervisor named ResetActionInfo was not found." } } - Verify input parameters validated curl -k -H "X-Auth-Token: $TOKEN" -X POST https://${BMC_IP}/redfish/v1/Systems/hypervisor/Actions/ComputerSystem.Reset -d '{"ResetTypeInvalid": "On"}' { "ResetTypeInvalid@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The property ResetTypeInvalid is not in the list of valid properties for the resource.", "MessageArgs": [ "ResetTypeInvalid" ], "MessageId": "Base.1.8.1.PropertyUnknown", "MessageSeverity": "Warning", "Resolution": "Remove the unknown property from the request body and resubmit the request if the operation failed." } ] } curl -k -H "X-Auth-Token: $TOKEN" -X POST https://${BMC_IP}/redfish/v1/Systems/hypervisor/Actions/ComputerSystem.Reset -d '{"ResetType": "OnInvalid"}' { "ResetType@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The value OnInvalid for the property ResetType is not in the list of acceptable values.", "MessageArgs": [ "OnInvalid", "ResetType" ], "MessageId": "Base.1.8.1.PropertyValueNotInList", "MessageSeverity": "Warning", "Resolution": "Choose a value from the enumeration list that the implementation can support and resubmit the request if the operation failed." } ] } Change-Id: Ia7b4e78b7b0d907cc06eb3f20d51ff87b7dde564 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
2021-02-25hypervisor: add state supportAndrew Geissler1-0/+80
phosphor-state-manager support a new optional package, phosphor-state-manager-hypervisor. IBM plans to include this package on their system to monitor and control the hypervisor firmware running on the system. Since this package is optional, this patch set is written to just ignore any errors associated with the package and not report hypervior state in these cases. Tested: - Verified when phosphor-hypervisor-state-manager package is not installed that Redfish API returns same info it does currently - Verified when phosphor-hypervisor-state-manager was installed that the hypervisor state was returned correctly. - The redfish validator was run on the final patch in this series Change-Id: I3843914894ded9494f92b96714c1f88a5deb5ec3 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
2021-02-24Fix the build on clang-11Ed Tanous1-1/+1
Clang tidy 11 got some really neat checks that do a much better job. Unfortunately, this, combined with the change in how std::executors has defined how callbacks should work differently in the past, which we picked up in 1.73, and now in theory we have recursion in a bunch of our IO loops that we have to break manually. In practice, this is unlikely to matter, as there's almost a 0% chance that we go through N thousand requests without ever starving the IO buffer. Other changes to make this build include: 1. Adding inline on the appropriate places where declared in a header. 2. Removing an Openssl call that did nothing, as the result was immediately overwritten. 3. Declaring the subproject dependencies as system dependencies, which silences the clang-tidy checks for those projects. Tested: Code builds again, clang-tidy passes Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ic11b1002408e8ac19a17a955e9477cac6e0d7504
2021-02-23clang-format-11: reformatPatrick Williams2-6/+7
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I0f662e2e6d594567cc10eee34e1df2ca89614870
2021-02-22Add additional Redfish Memory propertiesSunnySrivastava19841-1/+36
This commit adds the following properties to the memory schema on bmcweb. a) LocationCode, a free form, implementation-defined string to provide the location of the DIMM. This is needed so an implementation can identify the DIMM via system diagrams and such. b) Model, maps to a CCIN/Card ID for IBM's implementation, is a string for the manufacturer's part model. For IBM's implementation, it is a four-digit value assigned for each possible FRU. c) SparePartNumber, also field-replaceable unit (FRU) Part Number, is a part number that identifies the FRU for replacement specifically ordering of a new part. Redfish validator has been executed on this change and no new error was found. Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com> Change-Id: I419a9cd8e956de3fbf7093903129389ad5e0e577
2021-02-19Fix nlohmann::json::dump callsEd Tanous6-23/+75
The nlohmann::json::dump call needs to be called with specific arguments to avoid throwing in failure cases. http connection already does this properly, but a bunch of code has snuck in (mostly in redfish) that ignores this, and calls it incorrectly. This can potentially lead to a crash if the wrong thing throws on invalid UTF8 characters. This audits the whole codebase, and replaces every dump() call with the correct dump(2, ' ', true, nlohmann::json::error_handler_t::replace) call. For correct output, the callers should expect no change, and in practice, this would require injecting non-utf8 characters into the BMC. Tested: Ran several of the endpoints/error conditions in question, including some of the error cases. Observed correct responses. I don't know of a security issue that would allow injecting invalid utf8 into the BMC, but in theory if it were possible, this would prevent a crash. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I4a15b8e260e3db129bc20484ade4ed5449f75ad0
2021-02-19Start using sdbusplus::message::filename()Ed Tanous6-53/+42
Lots of code gets checked in that does this path checking incorrectly. So much so, that we have it documented in COMMON_ERRORS.md, yet, we persist. This patchset starts using the new object_path::filename() method that was added recently to sdbusplus. Overall, it deletes code, and makes for a much better developer experience. Tested: Pulled down several endpoints and verified that filename() method works properly, and the collections are returned as expected. curl -vvvv --insecure --user root:0penBmc https://192.168.7.2/redfish/v1/AccountService/Accounts Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ief1e0584394fb139678d3453265f7011bc931f3c
2021-02-17Replace rfind method in sensors.hppGeorge Liu1-34/+34
Remove the rfind method and use the filename method of sdbusplus::message::Object_path. Tested: Built successfully and validator passes. Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I762360474b18092987feb64b13f78371db144baa
2021-02-17Add additional Redfish Processor propertiesSunnySrivastava19841-2/+73
This commit adds the following inventory properties for the Processor resource in bmcweb: a) LocationCode, a free form, implementation-defined string to provide the location of the processor. This is needed so an implementation can identify the processor via system diagrams. b) SparePartNumber, also field-replaceable unit (FRU) Part Number, is a part number that identifies the FRU for replacement specifically ordering of a new part. c) PartNumber, also called a Marketing Number, describes a specific part within a specific system among a manufactures various product lines. These numbers tell IT infrastructure technicians exactly which parts are included in their servers, storage and networking equipment. These properties are essential to locate and replace the FRU. Validator has been executed and no new error has been found. Sample Output: { "@odata.id": "/redfish/v1/Systems/system/Processors/cpu0", "@odata.type": "#Processor.v1_11_0.Processor", "Id": "cpu0", "Location": { "PartLocation": { "ServiceLabel": "Ufcs-P0-C15" } }, "Manufacturer": "", "Model": "AB41", "Name": "Processor", "PartNumber": "2345678", "ProcessorType": "CPU", "SerialNumber": "YLAB41010000", "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Absent" } } Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com> Change-Id: Ifc0e13fd7eb94e86eade223608a1ecad2487ed37
2021-02-17Add additional Redfish Manager propertiesSunnySrivastava19841-34/+96
This commit adds the following inventory properties for the BMC resource: a) LocationCode, a free form, implementation-defined string to provide the location of the BMC. This is needed so an implementation can identify the BMC via system diagrams and such. b) Model, maps to a CCIN/Card ID for IBM's implementation, is a string for the manufacturer's part model. For IBM's implementation, it is a four-digit value assigned for each possible FRU. c) SparePartNumber, also field-replaceable unit (FRU) Part Number, is a part number that identifies the FRU for replacement specifically ordering of a new part. For some manufacturers the BMC is soldered down, this is not the case for all manufacturers. For our systems, the BMC can be replaced and these properties are essential to locate and replace the BMC. Redfish validator has been executed on this change and no new error was found. Sample Output: { "@odata.id": "/redfish/v1/Managers/bmc", "@odata.type": "#Manager.v1_11_0.Manager", "Actions": { "#Manager.Reset": { "@Redfish.ActionInfo": "/redfish/v1/Managers/bmc/ResetActionInfo", "target": "/redfish/v1/Managers/bmc/Actions/Manager.Reset" }, "#Manager.ResetToDefaults": { "ResetType@Redfish.AllowableValues": [ "ResetAll" ], "target": "/redfish/v1/Managers/bmc/Actions/Manager.ResetToDefaults" } }, "DateTime": "2020-12-18T07:37:34+00:00", "Description": "Baseboard Management Controller", "EthernetInterfaces": { "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces" }, "FirmwareVersion": "fw1020.00-12.1-10-g60fee5936", "GraphicalConsole": { "ConnectTypesSupported": [ "KVMIP" ], "MaxConcurrentSessions": 4, "ServiceEnabled": true }, "Id": "bmc", "LastResetTime": "2020-12-09T17:21:20+00:00", "Links": { "ActiveSoftwareImage": { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/e7522a84" }, "ManagerForChassis": [ { "@odata.id": "/redfish/v1/Chassis/Nisqually_Backplane" } ], "ManagerForChassis@odata.count": 1, "ManagerForServers": [ { "@odata.id": "/redfish/v1/Systems/system" } ], "ManagerForServers@odata.count": 1, "ManagerInChassis": { "@odata.id": "/redfish/v1/Chassis/Nisqually_Backplane" }, "SoftwareImages": [ { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/e7522a84" } ], "SoftwareImages@odata.count": 1 }, "Location": { "PartLocation": { "ServiceLabel": "U78DA.ND1.1234567-P0-C5" } }, "LogServices": { "@odata.id": "/redfish/v1/Managers/bmc/LogServices" }, "ManagerType": "BMC", "Manufacturer": "", "Model": "", "Name": "OpenBmc Manager", "NetworkProtocol": { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol" }, "Oem": { "@odata.id": "/redfish/v1/Managers/bmc#/Oem", "@odata.type": "#OemManager.Oem", "OpenBmc": { "@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc", "@odata.type": "#OemManager.OpenBmc", "Certificates": { "@odata.id": "/redfish/v1/Managers/bmc/Truststore/Certificates" } } }, "PartNumber": "PN12345", "PowerState": "On", "SerialConsole": { "ConnectTypesSupported": [ "IPMI", "SSH" ], "MaxConcurrentSessions": 15, "ServiceEnabled": true }, "SerialNumber": "YL6B58010000", "ServiceEntryPointUUID": "280c3750-fa95-42cd-96aa-7834853bd922", "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Enabled" }, "UUID": "35d98d20-cf67-4575-8aaa-0c40c398efdf" } Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com> Change-Id: I53044fb0173be8fce7a13aadc2cf5c2903529486
2021-02-13hypervisor: rename source file to be more generalAndrew Geissler1-0/+0
Some new features are needed within the hypervisor system schema. Rename source file to reflect this. Change-Id: I7fa09089a4f52610b47bbb4496064556ab93f985 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
2021-02-11log_services: Improve error handling for DBus Log EntryAdriana Kobylak1-45/+19
Improve the error handling of the DBus Log Entry class: 1. Return internal error only if message, id, or severity are not initialized. 2. Handle Not Found error (404). 3. Escape the Entry ID used for the DBus call. Tested: A call to entries/foo returns not found: $ curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Systems/system/LogServices/EventLog/Entries/foo { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type EventLogEntry named foo was not found.", "MessageArgs": [ "EventLogEntry", "foo" ], "MessageId": "Base.1.8.1.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.8.1.ResourceNotFound", "message": "The requested resource of type EventLogEntry named foo was not found." } Change-Id: Icac06b34c9d4bc570973da369eef42fd785b4bf7 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
2021-02-09Remove LogService from TelemetryServiceWludzik, Jozef1-2/+0
Removed LogService from TelemetryService because redfish bmc journal is not an option enabled by default in OpenBMC. Telemetry backend does not use exhaustively a journal right now so it is ok to drop LogService attribute for now. In future LogService will be required to support Trigger schema to let user know where Redfish messages are stored. Thanks to this commit RedfishServiceValidator is able to pass on standard OpenBMC image. Change-Id: I03ed1c9279f89c213af0ed4fc633d16c285f6f95 Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
2021-02-09Redfish TelemetryService schema implementationWludzik, Jozef4-0/+442
Now user is able to communicate with Telemetry service using Redfish. Added TelemetryService, MetricReports, MetricReportCollection, MetricReportDefinition and MetricReportDefinitionCollection nodes with GET method support. Added TelemetryService URI to root service. Implemented communication with backend - Telemetry: https://github.com/openbmc/telemetry Added schemes attributes that are supported by Telemetry service design, ref.: https://github.com/openbmc/docs/blob/master/designs/telemetry.md Change introduces function that converts decimal value into duration format that is described by ISO 8601 and Redfish specification. Tested: - Tested using romulus and s2600wf images on QEMU - Verified DBus method calls to Telemetry service from bmcweb - Verified bmcweb responses from new nodes in different cases: - Report collection is empty - Report collection is filled with artificial data - Telemetry service is disabled - Verified time_utils::toDurationString() output - Passed RedfishServiceValidator.py Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com> Signed-off-by: Adrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com> Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com> Change-Id: Ie6b0b49f4ef5eeaef07d1209b6c349270c04d570
2021-02-04Remove unnecessary error responses for LDAP certsJonathan Doman1-8/+11
Currently, /v1/CertificateService/CertificateLocations and /v1/AccountService/LDAP/Certificates endpoints assume the presence of xyz.openbmc_project.Certs.Manager.Client.Ldap service, and return an error on D-Bus failures. But this service can be missing if LDAP support is removed from the build, so we should just return empty responses instead of errors. Tested: Passed Redfish service validator. Signed-off-by: Jonathan Doman <jonathan.doman@intel.com> Change-Id: Ib8416e850b52e8ce0f8947017d863cee19f7b2c8
2021-01-25Tasks for TFTP uploadAlbert Zhang1-1/+1
This is to change the existing TFTP update into an asynchronous service that uses Redfish Tasks. Tested: TFTP Firmware update through redfish,and get the task to create. curl -k -H "X-Auth-Token: $token" -X POST https://${bmc}/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate -d '{"TransferProtocol":"TFTP","ImageURI":"xx.xx.xx.xx/obmc-phosphor-xxxxx"}' { "@odata.id": "/redfish/v1/TaskService/Tasks/0", "@odata.type": "#Task.v1_4_3.Task", "Id": "0", "TaskState": "Running", "TaskStatus": "OK" } Signed-off-by: Albert Zhang <zhanghaodi@inspur.com> Change-Id: I5d8683f38bf3e29177d90606c5c9fe747a26a876
2021-01-08transition support for system stateAndrew Geissler1-0/+12
The following commit defined two new values for the host state: https://github.com/openbmc/phosphor-dbus-interfaces/commit/9f65dfeaa5ab22cae03db45c9916868da9864f83 These new state values, TransitioningToOff and TransitioningToRunning, map quite well to the Redfish system PowerState values of PoweringOff and PoweringOn. There have been requests from external users of our Redfish interfaces to know this level of detail, especially in the PoweringOff path due to the length of time it can take (up to 2 hours is allowed for the host to shut itself down gracefully). Tested: - Put host state D-Bus property in each of new states and verified Redfish API returned expected results. Change-Id: I0c43dc2fa8b057beea48bc6f3dcde80d094ccfdb Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
2021-01-07Move network protocol to a constexpr structEd Tanous1-4/+2
Another clang-tidy warning about global construction of things that could throw. Considering we don't actually use this as a map anywhere, move to a constexpr array of values. Tested: Clang-tidy now passes cert-* check. curl --insecure --user root:0penBmc https://192.168.7.2/redfish/v1/Managers/bmc/NetworkProtocol { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol", "@odata.type": "#ManagerNetworkProtocol.v1_5_0.ManagerNetworkProtocol", "Description": "Manager Network Service", "FQDN": "qemux86", "HTTP": { "Port": 0, "ProtocolEnabled": false }, "HTTPS": { "Certificates": { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates" }, "Port": 443, "ProtocolEnabled": true }, "HostName": "qemux86", "IPMI": { "Port": null, "ProtocolEnabled": false }, "Id": "NetworkProtocol", "NTP": { "NTPServers": [], "ProtocolEnabled": true }, "Name": "Manager Network Protocol", "SSH": { "Port": 22, "ProtocolEnabled": true }, "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Enabled" } }% Change-Id: I2bdae321fc1cbb418ed302453ec6109ee2ed32c1 Signed-off-by: Ed Tanous <ed@tanous.net>
2021-01-06Fix Power Restore Policy to match D-BusGunnar Mills1-2/+2
The D-Bus Power Restore Policies are AlwaysOn, AlwaysOff, and Restore. https://github.com/openbmc/phosphor-dbus-interfaces/blob/32304979b404c24e32f195d08c667e65b9b34695/xyz/openbmc_project/Control/Power/RestorePolicy.interface.yaml#L23 The Redfish states are AlwaysOn, AlwaysOff, and LastState. Tested: Validator passes. curl -v -k -X PATCH -d '{"PowerRestorePolicy":"LastState"}' \ https://${bmc}/redfish/v1/Systems/system ... < HTTP/1.1 204 No Content curl -k https://${bmc}/redfish/v1/Systems/system { "@odata.id": "/redfish/v1/Systems/system", "@odata.type": "#ComputerSystem.v1_13_0.ComputerSystem", ... "Name": "system", "PowerRestorePolicy": "LastState", "PowerState": "Off", "ProcessorSummary": { "Count": 0, Change-Id: I4d91bd4480f626467e3bb9804fa0392bbafcc891 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2021-01-04Implement PercentComplete for code updateGeorge Liu2-0/+4
In order to implement full task support for code update, the PercentComplete property is added to the task service. Testd: Validator passes. curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/TaskService/Tasks/0 { "@odata.id": "/redfish/v1/TaskService/Tasks/0", "@odata.type": "#Task.v1_4_3.Task", ... ... "PercentComplete": 100, "TaskMonitor": "/redfish/v1/TaskService/Tasks/0/Monitor", "TaskState": "Completed", "TaskStatus": "OK" } Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I030bf0bbff098dec2f45158642f149711554285d
2020-12-30Look for Version Already Exists ErrorGunnar Mills1-2/+12
Look for Software.Version.Error.AlreadyExists and return Invalid Upload and Resource Already Exists. Heard from users it is hard to know why the image failed to upload in this case. Tested: Built with PDI and phosphor-bmc-code-mgmt changes and saw the error. curl -k -H "Content-Type: application/octet-stream" -X POST -T $image https://${bmc}/redfish/v1/UpdateService { "Version@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type UpdateService.v1_4_0.UpdateService with the property Version with the value uploaded version already exists.", "MessageArgs": [ "UpdateService.v1_4_0.UpdateService", "Version", "uploaded version" ], "MessageId": "Base.1.8.1.ResourceAlreadyExists", "MessageSeverity": "Critical", "Resolution": "Do not repeat the create operation as the resource has already been created." } ], "error": { "@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_1_1.Message", "Message": "Invalid file uploaded to /redfish/v1/UpdateService: Image version already exists.", "MessageArgs": [ "/redfish/v1/UpdateService", "Image version already exists" ], "MessageId": "OpenBMC.0.1.0.InvalidUpload", "MessageSeverity": "Warning", "Resolution": "None." } ], "code": "OpenBMC.0.1.0.InvalidUpload", "message": "Invalid file uploaded to /redfish/v1/UpdateService: Image version already exists." } } Change-Id: Ieab0116650dd64949da6b7ac93254193803f8f90 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-12-18Fix .clang-tidyEd Tanous7-167/+165
camelLower is not a type, camelBack is. Changes were made automatically with clang-tidy --fix-errors To be able to apply changes automatically, the only way I've found that works was to build the version of clang/clang-tidy that yocto has, and run the fix script within bitbake -c devshell bmcweb. Unfortunately, yocto has clang-tidy 11, which can apparently find a couple extra errors in tests we already had enabled. As such, a couple of those are also included. Tested: Ran clang-tidy-11 and got a clean result. Signed-off-by: Ed Tanous <ed@tanous.net> Change-Id: I9d1080b67f0342229c2f267160849445c065ca51
2020-12-15Add meson options for all authentication methods.Alan Kuo1-0/+31
Add meson options to enabled/disabled authentication methods: - basic-auth : For enable basic authentication, default is enabled - session-auth : For enable session token authentication, default is enabled - xtoken-auth : For enable x-token authentication, default is enabled - cookie-auth : For enabled cookie authentication, default is enabled Signed-off-by: Alan Kuo <Alan_Kuo@quantatw.com> Change-Id: I52e636f2534a14897cb57d35e563ea8841cc68b9
2020-12-15IndicatorLED: Add a deprecated warning headerGunnar Mills2-0/+9
Added a warning header when IndicatorLED is patched telling the client it is deprecated and pointing to LocationIndicatorActive. Used the warning syntax from https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Warning Tested: curl -X PATCH -v -d '{ "IndicatorLED":"Off"}' \ -k https://$bmc/redfish/v1/Systems/system ... < HTTP/1.1 204 No Content < Warning: 299 - "IndicatorLED is deprecated. Use LocationIndicatorActive instead." < Strict-Transport-Security: max-age=31536000; includeSubdomains; preload < X-Frame-Options: DENY Change-Id: Ic25a02508b0a1bcada1fa71ffa413c493fad00c4 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-12-04VirtualMedia doesn't propagate information to WebUIAnna Platash1-32/+77
Information if the image is mounted in read-only mode or not wasn't propagated from VirtualMedia to Web UI. Also TransportProtocolType value wasn't updated. Added the WriteProtected field value update using the WriteProtected property from MountPoint interface. Added TransportProtocolType field value update using image URL. Tested manually on ArcherCity by mounting images via RedFish interface with and without write protection, using HTTP and Samba. Schema validated by Redfish validator. Signed-off-by: Anna Platash <anna.platash@intel.com> Change-Id: I41d4a377d9fe3a978e8a3b654338c7a3d961b1c1
2020-12-04Add support for Redfish OperatingConfig resourcesJonathan Doman1-2/+448
- Update Processor GET handler to look for a matching CurrentOperatingConfig interface on D-Bus. - Add OperatingConfig node and implement GET handler to look for matching OperatingConfig interface on D-Bus. - Add OperatingConfigCollection node and implement GET handler to look for all OperatingConfig interfaces on D-Bus under the given cpu. Tested: - Ran Redfish Service Validator and verified no errors or warnings on Processor, OperatingConfig, and OperatingConfigCollection. - Browsed OperatingConfig links and resources in browser, confirmed nonexistent configs returned 404 and didn't crash bmcweb. - Killed D-Bus provider service and verified bmcweb didn't crash and still served Processor as before, and passed service validator. Change-Id: Iab94b7fd49a9462cb0eca6f8ea0754f5fb241053 Signed-off-by: Jonathan Doman <jonathan.doman@intel.com>
2020-12-04Refactor getProcessorDataJonathan Doman1-45/+50
- Move list of interfaces to search for next to the result callback, so that it's easier to catch mismatches. And add 1 missing interface to GetSubTree request. - Use vector instead of map for GetSubTree response - Use structured bindings to make the loop variables easier to understand. - Reorganize logic to save an indent. Tested: As part of child change Iab94b7fd49a9462cb0eca6f8ea0754f5fb241053 Signed-off-by: Jonathan Doman <jonathan.doman@intel.com> Change-Id: Iccf76ca0ddf944b053ebcf904f872e7960f2b508
2020-12-02Redfish: Manager: Implement Manufacturer,PartNumber and SerialNumberChicago Duan1-0/+80
Implement Manufacturer,PartNumber and SerialNumber in /redfish/v1/Managers/bmc The Redfish manager defines these new properties: https://redfish.dmtf.org/schemas/v1/Manager.v1_10_0.json Tested: Validator passes curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Managers/bmc { "@odata.id": "/redfish/v1/Managers/bmc", "@odata.type": "#Manager.v1_9_0.Manager", "Actions": { "#Manager.Reset": { "@Redfish.ActionInfo": "/redfish/v1/Managers/bmc/ResetActionInfo", "target": "/redfish/v1/Managers/bmc/Actions/Manager.Reset" }, "#Manager.ResetToDefaults": { "ResetType@Redfish.AllowableValues": [ "ResetAll" ], "target": "/redfish/v1/Managers/bmc/Actions/Manager.ResetToDefaults" } }, ... ... "Manufacturer": "testManufacturer", ... ... "PartNumber": "testPartNumber", ... ... "SerialNumber": "testSerialNumber", ... ... "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Enabled" }, "UUID": "d80b997e-d7eb-4773-b375-ed18e87a4ed4" } Signed-off-by: Chicago Duan <duanzhijia01@inspur.com> Change-Id: Id3765cfb8d80b5958fb0f82ecd7f5d89f90f893a
2020-11-30boot-progress: support LastState propertyAndrew Geissler1-0/+102
This commit provides initial support for the LastState property within the Redfish BootProgress object. The design details of OpenBMC's implementation of this can be found here: https://github.com/openbmc/docs/blob/master/designs/boot-progress.md Tested: - Set each possible value for the D-Bus BootProgress property and verified the Redfish API returned the expected value. This includes setting it to MotherboardInit and verifying "None" was returned because this does not have a mapping to the new Redfish enumeration. - Verified Redfish Validator passed Signed-off-by: Andrew Geissler <geissonator@yahoo.com> Change-Id: I8bc6e7012f4afc3152a0af2c5ebf8a55b1112773
2020-11-26Memory: Remove if (*memorySize == 0)Gunnar Mills1-9/+0
Sent to mailing list here: https://lists.ozlabs.org/pipermail/openbmc/2020-October/023744.html Remove the if MemorySizeInKB is 0 set the "Status""State" to Absent and return. More work needed here to make Present and Functional work correctly. Tested: Validator passes. curl -k https://$bmc/redfish/v1/Systems/system/Memory/dimm6 { "@odata.id": "/redfish/v1/Systems/system/Memory/dimm6", "@odata.type": "#Memory.v1_7_0.Memory", "AllowedSpeedsMHz": [], "BaseModuleType": "RDIMM", "BusWidthBits": 0, "CapacityMiB": 0, "DataWidthBits": 0, "ErrorCorrection": "NoECC", "FirmwareRevision": "0", "Id": "dimm6", "Manufacturer": "Micron Technology", "Name": "DIMM Slot", "OperatingSpeedMhz": 0, "PartNumber": "", "RankCount": 0, "SerialNumber": "0x156d5d4f", "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Enabled" } Change-Id: I40ab44b1cb5db266d0766501a6f625168baaa2a6 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-11-21Add SYSLOG_IDENTIFIER to the BMC journal MessageJason M. Bills1-1/+15
journalctl prints the SYSLOG_IDENTIFIER from each journal entry to help identify the application that printed the message. If it exists in the journal entry, this adds the SYSLOG_IDENTIFIER to the beginning of the Redfish Message field. Tested: Confirmed that the Journal resource entries still display correctly and include the SYSLOG_IDENTIFIER. Change-Id: I0dfb020e5de13a280d5f1a64c2cf36f1d65a60fa Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2020-11-20systems: fix Members@odata.count is incorrect even Members have contentsTim Lee1-1/+1
Issue symptom: Run automation test "Verify_Systems_Defaults" then we got ERROR as below. Verify Systems Defaults :: Verify systems defaults. | FAIL | **ERROR** Invalid variable value: systems['Members@odata.count']: 0 <int> Root cause: In Systems, doGet() didn't calculate count after ifaceArray.push_back({{"@odata.id", "/redfish/v1/Systems/system"}}) Solution: Increase count by ifaceArray.size() after ifaceArray.push_back() in Systems Tested: 1. Verified robot -t Verify_Systems_Defaults redfish/service_root/test_sessions_management.robot Verify Systems Defaults :: Verify systems defaults. | PASS | 2. Verified system detail from Redfish. Get https://<BMC-IP>/redfish/v1/Systems Response: { "@odata.id": "/redfish/v1/Systems", "@odata.type": "#ComputerSystemCollection.ComputerSystemCollection", "Members": [ { "@odata.id": "/redfish/v1/Systems/system" } ], "Members@odata.count": 1, "Name": "Computer System Collection" } Signed-off-by: Tim Lee <timlee660101@gmail.com> Change-Id: I9cdb5dac9e16851112085048bc674808511a4845
2020-11-12update_service: fix segmentation violation when updating imagesTim Lee1-3/+0
Symptom: Before repo this issue symptom, we need to enable bmcweb debug option. Due to this issue is relevant to timing about callback function lifecycle. Thus, enable debugging will increae issue repo rate almost 100%. Bmcweb.service was terminated abnormal after updating images via Redfish curl command. According debug log, bmcweb.service exited with status=11/SEGV (Segmentation Violation). That's usually a bug in a program such as pointer, null pointer, arrays and so on. The default action for a program upon receiving SIGSEGV is abnormal termination. Coredump analysis: From the backtrace result that is point to softwareInterfaceAdded() of caller: at/home/tim/git/runbmc/openbmc/olympus-build/tmp/work/armv7a-openbmc-linux-gnueabi/bmcweb/ 1.0+gitAUTOINC+72d566d9eb-r0/recipe-sysroot/usr/include/c++/10.1.0/bits/shared_ptr.h:149 at/home/tim/git/runbmc/openbmc/olympus-build/tmp/work/armv7a-openbmc-linux-gnueabi/bmcweb/ 1.0+gitAUTOINC+72d566d9eb-r0/git/redfish-core/include/../lib/update_service.hpp:315 SEGV happen after executing line 84 in softwareInterfaceAdded() line: 83 // Found our interface, disable callbacks line: 84 fwUpdateMatcher = nullptr; line: 86 // Retrieve service and activate line: 87 crow::connections::systemBus->async_method_call( Root cause: From coredump and backtrace result that segmentation violation issue in softwareInterfaceAdded(). softwareInterfaceAdded() is a callback function will be called by monitorForSoftwareAvailable(). When there is a signal relate to member is InterfacesAdded in object path /xyz/operbmc_project/software. However, this callback function pointer will set to NULL poniter in itself callback function. Thus, there is possible to hit SEGV issue when accessing to NULL function pointer. Solution: Set fwUpdateMatcher as nullptr should remove it from softwareInterfaceAdded(). And that will be set as nullptr by call cleanUp() in monitorForSoftwareAvailable() after got response. Thus, it save to remove this line and avoid this SEGV then cause bmcweb.service terminated abnormal. Tested: Update BMC image using UpdateService POST action: curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/octet-stream" -X POST -T tim/obmc-phosphor-image-olympus-nuvoton-20200921031720.static.mtd.tar https://${bmc}/redfish/v1/UpdateService Update BMC image using UpdateService.SimpleUpdate POST action: curl -k -H "X-Auth-Token: $token" -X POST https://${bmc}/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate -d '{"ImageURI":"tftp://10.103.61.175/obmc-phosphor-image-olympus-nuvoton-20200921031720.static.mtd.tar"}' Signed-off-by: Tim Lee <timlee660101@gmail.com> Change-Id: I01dcf56893b5ca64fe1d45f29f3f858761ccf2a8
2020-11-10Add new Location Indicator propertyGunnar Mills3-25/+166
In ComputerSystem 1.13 and Chassis 1.14 as well as in many other schemas IndicatorLED is replaced with LocationIndicatorActive. LocationIndicatorActive is a bool while IndicatorLED had 3 states: Lit, Blink, and off. Map Lit and Blink both to LocationIndicatorActive true. led.hpp was calling both enclosure_identify_blink and enclosure_identify, continue this. Keep the deprecated IndicatorLED and implement the new LocationIndicatorActive property. Have both properties for the time being. This new property makes the same calls. This does add a new Redfish warning for the deprecated IndicatorLED. Other warning are there today. Tested: Validator passes Could use help testing on Chassis. Our systems don't have a IndicatorLED on chassis. See chassis bumped. curl -k https://$bmc/redfish/v1/Systems/system { "@odata.id": "/redfish/v1/Systems/system", "@odata.type": "#ComputerSystem.v1_13_0.ComputerSystem", ... "IndicatorLED": "Off", "LastResetTime": "2020-10-29T09:01:03+00:00", "Links": { "Chassis": [ { "@odata.id": "/redfish/v1/Chassis/chassis" } ], "ManagedBy": [ { "@odata.id": "/redfish/v1/Managers/bmc" } ] }, "LocationIndicatorActive": false, curl -X PATCH -d '{ "LocationIndicatorActive":true}' -k \ https://$bmc/redfish/v1/Systems/system curl -X PATCH -d '{ "IndicatorLED":"Off"}' -k \ https://$bmc/redfish/v1/Systems/system Change-Id: I105bed5794912c575aa9a00e0442461bfdee6180 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-11-10Redfish Session : Support ClientOriginIPAddressSunitha Harish1-5/+4
This commit implements the ClientOriginIPAddress property on the session resource. The IP address is persisted across the reboot Tested by: 1. Create session POST https://${bmc}/redfish/v1/SessionService/Sessions -d '{"UserName":<>, "Password":<>}' 2. Check the session gets updated with the ClientOriginIPAddress GET https://${bmc}/redfish/v1/SessionService/Sessions/<id> 3. Redfish validator passed 4. Create session and reboot the BMC to ensure the IP address is persisted 5. Tested the basic auth populates the clientIp at req Signed-off-by: Sunitha Harish <sunharis@in.ibm.com> Change-Id: Iaa60d0657c991bde4bcf6c86819055c71c92e421
2020-11-10Manager: LOG: Remove __LINE__Gunnar Mills1-21/+12
Already in the log macro. Change-Id: Ia4d2c801d8ec7dcef5141db1ef6a6eda1df24183 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-11-10AssetTag: Add PATCH supportGunnar Mills1-1/+85
Use the same AssetTag logic from the GET. Look for xyz.openbmc_project.Inventory.Item.System interface then call that service and path to set the AssetTag. This assumes there is 1 "Item.System". Considered something like "if (!boost::ends_with(path, "system")) continue; " but no where else does bmcweb check that the Item.System is named "system" i.e. that /redfish/v1/Systems/system is actually named "system" on D-Bus. Considered looking that the service had the interface if not move to the next service but the GET code does not so just followed it. Tested: curl -k-X PATCH -d '{"AssetTag": "Paramo"}' https://${bmc}/redfish/v1/Systems/system/ curl -k https://${bmc}/redfish/v1/Systems/system/ { "@odata.id": "/redfish/v1/Systems/system", "@odata.type": "#ComputerSystem.v1_12_0.ComputerSystem", "Actions": { "#ComputerSystem.Reset": { "@Redfish.ActionInfo": "/redfish/v1/Systems/system/ResetActionInfo", "target": "/redfish/v1/Systems/system/Actions/ComputerSystem.Reset" } }, "AssetTag": "Paramo", ... Validator passes. Change-Id: I45f80a8a69457f76e6e83ad2333856abe61de933 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-11-09Redfish: getComputerSystem: Fix DoxygenGunnar Mills1-1/+1
Change-Id: I88aefe92ba2dab2c76c9e0ae14375591733f5e5a Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-11-09Fix Image and ImageName values in schemaPrzemyslaw Czarnowski1-7/+13
According to design document and schema Image shall contain URL of image location and ImageName only name of the image. Testing: Manual tests with mounting resource and checking redfish item. Change-Id: Ie1a906c66aa2a10113c307eb1e7d2d7da2810fbd Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
2020-11-06log_services: Fix redundant AsyncResp objects when deleting dump entriesStanley Chu1-6/+5
In the doPost handler for clearing Dump entries, it may create redundant AsyncResp objects in deleteDumpEntry(). This will cause redundant execution of res->end() and lead to unexpected result for subsequent request within the same connection. Tested By: - pass the openbmc-test-automation with the following case. LogService Test [Documentation] Test LogService [Tags] Test_LogService Create User Initiated BMC Dump Redfish Delete All BMC Dumps Redfish.Login Signed-off-by: Stanley Chu <yschu@nuvoton.com> Change-Id: I636cdf7a4c18072898660fd0eab1380e294d263c
2020-11-03Fix a possible null pointer dereferenceManojkiran Eda1-1/+1
- This commit would fix a possible null pointer dereference. Tested By: - Code compiles & no functional changes Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com> Change-Id: Idfb52607869ecc42756cffa68617caecfdef9cd3
2020-11-02Improve loops & fix cpp check warningManojkiran Eda3-23/+15
- This commit improves certain while loops to range based for loops. - This commit also fixes the cppcheck warning that mentions about performance issues when using postfix operators on non-primitive types. Tested By: - A function is unittested. - GET on both EthernetInterfaces & certificate service looks good without any issues. Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com> Change-Id: I85420f7bf9af45a97e1a93b916f292c2516f5802
2020-10-30Memory: Fix potential validator errorGunnar Mills1-8/+111
"Other" and "Unknown" are not valid Redfish MemoryDeviceType values. Do correct converting D-Bus enum to redfish. Straight mapping (D-Bus and Redfish both contain the same name): DDR DDR2 DDR3 DDR4 DDR4E_SDRAM LPDDR4_SDRAM LPDDR3_SDRAM DDR2_SDRAM_FB_DIMM DDR2_SDRAM_FB_DIMM_PROBE (no E on the end of the d-bus name) DDR_SGRAM ROM SDRAM EDO FastPageMode PipelinedNibble Logical HBM HBM2 The following D-Bus values are not mapped: Other Unknown DRAM EDRAM VRAM SRAM RAM FLASH EEPROM FEPROM EPROM CDRAM ThreeDRM RDRAM FBD2 LPDDR_SDRAM LPDDR2_SDRAM The following Redfish values don't have a mapping to: "DDR4_SDRAM" "DDR3_SDRAM" "DDR_SDRAM" "DDR2_SDRAM" Saw this because not setting the MemoryType so defaulting to "Other" and had removed the logic to leave off all other memory properties when MemorySizeInKB is 0 (commit above). IBM systems are not setting MemorySizeInKB so it is defaulting to 0 hence why this validator error has not been seen in CI. The validator error was "ERROR - MemoryDeviceType: Invalid Enum value 'Other' found, expected ['DDR', 'DDR2', 'DDR3', 'DDR4', 'DDR4_SDRAM', 'DDR4E_SDRAM', 'LPDDR4_SDRAM', 'DDR3_SDRAM', 'LPDDR3_SDRAM', 'DDR2_SDRAM', 'DDR2_SDRAM_FB_DIMM', 'DDR2_SDRAM_FB_DIMM_PROBE', 'DDR_SGRAM', 'DDR_SDRAM', 'ROM', 'SDRAM', 'EDO', 'FastPageMode', 'PipelinedNibble', 'Logical', 'HBM', 'HBM2']" https://github.com/openbmc/phosphor-dbus-interfaces/blob/1e8c11bf2656ed4a5fb27baa2dec3a65763bb47e/xyz/openbmc_project/Inventory/Item/Dimm.interface.yaml#L120 Tested: Passes the validator. Sent this property on D-Bus to different values. Change-Id: I629a1acd81fa6648893b7f531dfaab413cc2dd8f Signed-off-by: Gunnar Mills <gmills@us.ibm.com>