summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-07-01Make nbd-proxy header build in all casesEd Tanous2-7/+4
We very intentionally don't do this "only include header if option is enabled" thing to make sure that compile issues are seen across all builds. Tested: Code compiles. Header changes only. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I749aed62ed6cd73690f3d89d75df65bec77562c2
2022-07-01Remove BLONSEd Tanous1-1412/+0
This file was used in unit tests a while ago. It's not really a good test list, and ideally would be replaced with coverage directed fuzzing if we ever needed something like this in the future. Tested: Delete only. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I9a7d3c422226e0366399ab43abd92f762e3e4fc7
2022-07-01Fix #includes on http_client.hppEd Tanous1-0/+10
Include what you use. Tested: Code compiles Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I23c89fee6f3e39d2f2a7dc1c3ba2db8819e8adc7
2022-06-30Require explicit decorator on one arg constructorsEd Tanous13-18/+26
We essentially follow this rule already, not relying on implicit operators, although there are a number of cases where in theory we could've implicitly constructed an object. This commit enables the clang-tidy check. Tested: Code compiles, passes clang-tidy. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ia428463313b075c69614fdb326e8c5c094e7adde
2022-06-29Encode service object path with sdbusplusJiaqing Zhao1-8/+20
After service-config-manager switched to encode its object path with sdbusplus, bmcweb needs to encode them with sdbusplus as well. Tested: Verified PATCH ServiceEnabled property of SSH and IPMI works. Change-Id: I1d3317489617b609327847eaf1d40fbc5659e53c Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2022-06-28http_utility_test: fix test case namesNan Zhou1-4/+14
This commit applies the GTest test case naming convention: Camel case, use decriptive Test names. It also groups test cases according to the name. Reference: https://testing.googleblog.com/2014/10/testing-on-toilet-writing-descriptive.html http://google.github.io/googletest/primer.html#simple-tests Tested: unit test passes. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Ie008ceac9e027b518e660745722ac5cc0af502da
2022-06-28http_utility_test: add namespaceNan Zhou1-8/+14
To save duplicate codes. Tested: unit test passes. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Ibb641942b24a92f61793995337963be80d4a6151
2022-06-28Fix shadowed variable issuesEd Tanous21-152/+151
This patchset is the conclusion of a multi-year effort to try to fix shadowed variable names. Variables seem to be shadowed all over, and in most places they exist, there's a "code smell" of things that aren't doing what the author intended. This commit attempts to clean up these in several ways by: 1. Renaming variables where appropriate. 2. Preferring to refer to member variables directly when operating within a class 3. Rearranging code so that pass through variables are handled in the calling scope, rather than passing them through. These patterns are applied throughout the codebase, to the point where -Wshadow can be enabled in meson.build. Tested: Code compiles, unit tests pass. Still need to run redfish service validator. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: If703398c2282f9e096ca2694fd94515de36a098b
2022-06-28Fix fail on get PostCode entryTony Lee1-1/+1
Get url /redfish/v1/Systems/system/LogServices/PostCodes/Entries/<str> return error. Compare with sha dcf2ebc020257bc298d948fcb4da761c284e84d7 Condition checking is different from the original. Tested: Before fix: curl -X GET http://${bmc}/redfish/v1/Systems/system/LogServices/PostCodes/Entries ... { "@odata.id": "/redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-605", "@odata.type": "#LogEntry.v1_8_0.LogEntry", "Created": "1970-01-01T00:11:17+00:00", "EntryType": "Event", "Id": "B1-605", "Message": "Boot Count: 1; Time Stamp Offset: 603.1745 seconds; POST Code: 0x84", "MessageArgs": [ "1", "603.1745", "0x84" ], "MessageId": "OpenBMC.0.2.BIOSPOSTCode", "Name": "POST Code Log Entry", "Severity": "OK" } ], curl -X GET http://${bmc}/redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-605 { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The resource at the URI '/redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-605' was not found.", "MessageArgs": [ "/redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-605" ], "MessageId": "Base.1.11.0.ResourceMissingAtURI", "MessageSeverity": "Critical", "Resolution": "Place a valid resource at the URI or correct the URI and resubmit the request." } ], "code": "Base.1.11.0.ResourceMissingAtURI", "message": "The resource at the URI '/redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-605' was not found." } After fixed: curl -X GET http://${bmc}/redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-605 { "@odata.id": "/redfish/v1/Systems/system/LogServices/PostCodes/Entries", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Description": "Collection of POST Code Log Entries", "Members": [ { "@odata.id": "/redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-605", "@odata.type": "#LogEntry.v1_8_0.LogEntry", "Created": "1970-01-01T00:11:17+00:00", "EntryType": "Event", "Id": "B1-605", "Message": "Boot Count: 1; Time Stamp Offset: 603.1745 seconds; POST Code: 0x84", "MessageArgs": [ "1", "603.1745", "0x84" ], "MessageId": "OpenBMC.0.2.BIOSPOSTCode", "Name": "POST Code Log Entry", "Severity": "OK" } ], Signed-off-by: Tony Lee <tony.lee@quantatw.com> Change-Id: Iada035214a9c1dc47be00c0ed3010562b80b0a3c
2022-06-28update_service: Refactor getSoftwareVersion into a seperate functionWilly Tu1-70/+74
Moved the dbus call to SoftwareVersion into a function called getSoftwareVersion to help organize the code for future supports/ This help thin out the code a bit and will be a bit easier to navigate the code. Tested: Passed Redfish Validation test for UpdateService. No change to the redfish tree. Change-Id: I3cbc8a9c79272fc86a453e528820b2b3b95476d3 Signed-off-by: Willy Tu <wltu@google.com>
2022-06-28query_param_test: Update Positive cases for DelegateJiaqing Zhao1-6/+6
In {Top,Skip}Positive cases, canDelegate{Top,Skip} is set to false, which is the same as the default value used in Negative cases. This patch changes these value to true and update test cases. Tested: Build and unit test pass. Change-Id: Iead9e5ed805344b1c399a7bbf586c16164f15554 Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2022-06-28clients.md: fix headersNan Zhou1-2/+2
"##Abc##" is not a valid syntax. Changed to header level 2. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I1c52540bd741a65e8fa7d72237bb43a59d120b06
2022-06-28http_utility_test: fix headersNan Zhou1-2/+2
"gmock/gmock.h" should be replaced with "gtest/gtest.h" given that only GTest macors are used. "http_utility.hpp" is a local header and "gtest/gtest.h" is a header in dependencies. The convention is to use <> for dependency headers. Reference: https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html Tested: unit test passed Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I42b077090df59ee1c4fbfab3199d2ee9b4b242dc
2022-06-28dbus_utility_test: clean up headersNan Zhou1-5/+4
Removed unused headers and include missing headers. Tested: unit test passes. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Ie04af6c00d849f268ededffb3d01bb79f0f895cd
2022-06-28dbus_utility_test: add namespaceNan Zhou1-10/+17
This commit does nothing but add namespace to the test source. It can be shown that it saves a lot of duplicate codes. Tested: unit test compiles and passes. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I42a70c5c32c32c1cb09f7c3e36d6e5816aa3a53e
2022-06-28query_param_test: fix namespacesNan Zhou1-50/+19
Put all test cases into the anonymous namespace. It's shown that a lot of codes (namespaces) are not needed anymore Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Ib9866272d2d05103b2b792b361cb4c20fee67004
2022-06-28query_param: fix headersNan Zhou1-2/+5
IWYU. Use <> for dependency headers and "" for bmcweb headers. Reference: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#sf12-prefer-the-quoted-form-of-include-for-files-relative-to-the-including-file-and-the-angle-bracket-form-everywhere-else Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I80133bb38fbea886c9c7207b2ec16c0aeacca6d5
2022-06-28http: router_test: fix namespaceNan Zhou1-10/+15
Add using directives and namespaces. Teseted: unit test passed. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I4c04f07484a2c1ce29ae26b523d62071ea03996c
2022-06-28http: router_test: fix headersNan Zhou1-2/+10
IWYU. Use <> for dependency headers and "" for bmcweb headers. Reference: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#sf12-prefer-the-quoted-form-of-include-for-files-relative-to-the-including-file-and-the-angle-bracket-form-everywhere-else Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I02537f16974ab96a1e4e4e1ee6e1db1a9c679c68
2022-06-28http: utility_test: fix namespaceNan Zhou1-25/+15
Removed unnecessary using directives. Add necessary using directives. Tested: unit test passed. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I36948b531c4e75dbae6837601894839b23b2d3d1
2022-06-28http: utility_test: fix headersNan Zhou1-2/+13
IWYU. Use <> for dependency headers and "" for bmcweb headers. Reference: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#sf12-prefer-the-quoted-form-of-include-for-files-relative-to-the-including-file-and-the-angle-bracket-form-everywhere-else Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I0338d475990eaf2f0f8105b01d63c2d9bd9fc446
2022-06-28human_sort_test: add namespaceNan Zhou1-2/+7
Add an anonymous namespace and use using declarations. Tested: unit test passed. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I2d29aa7ec7923addc41b0af564542932a5abd9b4
2022-06-28human_sort_test: fix headersNan Zhou1-2/+4
IWYU. Use <> for dependency headers and "" for bmcweb headers. Reference: https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html Tested: unit test passes. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I6a329c8b04b0eccda7f601128f66770a7f119676
2022-06-28Use an enum to return message registry parsing statusJason M. Bills1-16/+26
We need to handle an event differently if it's not found in the registries vs. failing to parse, so a simple success/fail return status is no longer enough. This adds an enum to return additional status information so we can continue parsing events if one is not found in a registry. Tested: Confirmed that events not found in the registry are still correctly skipped. Change-Id: Ib3be587fc165670e231a2897d490416bd29530be Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
2022-06-28log_services: remove brace initializationJason M. Bills1-51/+47
This removes brace initialization for event, journal, and crashdump log entries. Tested: Confirmed that each log entry is the same before and after this change. Change-Id: I29a79a86b55c959671f424d36f4913865e590161 Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
2022-06-28log_services: don't replace res.jsonValueJason M. Bills1-3/+3
There were places where res.jsonValue was being replaced by assigning a new object. This changes those to use res.jsonValue.update() to replace the contents instead of the entire object. Tested: Confirmed that individual event, journal, and crashdump entries can still be retrieved. Change-Id: I8a0885530af58393d4b90fe15390db8c3af02994 Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
2022-06-28log_services: use nlohmann::json::object_tJason M. Bills1-7/+10
This updates fillBMCJournalLogEntryJson() and the crashdump logEntry to use the nlohmann::json::object_t type. Tested: Confirmed that the journal and crashdump entries are still displayed correctly. Change-Id: Ia940a41aab8e17bac006ee7735b33132e211d5a0 Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
2022-06-28Update handling of skipped log entriesJason M. Bills1-15/+22
We now skip log entries where the MessageId is not in the Message Registry. However, since a blank entry is added to the array before the MessageId is checked, it was leaving an empty {} in that location and incrementing the Members@odata.count. This change moves the MessageId check to before the entry count is incremented to fix the Members@odata.count and moves the push_back() into the array to the end, so an entry is only added if it's valid. Tested: Added three entries to the log as follows: good, bad, good. The entries array showed only the two good entries with Members@odata.count=2. Using top=2, still showed only the two good entries with Members@odata.count=2. Skip did not work but appears to already be broken, so it was not impacted by this change. Confirmed that getting a single good entry still works. Change-Id: I08ffc56af14004e2221acdb4a091bbfeb9c21c70 Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
2022-06-28Clean up firstEntry boolean checksJason M. Bills1-19/+4
The check if firstEntry is true is unnecessary and it is safe to always set to false after the first entry ID is found. So, we can clean up a few lines of if checks and always set to false. Tested: Confirmed that log entries are still listed correctly. Change-Id: If3bb1a37696786e43860848c9a038b70424950e6 Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
2022-06-28memory: Use dbus::utility::DBusPropertiesMap::value_typeJiaqing Zhao1-5/+6
Both dimmPropToHex() and getPersistentMemoryProperties() uses a custom type for DBusPropertiesMap entry, use the value_type instead. Tested: Build pass. Change-Id: Iffce0bec160d1bae684164db13994bf34ef8594f Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2022-06-28HttpClient: Increase httpReadBodyLimitCarson Labrado1-2/+3
Testing of https://gerrit.openbmc.org/c/openbmc/bmcweb/+/53310 revealed that recvMessage() was failing because the body limit was being exceeded. httpReadBodyLimit was being used to set both the body limit as well as the buffer size. Add a different variable to set the buffer size so that the body limit can be doubled to 16K while the fixed buffer can be set as a smaller size of 4K. Tested: Queries using the mentioned patch stopped failing after applying this change. Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: I33b62dfc12ff078fba9fb92b2f95a05f41acce3d
2022-06-27Move AccountService to separate methodsEd Tanous1-655/+636
Similar to the transforms we've done elsewhere, move AccountService to use non-lambda methods. Tested: Redfish service validator passes. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I1bf6d104b48552444e75f3e443822c16a45bb813
2022-06-27Rearrange forward_unauthorizedEd Tanous1-22/+21
This file is kind of hard to read. Try to improve it. This readability problem caused me to miss one of the cases and invert it, and because there's 6 possible clients/flows that need tested through these, my testing didn't catch it originally. Tested: Redfish protocol validator now passes one more test for www-authenticate. 18 failing test cases down to 12. ''' curl -vvvv --insecure -H "Accepts: application/json" https://192.168.7.2/redfish/v1/SessionService/Sessions ''' Now returns WWW-Authenticate when basic auth is enabled. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Idaed4c1fe3f58667b5478006d3091d820ca26d58
2022-06-27Add missing Context type to MetricReportAppaRao Puli1-0/+7
During EventService subscription, user can specify the "Context" type to identify the node. This "Context" must be sent to event listener for every Events/MetricReports. For MetricReports context filed is missing and its added as part of this commit. Tested: - Added MetricReport subscription with "Context" type set and can see the "Context" data on every metric report. Change-Id: Idcf4826c8e4cd13ce8c8078b6c6223584669be4c Signed-off-by: AppaRao Puli <apparao.puli@intel.com>
2022-06-27health: remove boost container headerNan Zhou1-1/+0
This header is not used. Tested: compiles. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Icb07db21b10b99c068eb93529136fe444819908a
2022-06-27log_service: make function staticNan Zhou1-1/+1
clang14++ doesn't build at HEAD because of the non-static function |getDumpEntriesPath|. Tested: clang builds. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Ib6a03f3deb435afbb04445cd7f76ee0514ceb3f1
2022-06-27Add Nan Zhou as a reviewerNan Zhou1-0/+1
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I16ba4436099c959cff16e67a4e8f1b9bd2ed047e
2022-06-27Remove old MAINTAINERS fileEd Tanous1-47/+0
The OWNERS file has replaced the function of the MAINTAINERS file. Tested: Documentation only. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I4060fcca87431834c5f68879e046281ffed3f7a4
2022-06-26error_messages: Add PropertyValueOutOfRange errorJiaqing Zhao2-0/+36
The PropertyValueOutOfRange error indicates that a property was given the correct value type but the value of that property is outside the supported range. Tested: Build pass. Change-Id: I78d5e3142b41d6739e6b0ff4699e1c731c5981d7 Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2022-06-26registry: Base: Upgrade 1.11.0 -> 1.13.0Jiaqing Zhao2-97/+233
Tested: Build pass. Change-Id: Ic985b7fc15214a1e8cfa855ce2fb9a6557201c4e Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2022-06-25sessions: iwyunitroglycerine2-8/+1
While revisiting change 49039 I saw session.hpp included a few files that are not used. I removed them and the code still compiles. Signed-off-by: Sui Chen <suichen6@gmail.com> Change-Id: I97aa2359053ce6102b84af1ef555d881cd35eaba
2022-06-25multipart_test: use ASSERT_EQ correctlyNan Zhou1-20/+20
It makes sense to use ASSERT_EQ for the |parse| function, but not every attribute for the parsed results. Tested: unit test passes. Reference: https://testing.googleblog.com/2008/07/tott-expect-vs-assert.html Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I27629eb8d721d7e62c82fdb7afbf4698546f0bdb
2022-06-25multipart_test: add namespaceNan Zhou1-1/+6
Added an anonymous namespace. Putting codes in the global namespace is generally not recommended. Reference: https://stackoverflow.com/questions/47861534/why-does-google-test-sample-put-tests-in-an-anonymous-namespace Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Ic141a1e71b80a47f9b9c0c5a0a73da68ee7c72d9
2022-06-25multipart_test: fix headersNan Zhou1-3/+7
IWYU. Use <> for dependency headers and "" for bmcweb headers. Reference: https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Id759f66b9617e5e1c59177f21acb00fb0be28b93
2022-06-25openbmc_dbus_rest_test: fix headersNan Zhou1-3/+3
The "include/" directory is already in the search path specified by -I, so remove the prefix from the header. Use <> for dependency headers and "" for bmcweb headers. Reference: https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html Tested: unit test passes. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Id0d95d927bb390dba311d9e4f4da3eef4e566ed7
2022-06-24LogService: Add support for Fault LogClaire Weinan2-171/+320
The corresponding log service is at /redfish/v1/Managers/bmc/LogServices/FaultLog Fault Log is a new type of dump for aggregating fault data. For details please see https://github.com/openbmc/docs/blob/master/designs/hw-fault-monitor.md We're currently assuming we'll have a single Fault Log instance per BMC, which can support multiple host processors. Tested: First enabled redfish-dump-log option Fault Log showed up in the expected LogService collection: ./curl_bin -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Managers/bmc/LogServices/ { "@odata.id": "/redfish/v1/Managers/bmc/LogServices", "@odata.type": "#LogServiceCollection.LogServiceCollection", "Description": "Collection of LogServices for this Manager", "Members": [ { "@odata.id": "/redfish/v1/Managers/bmc/LogServices/Journal" }, { "@odata.id": "/redfish/v1/Managers/bmc/LogServices/Dump" }, { "@odata.id": "/redfish/v1/Managers/bmc/LogServices/FaultLog" } ], "Members@odata.count": 3, "Name": "Open BMC Log Services Collection" } FaultLog dump entries are created when a fault is detected by a BMC daemon -- we don't support FaultLog dump entry creation requested by a Redfish client via the CollectDiagnosticData LogService action. Fault Log CollectDiagnosticData returned Not Found (HTTP error 404) as expected: $curl -k -H "X-Auth-Token: $token" -X POST http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Actions/LogService.CollectDiagnosticData -d '{"DiagnosticDataType":"Manager", "OEMDiagnosticDataType":"FaultLog"}' Not Found Generated Fault Log dump entries via BMC console: busctl call xyz.openbmc_project.Dump.Manager /xyz/openbmc_project/dump/faultlog xyz.openbmc_project.Dump.Create CreateDump a{sv} 0 Retrieved Fault Log dump entries (including with query parameters top and skip): curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/1 curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries?\$skip=2 curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries?\$top=3 Deleted Fault Log dump entry: curl -k -H "X-Auth-Token: $token" -X DELETE http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/1 Note: The following command to clear the Fault Log will not work until Fault Log entries have the required D-Bus interface implemented (xyz.openbmc_project.Dump.Entry.FaultLog): curl -k -H "X-Auth-Token: $token" -X POST http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Actions/LogService.ClearLog Redfish Service Validator succeeded on the following URIs: /redfish/v1/Managers/bmc/LogServices /redfish/v1/Managers/bmc/LogServices/FaultLog /redfish/v1/Managers/bmc/LogServices/FaultLog/Entries Also did cursory testing of BMC Dump (/redfish/v1/Managers/bmc/LogServices/Dump/) and System Dump (/redfish/v1/Systems/system/LogServices/Dump/) for code paths that were refactored. Signed-off-by: Claire Weinan <cweinan@google.com> Change-Id: I80b5444e61263f79e89b10abd556d59af6f17c8c
2022-06-24dbus_utility: iwyuNan Zhou1-0/+6
Manually added some missing headers. The "dbus_singleton.hpp" one is causing issues for unit tests: unit test needs to include dbus_singleton even if it just uses a helper function like "getNthStringFromPath". Tested: code compiles. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I28544835a3e4483eb52f53f7ad89d233cadd4143
2022-06-24Replace BMCWEB_ROUTES lambdas with functionsEd Tanous1-240/+250
Use functions as BMCWEB_ROUTES handlers. When possible replace lambdas with function using bind_front for app parameter. In case of findItemAndRunHandler simple lambda is used to avoid creating function with calling just one other function as findItemAndRunHandler is used also in other places. Tested (on previous patchset): - Collection: curl "https://some_addr//redfish/v1/Managers/bmc/VirtualMedia" - Item: curl "https://some_addr//redfish/v1/Managers/bmc/VirtualMedia/Slot_0" - InsertMedia (usage example ): curl -X POST "https://some_addr//redfish/v1/Managers/bmc/VirtualMedia/Slot0/Actions/VirtualMedia,InsertMedia" -H "Content-Type: application/json" -d '{"Image":"https://some_uri", "UserName":"some_username", "Password": "some_pass" }' - EjectMedia: curl -X POST "https://some_addr//redfish/v1/Managers/bmc/VirtualMedia/Slot0/Actions/VirtualMedia,EjectMedia" Change-Id: I5d336ffadf2771876aa55dd871e15a17907dddd2 Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: Ed Tanous <edtanous@google.com>
2022-06-24certificate: Add getCertificateList for get collectionsJiaqing Zhao1-155/+87
This patch adds getCertificateList (based on getCertificateLocations) to handle all the GET CertificateCollection requests in a unified way. Tested: * Certificates are listed in all 3 CertificateCollection correctly * CertificateLocations is able to list all the installed certificates * Redfish validator passed Change-Id: I52ec6f5e77b1f48725cecdfb8d24ecb72479a887 Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2022-06-24certificate: Use ObjectMapper in getCertificateLocationsJiaqing Zhao1-36/+53
Currently getCertificateLocations loops through the object paths of a certificate service and adds those paths with numeric id to the list. To get all three kinds of certificates, three calls are needed. This patch changes to use object mapper to get all paths that implements "xyz.openbmc_project.Certs.Certificate" interface to get all certs in a single DBus call. Tested: Verified all certificates installed on BMC are listed under /redfish /v1/CertificateService/CertificateLocations, and Redfish validator passed. Change-Id: I0489dc9e305f67ed7d0ef07fabda5f90fd2fdac4 Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>