#
8b24275d
|
| 27-Jun-2023 |
Ed Tanous <edtanous@google.com> |
Rename all error_code instances to ec
We're not consistent here, which leads to people copying and pasting code all over, which has lead to a bunch of different names for error codes.
This commit c
Rename all error_code instances to ec
We're not consistent here, which leads to people copying and pasting code all over, which has lead to a bunch of different names for error codes.
This commit changes to coerce them all to "ec", because that's what boost uses for a naming convention.
Tested: Rename only, code compiles.
Change-Id: I7053cc738faa9f7a82f55fc46fc78618bdf702a5 Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
#
9ae226fa
|
| 21-Jun-2023 |
George Liu <liuxiwei@inspur.com> |
Refactor setProperty method
SetProperty is a method we should use more, and use consistently in the codebase, this commit makes it consistently used from the utility namespace.
Tested: Refactor. C
Refactor setProperty method
SetProperty is a method we should use more, and use consistently in the codebase, this commit makes it consistently used from the utility namespace.
Tested: Refactor. Code compiles.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I5939317d23483e16bd98a8298f53e75604ef374d
show more ...
|
#
5eb468da
|
| 20-Jun-2023 |
George Liu <liuxiwei@inspur.com> |
Refactor getManagedObjects method
Since the getManagedObjects method has been implemented in dbus_utility and this commit is to integrate all the places where the GetManagedObjects method is obtaine
Refactor getManagedObjects method
Since the getManagedObjects method has been implemented in dbus_utility and this commit is to integrate all the places where the GetManagedObjects method is obtained, and use the method in dbus_utility uniformly.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Ic13f2bef7b30f805cd3444a75d7df17b031f2eb0
show more ...
|
#
3e72c202
|
| 27-Mar-2023 |
Ninad Palsule <ninadpalsule@us.ibm.com> |
Added new pre-defined usergroup called hostconsole
The new pre-defined usergroup named "hostconsole" is added to differentiate access between host console and manager console. The only users allowed
Added new pre-defined usergroup called hostconsole
The new pre-defined usergroup named "hostconsole" is added to differentiate access between host console and manager console. The only users allowed to interact with host console are part of the "hostconsole" group and they are in an administrator role.
Note: The changes are spread across multiple repositories listed under "Related commits:"
The bmcweb changes to incorporate new group are as follows: - The new user is added in the hostconsole group only if it has an administrative role. - The ssh usergroup is only translated to ManagerConsole redfish group and hostconsole usergroup is translated to HostConsole redfish group. - The following changes are made to check the privileges for host console access - The new OEM privilege "OpenBMCHostConsole" added for host console access. This privilege is not shared externally hence it is not documented. - Updated obmc_console BMCWEB_ROUTE to use the new privilege. - Router functions now save user role and user groups in the session - getUserPrivileges() function now takes session reference instead of user role. This function now also checks for the user group "hostconsole" and add the new privilege if user is member of this group. - Updated all callers of the getUserPrivileges to pass session reference. - Added test to validate that new privilege is set correctly.
Tested: Loaded code on the system and validated that; - New user gets added in hostconsole group. NOTE: Prior to this commit all groups are assigned to new user. This drop does not change that behavior. - Access from the web gui is only available for users in hostconsole group. Used IBM internal simulator called simics to test this. This simulator allows accessing openbmc from GUI. - Checked the role collection and there is no change. $ curl -k -H "X-Auth-Token: $TOKEN" -X GET \ https://${bmc}/redfish/v1/AccountService/Roles $ curl -k -H "X-Auth-Token: $TOKEN" -X GET \ https://${bmc}/redfish/v1/AccountService/Roles/Administrator $ curl -k -H "X-Auth-Token: $TOKEN" -X GET \ https://${bmc}/redfish/v1/AccountService/Roles/ReadOnly $ curl -k -H "X-Auth-Token: $TOKEN" -X GET \ https://${bmc}/redfish/v1/AccountService/Roles/Operator
- HostConsole is in AccountType when hostconsole group is present in UserGroups D-Bus property
$ id user99 uid=1006(user99) gid=100(users) groups=1000(priv-admin),1005(web),\ 1006(redfish),1013(hostconsole),100(users)
$ curl -k https://${bmc}/redfish/v1/AccountService/Accounts/user99 { "@odata.id": "/redfish/v1/AccountService/Accounts/user99", "@odata.type": "#ManagerAccount.v1_4_0.ManagerAccount", "AccountTypes": [ "HostConsole", "Redfish", "WebUI", "ManagerConsole" ], "Description": "User Account", "Enabled": true, "Id": "user99", "Links": { "Role": { "@odata.id": "/redfish/v1/AccountService/Roles/Administrator" } }, "Locked": false, "Locked@Redfish.AllowableValues": [ "false" ], "Name": "User Account", "Password": null, "PasswordChangeRequired": false, "RoleId": "Administrator", "UserName": "user99"
- The hostconsole group is not present for readonly or operator users and also made sure that console access is not provided. This testing is done one the system and console access was tried by modifying the https://github.com/openbmc/bmcweb/blob/master/scripts/websocket_test.py
+ curl -k https://${bmc}/redfish/v1/AccountService/Accounts/user99 { "@odata.id": "/redfish/v1/AccountService/Accounts/user99", "@odata.type": "#ManagerAccount.v1_4_0.ManagerAccount", "AccountTypes": [ "IPMI", "Redfish", "WebUI", "ManagerConsole" ], "Description": "User Account", "Enabled": true, "Id": "user99", "Links": { "Role": { "@odata.id": "/redfish/v1/AccountService/Roles/ReadOnly" } }, "Locked": false, "Locked@Redfish.AllowableValues": [ "false" ], "Name": "User Account", "Password": null, "PasswordChangeRequired": false, "RoleId": "ReadOnly", "UserName": "user99"
[INFO "http_connection.hpp":209] Request: 0x150ac38 HTTP/1.1 GET /console0 ::ffff:x.x.xx.xxx [DEBUG "routing.hpp":1265] Matched rule (upgrade) '/console0' 1 / 2 [DEBUG "routing.hpp":1084] userName = user99 userRole = priv-user [DEBUG "routing.hpp":1123] IsUserPrivileged: group=ipmi [DEBUG "routing.hpp":1123] IsUserPrivileged: group=redfish [DEBUG "routing.hpp":1123] IsUserPrivileged: group=ssh [DEBUG "routing.hpp":1123] IsUserPrivileged: group=web [DEBUG "routing.hpp":93] checkPrivileges: BASE USER: Login [DEBUG "routing.hpp":93] checkPrivileges: BASE USER: ConfigureSelf [DEBUG "routing.hpp":113] checkPrivileges: OEM REQUIRED: OpenBMCHostConsole [ERROR "routing.hpp":1192] Insufficient Privilege
+ curl -k https://${bmc}/redfish/v1/AccountService/Accounts/user99 { "@odata.id": "/redfish/v1/AccountService/Accounts/user99", "@odata.type": "#ManagerAccount.v1_4_0.ManagerAccount", "AccountTypes": [ "IPMI", "Redfish", "WebUI", "ManagerConsole" ], "Description": "User Account", "Enabled": true, "Id": "user99", "Links": { "Role": { "@odata.id": "/redfish/v1/AccountService/Roles/Operator" } }, "Locked": false, "Locked@Redfish.AllowableValues": [ "false" ], "Name": "User Account", "Password": null, "PasswordChangeRequired": false, "RoleId": "Operator", "UserName": "user99"
[INFO "http_connection.hpp":209] Request: 0x21c7c38 HTTP/1.1 GET /console0 ::ffff:x.x.xx.xxx [DEBUG "routing.hpp":1265] Matched rule (upgrade) '/console0' 1 / 2 [DEBUG "routing.hpp":1084] userName = user99 userRole = priv-operator [DEBUG "routing.hpp":1123] IsUserPrivileged: group=ipmi [DEBUG "routing.hpp":1123] IsUserPrivileged: group=redfish [DEBUG "routing.hpp":1123] IsUserPrivileged: group=ssh [DEBUG "routing.hpp":1123] IsUserPrivileged: group=web [DEBUG "routing.hpp":93] checkPrivileges: BASE USER: Login [DEBUG "routing.hpp":93] checkPrivileges: BASE USER: ConfigureComponents [DEBUG "routing.hpp":93] checkPrivileges: BASE USER: ConfigureSelf [DEBUG "routing.hpp":113] checkPrivileges: OEM REQUIRED: OpenBMCHostConsole [ERROR "routing.hpp":1192] Insufficient Privilege
Related commits: NOTE: docs, openbmc, obmc-console changes are already merged. bmcweb and phosphor-user-manager will be merged together. docs: https://gerrit.openbmc.org/c/openbmc/docs/+/60968 phosphor-user-manager: https://gerrit.openbmc.org/c/openbmc/phosphor-user-manager/+/61583 openbmc: https://gerrit.openbmc.org/c/openbmc/openbmc/+/61582 obmc-console: https://gerrit.openbmc.org/c/openbmc/obmc-console/+/61581 bmcweb: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/61580
Change-Id: Ia5a33dafc9a76444e6a8e74e752f0f90cb0a31c8 Signed-off-by: Ninad Palsule <ninadpalsule@us.ibm.com>
show more ...
|
#
1ee2db7f
|
| 10-Apr-2023 |
Andrew Geissler <geissonator@yahoo.com> |
redfish: ensure protocol state always returned
The code logic currently calls the systemd 'ListUnits' interface and then compares the returned services and sockets with a predefined map that associa
redfish: ensure protocol state always returned
The code logic currently calls the systemd 'ListUnits' interface and then compares the returned services and sockets with a predefined map that associates the systemd units with specific protocols. The appropriate 'Port' and 'ProtocolEnabled' properties are then filled into the Redfish response to a redfish/v1/Managers/bmc/NetworkProtocol query.
The issue is that when certain services like IPMI or SSH are disabled, the systemd unit will no longer be returned by the 'ListUnits' d-bus interface. This results in the IPMI and SSH protocols not showing up in the Redfish query. This commit ensures if a feature like IPMI or SSH is disabled, the user will still see it in the Redfish query and it will shows false for 'ProtocolEnabled'.
Looked into calling 'ListUnitFiles' which sounds like it returns all possible units in the system, but that consistently timed out when calling in a witherspoon qemu session (vs. the instant response to `ListUnits` in the same session).
Prior to commit 5c3e927 the code operated differently and would look up each individual protocol. If it didn't find it, then it would fill in defaults. The change caused us to no longer put a default in for the protocols when they are disabled.
Tested: - Confirmed when IPMI was disabled that a query to NetworkProtocol returned with IPMI in its response and 'ProtocolEnabled' was false - Basic testing to ensure IPMI could be enabled/disabled and Redfish responses were as expected - Ran redfish validator when NetworkProtocol was returning IPMI disabled
Change-Id: I476361413fdb508c93aea88ca6142bc649562c56 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
show more ...
|
#
89492a15
|
| 10-May-2023 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest .clang-format from the docs repository and reformat the repository.
Change-Id: I75f89d2959b0f1338c20d72ad669fbdc1d720835 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
c251fe81
|
| 13-Dec-2022 |
Jian Zhang <zhangjian.3032@bytedance.com> |
Fix cannot get NTPServers
When we have 2 or more netdevs, if eth0 configured the StaticNTPServers and eth1 not by default, the NTPServers will be empty.
We could merge all the NTPServers from all t
Fix cannot get NTPServers
When we have 2 or more netdevs, if eth0 configured the StaticNTPServers and eth1 not by default, the NTPServers will be empty.
We could merge all the NTPServers from all the interfaces, and remove the duplicate ones(Already have).
Limitations(not this patch): When setting the NTPServers, will set all the interfaces, cannot be set individually.
Tested: Only config the eth0's NTPServers, keep eth1's NTPServers empty.
``` ~# curl -k -H "X-Auth-Token: $token" https://$bmc/redfish/v1/Managers/bmc/NetworkProtocol { ... "NTP": { "NTPServers": [ "fdbd:dc00::10:8:8:14", "fdbd:dc00::10:8:8:15", "fdbd:dc00::10:8:8:16", "10.8.8.14", "10.8.8.15", "10.8.8.16" ], "ProtocolEnabled": true }, }
```
Change-Id: Ie181bb117577bc46f87e714b87dcb7cd8f5145a8 Signed-off-by: Jian Zhang <zhangjian.3032@bytedance.com>
show more ...
|
#
5c3e9272
|
| 24-Jun-2021 |
Abhishek Patel <Abhishek.Patel@ibm.com> |
Retrieve port info for systems service
In systems.hpp for Serialconsole, SSH service-enabled and its Port number info is hardcoded. Same for IPMI service-enabled info is also hardcoded.
Implementat
Retrieve port info for systems service
In systems.hpp for Serialconsole, SSH service-enabled and its Port number info is hardcoded. Same for IPMI service-enabled info is also hardcoded.
Implementation:
SSH: check for obmc-console-ssh@2200.service service is enable or not, and yes then, on which port number. Retrieve service-related information and pass that into DMTF for "/redfish/v1/Systems/system/".
IPMI:- check for phosphor-ipmi-net@eth0.socket service is enable or not, and pass that info DMTF for "/redfish/v1/Systems/system/".
Tested: Manually tested on the Witherspoon system, there is no change in output. Run Redfish validator. No error found.
Before:
"SerialConsole": { "IPMI": { "ServiceEnabled": true }, "MaxConcurrentSessions": 15, "SSH": { "HotKeySequenceDisplay": "Press ~. to exit console", "Port": 2200, "ServiceEnabled": true } }
After:
Note: SSH Info retrieve via Dbus ListUnit API
"SerialConsole": { "IPMI": { "ServiceEnabled": true }, "MaxConcurrentSessions": 15, "SSH": { "HotKeySequenceDisplay": "Press ~. to exit console", "Port": 2200, "ServiceEnabled": true } }
Signed-off-by: Abhishek Patel <Abhishek.Patel@ibm.com> Change-Id: I70009ee785aab3ca4a61fe0d96fbc5b340831647
show more ...
|
#
af20dd1c
|
| 07-Jul-2022 |
Ed Tanous <edtanous@google.com> |
Add support for Link header in NetworkProtocol
Similar to support added earlier in the tree, add support for the Link header that Redfish requires.
Tested: HEAD /redfish/v1/Managers/bmc/NetworkProt
Add support for Link header in NetworkProtocol
Similar to support added earlier in the tree, add support for the Link header that Redfish requires.
Tested: HEAD /redfish/v1/Managers/bmc/NetworkProtocol returns correct Link header.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I0ffb86a4d95c8766822d208a51683dcbefc01dd5
show more ...
|
#
e634b34c
|
| 07-Jul-2022 |
Ed Tanous <edtanous@google.com> |
Move network protocol to separate methods
Similar to the code we've been building elsewhere, move NetworkProtocol to separate methods, and avoid lambdas.
Tested: Code compiles. Tested as part of n
Move network protocol to separate methods
Similar to the code we've been building elsewhere, move NetworkProtocol to separate methods, and avoid lambdas.
Tested: Code compiles. Tested as part of next patch. (merge at the same time)
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I6dca5917f3e67153f0135ce9b915bb1f02ac6a0e
show more ...
|
#
5e7e2dc5
|
| 16-Feb-2023 |
Ed Tanous <edtanous@google.com> |
Take boost error_code by reference
By convention, we should be following boost here, and passing error_code by reference, not by value. This makes our code consistent, and removes the need for a co
Take boost error_code by reference
By convention, we should be following boost here, and passing error_code by reference, not by value. This makes our code consistent, and removes the need for a copy in some cases.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Id42ea4a90b6685a84818b87d1506c11256b3b9ae
show more ...
|
#
e99073f5
|
| 08-Dec-2022 |
George Liu <liuxiwei@inspur.com> |
Refactor GetSubTree method
Since the GetSubTree method has been implemented in dbus_utility and this commit is to integrate all the places where the GetSubTree method is called, and use the method i
Refactor GetSubTree method
Since the GetSubTree method has been implemented in dbus_utility and this commit is to integrate all the places where the GetSubTree method is called, and use the method in dbus_utility uniformly.
Tested: Redfish Validator Passed
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: If3852b487d74e7cd8f123e0efffbd4affe92743c
show more ...
|
#
3ccb3adb
|
| 13-Jan-2023 |
Ed Tanous <edtanous@google.com> |
Fix a boatload of #includes
Most of these missing includes were found by running clang-tidy on all files, including headers. The existing scripts just run clang-tidy on source files, which doesn't
Fix a boatload of #includes
Most of these missing includes were found by running clang-tidy on all files, including headers. The existing scripts just run clang-tidy on source files, which doesn't catch most of these.
Tested: Code compiles
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ic741fbb2cc9e5e92955fd5a1b778a482830e80e8
show more ...
|
#
0f55d946
|
| 19-Dec-2022 |
Ed Tanous <edtanous@google.com> |
Add missing inline on function prototype
Clang correctly notes that this function is missing an inline definition.
Tested: Code compiles further on clang (other failures still present).
Signed-off
Add missing inline on function prototype
Clang correctly notes that this function is missing an inline definition.
Tested: Code compiles further on clang (other failures still present).
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I7d6420e2bb1c0c9360ff8427857aa916142c5a66
show more ...
|
#
fcd2682a
|
| 01-Dec-2022 |
Ed Tanous <edtanous@google.com> |
Fix NTPServers property in Redfish
Recent changes to phosphor-network have changed the NTPServers property to be actually StaticNTPServers. This makes PATCH incorrect.
Tested: Redfish-protocol-val
Fix NTPServers property in Redfish
Recent changes to phosphor-network have changed the NTPServers property to be actually StaticNTPServers. This makes PATCH incorrect.
Tested: Redfish-protocol-validator passes the NTPServers property again.
``` curl -vvvv --insecure --user root:0penBmc https://192.168.7.2/redfish/v1/Managers/bmc/NetworkProtocol -X PATCH -d '{"NTP": {"NTPServers": ["time-a-b.nist.gov", "time-b-b.nist.gov"]}}' ```
Now succeeds.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ie4bcfa6190797dd250421d1a512677841a4319e4
show more ...
|
#
2138483c
|
| 08-Nov-2022 |
George Liu <liuxiwei@inspur.com> |
Add the GetSubTree and GetSubTreePaths method to dbus_utility
There are currently many files that use the GetSubTree and GetSubTreePaths methods. Since they are a general method, they are defined in
Add the GetSubTree and GetSubTreePaths method to dbus_utility
There are currently many files that use the GetSubTree and GetSubTreePaths methods. Since they are a general method, they are defined in the dbus_utility.hpp file and will be further refactored in subsequent patches.
Also, Updated the doPath method of NetworkProtocol synchronously.
Tested: Built bmcweb successfully and Validator passes 1. doGet NetworkProtocol curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol", "IPMI": { "Port": 623, "ProtocolEnabled": true }, ... }
2. change the ProtocolEnabled property to false curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH -d '{"IPMI": {"ProtocolEnabled" :false}}' https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol
3. doGet NetworkProtocol again curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol", "IPMI": { "Port": null, "ProtocolEnabled": false }, ... }
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I9ed3de74417d2662a7f433ea4a589f68f514a369
show more ...
|
#
e9f71672
|
| 21-Sep-2022 |
Ed Tanous <edtanous@google.com> |
Implement links and HEAD for NetworkProtocol
Along the lines of changes we've made elsewhere, add Links, and a HEAD handler for bmc NetworkProcotol instances.
Tested: ``` curl -vvvv --insecure --u
Implement links and HEAD for NetworkProtocol
Along the lines of changes we've made elsewhere, add Links, and a HEAD handler for bmc NetworkProcotol instances.
Tested: ``` curl -vvvv --insecure --user root:0penBmc https://192.168.7.2/redfish/v1/JsonSchemas/NetworkProtocol/NetworkProtocol.json ```
Returns a links header as part of the response.
Adding -X HEAD to the curl request results in the same header being included.
Redfish service validator passes.
Redfish PROTOCOL VALIDATOR PASSES ! ! ! ! ! with zero failures. Summary - PASS: 392, WARN: 0, FAIL: 0, NOT_TESTED: 32
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ib96f7c8d5d8d960000a1bb77065fc06d2829e4b8
show more ...
|
#
532d7697
|
| 18-Oct-2022 |
Gunnar Mills <gmills@us.ibm.com> |
Revert "NetworkProtocol: Support NetworkSuppliedServers property"
This reverts commit 525fc07224884d3640e5c4a1b6a551aee024f7bd. As discussed in discord, https://gerrit.openbmc.org/c/openbmc/openbmc/
Revert "NetworkProtocol: Support NetworkSuppliedServers property"
This reverts commit 525fc07224884d3640e5c4a1b6a551aee024f7bd. As discussed in discord, https://gerrit.openbmc.org/c/openbmc/openbmc/+/57931 is a legit fail.
[1] https://discord.com/channels/775381525260664832/776550056391606352/1030497797121777768
The validator is failing due to: ERROR - NetworkSuppliedServers not defined in Complex NTPManagerNetworkProtocol.v1_2_0.NTPProtocol (check version, spelling and casing)
Since the bmcweb bump merged, seeing validator fails in openbmc/openbmc.
Revert, get the validator passing again, will open an issue with redfish since this looks like an issue with the schema itself.
Tested: None. Change-Id: Ie8046c93eaf2f69c71eb5162dacb961032f9366c Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
#
525fc072
|
| 09-Aug-2022 |
Sunitha Harish <sunithaharish04@gmail.com> |
NetworkProtocol: Support NetworkSuppliedServers property
There was no way to differentiate between the static and DHCP assigned NTP servers. Networkd and Dbus has added support for StaticNTPServers
NetworkProtocol: Support NetworkSuppliedServers property
There was no way to differentiate between the static and DHCP assigned NTP servers. Networkd and Dbus has added support for StaticNTPServers to save the static configuration.
PATCH command will now set the StaticNTPServers property at the backend. NTPServers property will contain network supplied dynamic NTP Servers at the system.
Tested by: 1. PATCH /redfish/v1/Managers/bmc/NetworkProtocol -d '{"NTP":{"NTPServers": [<ip>]}}' Verify that this adds the NTPs server to the NetworkProtocol 2. Enable DHCP to fetch NTP servers list from the DHCP server. Verify that they are listed when GET on NetworkProtocol as below "NTP": { "NTPServers": [ <static ntp server ip> ], "NetworkSuppliedServers": [ <dynamic ntp server ip> ], "ProtocolEnabled": true }, 3. Redfish validator run
Signed-off-by: sunharis <sunithaharish04@gmail.com> Change-Id: Ifac77485485839292b770d36def35da17d723c4e
show more ...
|
#
02cad96e
|
| 30-Jun-2022 |
Ed Tanous <edtanous@google.com> |
Fix const correctness issues
cppcheck correctly notes that a lot of variables in the new code can be const. Make most of them const.
Tested: WIP
Signed-off-by: Ed Tanous <edtanous@google.com> Cha
Fix const correctness issues
cppcheck correctly notes that a lot of variables in the new code can be const. Make most of them const.
Tested: WIP
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I8f37b6353fd707923f533e1d61c5b5419282bf23
show more ...
|
#
b9e15228
|
| 22-Jun-2022 |
Ed Tanous <edtanous@google.com> |
Handle NTPServers list per the specification
The Redfish specification for PATCH of arrays defines a number of requirements. - Setting a value to null, should remove it from the list. - Setting a va
Handle NTPServers list per the specification
The Redfish specification for PATCH of arrays defines a number of requirements. - Setting a value to null, should remove it from the list. - Setting a value to empty object "{}" should leave the value unmodified - Values at indexes larger than whats included in the PATCH request shall be removed.
This commit attempts to fix this behavior for NTPServers and make it correct. It does this by first getting the list of NTP servers, then walking the list in parallel with the list given in the patch, and either modifying or changing the list as the spec requires before setting the setting across the system.
It also turns out that the current behavior of unpacking nlohmann::json objects requires an object to be an array, object, or null, which doesn't allow unpacking the strings required in this case, so that check is removed. A quick inspection shows that we don't unpack nlohmann objects very often, and this should have no impact.
Tested: Redfish-protocol-validator tests for NTPServers now pass
''' curl -vvvv --insecure --user root:0penBmc https://192.168.7.2/redfish/v1/Managers/bmc/NetworkProtocol -X PATCH -d '{"NTP": {"NTPServers": []}}' ''' Used to patch values succeeds with various "good" values; ["time-a-b.nist.gov", "time-b-b.nist.gov"] [{}, {}] ["time-a-b.nist.gov", null] []
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I23a8febde34817bb0b934e46e2b77ff391b52a57
show more ...
|
#
0225b87b
|
| 27-Jun-2022 |
Ed Tanous <edtanous@google.com> |
Move duplicate reduction
getEthernetIfaceData callback should ideally be returning exactly the values the system has, minus duplicates. In every case this function is used, we don't want duplicates
Move duplicate reduction
getEthernetIfaceData callback should ideally be returning exactly the values the system has, minus duplicates. In every case this function is used, we don't want duplicates, so move where we check for duplicates.
Tested: In conjunction with https://gerrit.openbmc.org/c/openbmc/bmcweb/+/54829 test cases pass.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ib202db99f70e1a6fdddf18969e15b2382e287848
show more ...
|
#
69320d54
|
| 01-Apr-2022 |
Jiaqing Zhao <jiaqing.zhao@intel.com> |
Encode service object path with sdbusplus
After service-config-manager switched to encode its object path with sdbusplus, bmcweb needs to encode them with sdbusplus as well.
Tested: Verified PATCH
Encode service object path with sdbusplus
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>
show more ...
|
#
8a592810
|
| 04-Jun-2022 |
Ed Tanous <edtanous@google.com> |
Fix shadowed variable issues
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, the
Fix shadowed variable issues
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
show more ...
|
#
3ba00073
|
| 06-Jun-2022 |
Carson Labrado <clabrado@google.com> |
Expose AsyncResp shared_ptr when handling response
For Redfish Aggregation, we need a common point to check the D-Bus for satellite configs. If they are available then we perform the aggregation op
Expose AsyncResp shared_ptr when handling response
For Redfish Aggregation, we need a common point to check the D-Bus for satellite configs. If they are available then we perform the aggregation operations. The functions in query.hpp are used by all endpoints making them the logical location. The aggregation code requires a shared_ptr to the AsyncResp so these functions need to be able to supply that.
This patch is broken out of a future patch for routing Redfish Aggregation requests https://gerrit.openbmc.org/c/openbmc/bmcweb/+/53310
The follow commands can be used to perform most of the replacements: find . -type f | xargs sed -i 's/setUpRedfishRoute(app, req, asyncResp->res/setUpRedfishRoute(app, req, asyncResp/g' find . -type f | xargs sed -i 's/setUpRedfishRouteWithDelegation(app, req, asyncResp->res/setUpRedfishRouteWithDelegation(app, req, asyncResp/g'
Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: I4f4f9f22cdcfb14a3bd94b9a8f3d64aae34e57bc
show more ...
|