Age | Commit message (Collapse) | Author | Files | Lines |
|
Now that we are using timer.async_wait() with the async http
operations we need to account for the scenario where the timer fails
before the operation fails. When that occurs we need to abort the
operation once its callback gets called.
Currently we proceed as if the timer doesn't exist. This causes a
fault if one of the operations times out. This patch adds a check
to the start of each async operation so that we do not continue with
the normal message sending flow when an operation times out.
Tested:
In order to create a connection timeout I created a dummy interface
and set the IP of my satellite BMC to route to the interface:
ip link add dummy0 type dummy
ip link set dev dummy0 up
ip route add 120.60.30.15 dev dummy0
All packets sent to 120.60.30.15 will get dropped and thus connection
attempts will timeout. This does not cause bmcweb to crash.
To make the satellite reachable again I used
this command to delete the routing:
ip route del 120.60.31.15 dev dummy0
After doing so messages were once again able to be forwarded correctly
to the satellite.
Signed-off-by: Carson Labrado <clabrado@google.com>
Change-Id: Ie8d022c2195838e383eefcd0e12ae8cfab76e3e1
|
|
Users should be able to delete LDAP client certificate, and phosphor-
certificate-manager already supports this. This patch adds the Redfish
API endpoint for it.
Tested:
DELETE /redfish/v1/AccountService/LDAP/Certificates/1 removes the LDAP
client certificate installed on system.
Change-Id: If1c082c78c404b5877e74ba50de3a970cd823a90
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
|
|
This commit implements the Redfish PowerSubsystem schema and collects
default property values.
PowerSupplies will be implemented in the next commit.
ref:
https://www.dmtf.org/sites/default/files/standards/documents/
DSP0268_2022.2.pdf (6.86 PowerSubsystem 1.1.0)
https://redfish.dmtf.org/schemas/v1/PowerSupply.v1_1_0.json
Tested: Validator and UT passes
1. curl -k -H "X-Auth-Token: $token" -X GET
https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem
{
"@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem",
"@odata.type": "#PowerSubsystem.v1_1_0.PowerSubsystem",
"Id": "PowerSubsystem",
"Name": "Power Subsystem",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
2. bad chassisID
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}
/redfish/v1/Chassis/badchassisID/PowerSubsystem/
PowerSupplies/powersupply0
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The requested resource of type Chassis named
badchassisID was not found.",
"MessageArgs": [
"Chassis",
"badchassisID"
],
"MessageId": "Base.1.13.1.ResourceNotFound",
"MessageSeverity": "Critical",
"Resolution": "Provide a valid resource identifier
and resubmit the request."
}
],
"code": "Base.1.13.1.ResourceNotFound",
"message": "The requested resource of type Chassis named
badchassisID was not found."
}
}
Signed-off-by: Chicago Duan <duanzhijia01@inspur.com>
Change-Id: I6885b1777082538eceaf7ea85a8f69966459ee43
|
|
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>
|
|
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/57648/8 is unfortunately
rejected by some CI issues where # lines covered by unit test is not
consistent.
Thus, this commit is written to bypass subdir, but still addes the
ability to run a test for a specific component. This speeds up iteration
when developers are working on a subset of the project.
For example, we can compile and run the query_param_test separately. The
speed up will be more obvious when we have better solution to deal with
the current headers and inline functions in the future.
```
meson test query_param_test -C b
ninja: Entering directory `/usr/local/google/home/nanzhou/Desktop/bmcweb/b'
ninja: no work to do.
1/1 query_param_test OK 0.01s
Ok: 1
Expected Fail: 0
Fail: 0
Unexpected Pass: 0
Skipped: 0
Timeout: 0
```
The compile time increases a little bit. This doesn't matter too much
given tests are disabled in Yocto builds.
```
[hi on] nanzhou@nanzhou:~/Desktop/bmcweb$ time ninja test -C b
ninja: Entering directory `b'
[49/50] Running all tests.
1/1 bmcweb_unit_test OK 0.07s
Ok: 1
Expected Fail: 0
Fail: 0
Unexpected Pass: 0
Skipped: 0
Timeout: 0
Full log written to /usr/local/google/home/nanzhou/Desktop/bmcweb/b/meson-logs/testlog.txt
real 1m56.361s
user 12m11.587s
sys 1m15.924s
[hi on] nanzhou@nanzhou:~/Desktop/bmcweb$ time ninja test -C b
ninja: Entering directory `b'
[247/248] Running all tests.
1/23 crow_getroutes_test OK 0.34s
2/23 router_test OK 0.31s
3/23 utility_test OK 0.29s
4/23 dbus_utility_test OK 0.28s
5/23 google_service_root_test OK 0.27s
6/23 http_utility_test OK 0.26s
7/23 human_sort_test OK 0.24s
8/23 multipart_test OK 0.21s
9/23 openbmc_dbus_rest_test OK 0.20s
10/23 privileges_test OK 0.18s
11/23 registries_test OK 0.17s
12/23 hex_utils_test OK 0.16s
13/23 ip_utils_test OK 0.15s
14/23 json_utils_test OK 0.15s
15/23 query_param_test OK 0.13s
16/23 stl_utils_test OK 0.12s
17/23 chassis_test OK 0.10s
18/23 service_root_test OK 0.04s
19/23 thermal_subsystem_test OK 0.03s
20/23 configfile_test OK 0.23s
21/23 lock_test OK 0.22s
22/23 time_utils_test OK 0.11s
23/23 log_services_dump_test OK 0.07s
Ok: 23
Expected Fail: 0
Fail: 0
Unexpected Pass: 0
Skipped: 0
Timeout: 0
Full log written to /usr/local/google/home/nanzhou/Desktop/bmcweb/b/meson-logs/testlog.txt
real 2m8.792s
user 29m15.844s
sys 3m10.264s
```
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I6f763173c1e7de96ab757673fb5ed0a73e4532f5
|
|
This pattern is used in other places, e.g.,
https://github.com/openbmc/phosphor-logging
In this way, we can cleanly add the bmcweb_config.h into include
directory. Otherwise, any subdir we have in this project will need to
include the root.
Tested: it builds.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I882e51f3acb256a881c9474f6e4d4e19fea4a413
|
|
Based on DSP8010_2022.2 and adds the EnvironmentMetrics schema.
Tested: built bmcweb successfully and validator passes
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I994b48c544edc22a6bf99187b536f3e51e10b052
|
|
It's obvious that we want to skip if the string is empty, not if it is
valid.
Tested: code compiles. Trivial change.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I892e81fb0f87a8999eb880100fd284419054eece
|
|
I believe this was a typo. We shouldn't return when a deviceId is not
found.
Tested: s7106 doesn't have PCIe backend configured. I tested it on
a downstream system and Members@odata.count shows up.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I38491caf8998fac5fafa0c0f07396cf32066348b
|
|
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
|
|
This commit fixed several places (but not all) where wrong include
directory is specified and prevent the clean up in the chidren changes.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Ibbba62e2c0cfe3583a65f1befa1b233bd3eebf19
|
|
Error message to be thrown when StrictAccountTypes is true and the
specified value(s) for AccountTypes or OEMAccountTypes was not accepted.
Testing:
strictAccountTypes() error message was tested while testing redfish
PATCH API for patching AccountTypes.
Signed-off-by: Shantappa Teekappanavar <shantappa.teekappanavar@ibm.com>
Change-Id: I13abcd142ddfb04a2a187c9373fa996ecfe987a1
|
|
This commit contains changes to accept the object path instead of the
dumpId for user-initiated dumps.
Earlier a task would be started to monitor the 'interfaces added' signal
when a new dump object is created. Now, this change checks if the
created dump object has implemented Progress interface, if yes, then the
'Status' property is used to track the dump creation progress. Else,
task will be marked completed.
With this change failed dumps will now be returning an internal error
back to the user, as a part of the task message.
The createDump dbus call has been changed in the backend to accept
additional arguments with the below commits:
[1] https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/36331
[2] https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-debug-collector/+/37792
[3] https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/44380
This commit also bumps up the task timeout.
During system boot, the BMC dump takes more than 3 minutes to complete
and task expires with a timeout. This commit increases this timeout to
be 6 minutes.
Tested-By:
* POST https://${bmc}/redfish/v1/Managers/bmc/LogServices/Dump/Actions/
LogService.CollectDiagnosticData -d '{"DiagnosticDataType":"Manager"}'
=> A task will be returned as the redfish response
* GET https://${bmc}/redfish/v1/TaskService/Tasks/1
=> Get on the task URI to verify the task status for success and failure
scenarios
Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>
Change-Id: I1686823a86eae836f770c19f33ffb21c98dd79ef
|
|
When requesting a log extry that does not exist on system, a 404 Not
Found HTTP status code and corresponding ResourceNotFound error message
should be returned. Current code mistakenly uses ResourceMissingAtURI
error which should be used for referencing a non-existing resource in
request properties.
Tested:
Verified requesting on a non-existing now responds with HTTP 404 and
NotFound message manually. (This cannot be checked with Redfish Service
Validator.)
Change-Id: I3ef525eec3622918921bb9eb0b93fb6195c1a5b9
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
|
|
The LastStateTime is the last time the BootProgress property was
updated. It is defined by BootProgressUpdate D-bus [1].
This commit is to support this.
[1] https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml//xyz/openbmc_project/State/Boot/Progress.interface.yaml#L11
Tested:
1. Set boot progress code
# ipmitool raw 0x2c 0x02 0xae 0x01 0x00 0x00 0x00 0x00 0x10 0x01 \
0x00 0x00
2. Check the progress code from the Redfish interface
"BootProgress": {
"LastState": "OEM",
"LastStateTime": "2022-10-10T04:21:08.416796+00:00"
}
Signed-off-by: Hieu Huynh <hieuh@os.amperecomputing.com>
Change-Id: I0834887e159970d5775dbfbf7753196b1e1cec29
|
|
In 2022.2, Redfish added support for the Context parameter on the
Session Resource. This parameter has the same function that the
OemSession.ClientId field served. This commit moves all the existing
ClientId code to produce Context as well.
Functionally, this has one important difference, in that Context in
Redfish is optionally provided by the user, which means we need to omit
it if not given by the user. The old implementation left it set to
empty string ("").
Because of this, a few minor interfaces need to change to use
std::optional. Existing uses of clientId are moved to using
value_or("") to keep the same behavior as before.
Tested:
curl --insecure -X POST -d "{\"UserName\": \"root\", \"Password\":
\"0penBmc\"}" https://192.168.7.2/redfish/v1/SessionService/Sessions
Returns a Session object with no Context key present
curl --insecure -X POST -d "{\"UserName\": \"root\", \"Password\":
\"0penBmc\", \"Context\": \"Foobar\"}"
https://192.168.7.2/redfish/v1/SessionService/Sessions
Returns a Session object with:
"Context": "Foobar"
Subsequent Gets of /redfish/v1/SessionService/Sessions/<sid>
return the same session objects, both with and without Context.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I4df358623f93f3e6cb659e99970ad909cefebc62
|
|
Scaling parameters on integer value sensors were removed from
phosphor-dbus-interfaces a long time ago[1] in lieu of double
parameters. It has been several years since that change, and to the
projects knowlege, all sensor daemons either never produced an int64
type, or have since been converted to producing double.
Bmcweb kept compatibility for some time during the transition, but these
days it is just unused code. Remove it.
Tested: Redfish-service-validator passes.
[1] https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/11739
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie64b093f7b787c169613bb0ff2d9f96fba8dda1a
|
|
In current implementation, setting VLANEnable to true does nothing
while setting to false will essentially delete the VLAN from system,
which is not a reasonable behavior for Redfish. PATCH requests should
never delete a resource. This patch changes the behavior to changing
the NICEnabled property of VLAN interface, which essentially enables/
disables the VLAN interface.
Tested:
Verified PATCH {"VLANEnable": false} no longer deletes the interface
and the NICEnabled property on DBus is successfully changed.
Change-Id: I8c47f6f2987fed576ba36c215f29bc03c6e9182b
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
|
|
The parseInterfaceData() for VLAN simply writes some properties to the
response. Move the code to the GET handler for better readability and
remove an extra check for vlanID.
Tested:
Verified VLAN properties are shown normally at /redfish/v1/Managers/bmc
/EthernetInterfaces/eth0/VLANs/eth0_1
Change-Id: I93ed6e230b5b74eead18775725fd8ae8295b17d5
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
|
|
std::string_view causes invalid memory access in multipart branch when
assigned local variable goes out of scope and string_view is passed to
ramAuthenticateUser. Moved MultipartParser to higher scope, to ensure
it is not deleted before std::string_view.
Tested:
- Executed post on /login, got response:
{
"data": "User 'root' logged in",
"message": "200 OK",
"status": "ok"
}
Change-Id: I0b02dddcb1a887d442525ffedb7a08a00087f2f2
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
|
|
Add schemas for PowerSubsystem PowerSupply and PowerSupplyCollection.
Tested: built bmcweb successfully and validator passes.
Signed-off-by: Chicago Duan <duanzhijia01@inspur.com>
Change-Id: I913d690108e30c841d5dec5fa37c7b9cee43f7c1
|
|
- Index was not checked against size before dereference. Which cased to
override memory.
- Header without colon could put parser into invalid state. Now it will
return with error.
- Content after boundary was not correctly discarded.
- Parser did not check body for final boudary. Now missing final
boundary will return with error.
Tested:
- Tested that payload with header without colon doesn't cause memory
corruption anymore.
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: I12f496ab5f53e6c088cdfdf2e96be636d66f7c7f
|
|
This is preliminary patch to set up the route handling such that it's
ready for the addition of multiple hosts, multiple managers in the
future. Routes previously took the form of
/redfish/v1/Systems/system
which essentially hardcoded the name "system" into a number of places.
As the stack evolves to support multiple systems, this needs to change.
This patchset changes all the ComputerSystem resources to the form:
/redfish/v1/Systems/<str>
and adds 404 checks to each route such that they will be handled
properly still. This means that as we evolve our multi-host support,
each individual route can be moved one at a time to support multi-host.
In the future, moving these to redfish-spec-defined routing would likely
mean that we could generate this code in the future at some point, which
reduces the likelihood that people do it incorrectly.
This patch currently sets the resource id and resource type in the
resourceNotFound message to empty string (""). This handling is still
arguably more correct than what we had before, which just returned 404
with an empty payload, although this will be corrected in the future.
Tested: None yet. RFC to see if this is a pattern we'd like to
propogate
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: If9c07ad69f5287bb054645f460d7e370d433dc27
|
|
This patch adds deleteCertificate function to delete an installed cert,
which is used in current DELETE TrustStore cert handler and incoming
DELETE LDAP client store cert handler. Compared to having two lambdas,
it reduces code redundancy and has slightly smaller compressed binary
size (~700B).
Tested:
Code move only, DELETE /redfish/v1/Managers/bmc/Truststore/Certificates
/<id> works exactly the same as before.
Change-Id: I93c07845e4be3c0304b3c3e8ff4249885c9ab908
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
|
|
We have a lot of DBus rules that bmcweb tries to abide by because of
history and maintainability reasons. These have never been well
documented, which causes problems at review time, with maintainers
having no place to point to.
This commit attempts to write down the guidelines we aim to hit.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Icee6f4740d24a69fb2209a7e2c8586bc018ec29a
|
|
For API endpoints, it is suggested to break out the entire handlers
into a function, and not rely on a lambda at all. This brings more
readability as it reduces indents.
Tested:
Code compiles, and Redfish Service Validator passed.
Change-Id: I5132149c00b6f553931dae562b83bc7aee678105
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
|
|
The script missed a #include. Add it.
Tested: Code compiles. Header change only.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ib38a46d8e97e4aadb596b4ff68795cea06e62fde
|
|
Based on DSP8010_2022.2 and adds the schema of Fan and FanCollection.
Tested: built bmcweb successfully and validator passes
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Id1867a6f19d47d0fb1d686d650f7d936c33b5284
|
|
This property is used to provide suggestions on how to resolve the
situation that caused the log entry. Services can replace the resolution
defined in the message registry with a more specific resolution in a log
entry.
Tested:
curl command was run with a resolution property set in the d-bus object
curl -k -X GET https://$bmc:18080/redfish/v1/Systems/system/\
LogServices/EventLog/Entries
"Members": [
{
"@odata.id":
"/redfish/v1/Systems/system/LogServices/EventLog/Entries/1",
"@odata.type": "#LogEntry.v1_9_0.LogEntry",
"AdditionalDataURI":
"/redfish/v1/Systems/system/LogServices/EventLog/Entries/1/attachment",
"Created": "2022-08-05T18:44:34.201+00:00",
"EntryType": "Event",
"Id": "1",
"Message":
"xyz.openbmc_project.State.Error.CriticalServiceFailure",
"Modified": "2022-08-05T18:44:34.201+00:00",
"Name": "System Event Log Entry",
"Resolution": "1. Priority: High, Procedure: BMC0002\n",
"Resolved": false,
"Severity": "Critical"
},
...
]
Signed-off-by: Vijay Lobo <vijaylobo@gmail.com>
Change-Id: Ia28e97c17c1b9bd0e29b681727c3e36563ca7922
Signed-off-by: Shantappa Teekappanavar <shantappa.teekappanavar@ibm.com>
|
|
These files are almost two years old and obsolete.
1. build_x86.sh: this script made wrong assumption about dependency. I
don't believe it's really helpful. How to build is already covered in
DEVELOPING.md
2. docker scripts and docker files: I've tried it today. It doesn't
work. It throws many compilation errors. I don't believe maintaining
this project-specific Docker file is helpful since it is not tested
by CI and will probabaly be broken again as time goes by even if we
fix it today. Instead, just use the well-maintained unit test docker
image built by openbmc-build-script, which is tested by every CL
across the org.
Tested: deletion only. I didn't find any reference to these files.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Icaefb0129bc6fe8c91bd93aa2e1ec967e5ecfeb4
|
|
Run the script update_schemas.py by pointing it to 2022.2
An overview of 2022.2 release can be found at:
[1] https://www.dmtf.org/sites/default/files/Redfish_Release_2022.2_Overview.pdf
Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ic729af6848badd1c81121e61a22a7115e553358a
|
|
Update to an intermediate schema pack. This is not the newest, but is
an incremental commit to allow us to differentiate different versions of
the schema packs evolution.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I4e5905a3ed40ca41b095c39b4d29c074b6eaeb67
|
|
New versions of the DMTF schema pack seem to make this list parse in
less-than-ideal order. Previously, the schema pack zip file had an
order that was at least semi-alphabetical, but 2022.2 seems to cause
that to change.
This commit makes the update_schemas.py script explicitly alphabetize
the list. This changes the order of two keys that have common prefixes,
but leaves the rest of the order the same. Both are arguably correct.
This commit also exposes that this script seemed to have lots of
problems in its version number detection logic. To make all this work
properly, a fairly invasive change is required.
Tested: Running the script on 2021.4 produces the same result as
previously. See later commits for 2022.2 where result is now correct.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ia2365daee1d91de142652161bf752600f3109115
|
|
Now it supports updating individual registry. Run parse_registries.py to
see all the options. This speeds up development of the script itself:
e.g., when developing privilege related generator, we don't want to
regenerate other headers every time during development.
```
usage: parse_registries.py [-h] [--registries REGISTRIES]
options:
-h, --help show this help message and exit
--registries REGISTRIES
Comma delimited list of registries to update
```
```
[hi on] nanzhou@nanzhou:~/Desktop/bmcweb$ time scripts/parse_registries.py
real 0m1.493s
user 0m0.401s
sys 0m0.046s
[hi on] nanzhou@nanzhou:~/Desktop/bmcweb$ time scripts/parse_registries.py --registries privilege
real 0m0.667s
user 0m0.213s
sys 0m0.030s
```
This saves 50% of the time. Though the absolute time to generate a full
list if small.
By default, it generates all the registries.
Tested: tested the script, it can update headers correctly.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: If13748a605a462f5dc7d83bad52360942b7dc6b7
|
|
clang-tidy-15 is raising the following warning, which it automatically
fixed:
```
../include/sessions.hpp:262:38: error: unnecessary temporary object created while calling emplace [modernize-use-emplace,-warnings-as-errors]
auto it = authTokens.emplace(std::make_pair(sessionToken, session));
^~~~~~~~~~~~~~~ ~
```
Apply automatically generated fix.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I425efdcba4bf08b03d64f8fb913eab956f5a198d
|
|
EntityManager moves its ObjectManager in commit [1], this patch is to
change accordingly. Please see [1] for why we made that change.
[1] https://gerrit.openbmc.org/c/openbmc/entity-manager/+/57279
Tested: code compiles.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Idf5657463d54022f53d12e860483d06b5c5c7ccd
|
|
This 10 second timeout is for the write, untar, inotify fire, and
creation of a software D-Bus object.
IBM has large images for its p10bmc, 125M and growing. We have seen this
take longer than 10 seconds on a AST2600. Bump this timeout to 25
seconds.
Most of the 10 seconds seems to be the untar.
This default 10 seconds is only used for the http upload path. TFTP
already bumps this timeout to 600 seconds.
[1] https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/update_service.hpp#L488
Could have instead added the 25 seconds to the
monitorForSoftwareAvailable call but figured having the default be 25
is reasonable.
[1] https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/update_service.hpp#L530
On a fail:
```
Sep 07 12:15:01 p10bmc phosphor-version-software-manager[752]: Untaring /tmp/images/69fe6e22-2bd0-42c4-be69-7f388debc6d1 to /tmp/images/imageHaTO5K
Sep 07 12:15:08 p10bmc bmcweb[2299]: (2022-09-07 12:15:08) [ERROR "update_service.hpp":392] Timed out waiting for firmware object being created
Sep 07 12:15:08 p10bmc bmcweb[2299]: (2022-09-07 12:15:08) [ERROR "update_service.hpp":394] FW image may has already been uploaded to server
Sep 07 12:15:08 p10bmc bmcweb[2299]: (2022-09-07 12:15:08) [CRITICAL "error_messages.cpp":233] Internal Error ../git/redfish-core/include/../lib/update_service.hpp(403:49) `redfish::monitorForSoftwareAvailable(const std::shared_ptr<bmcweb::AsyncResp>&, const crow::Request&, const string&, int)::<lambda(const boost::system::error_code&)>`:
```
Tested: On a BMC hitting this, saw the Internal Error on upload without
this change. With this change, the update now works.
Change-Id: I47940f074ac42ceb59011411b79679ff4c8360d6
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
This commit enhances the redfish API to retrieve userGroups information
for each user account.
"Redfish" is always enabled in each user role. That's why it was
hardcoded into JSON response data in the old redfish API, where now it
gets retrieved using dbus interface xyz.openbmc_project.User.Attributes.
UserGroups.
UserGroups retrieve data are "redfish", "ssh", "web", and "ipmi", where
redfish DMTF Schema has predefined enum type as described below.
"AccountTypes": {
"enum":["Redfish", "SNMP", "OEM", "HostConsole", "ManagerConsole",
"IPMI", "KVMIP", "VirtualMedia", "WebUI"]
}
Here UserGroups ssh is mapped with two AccountTypes "HostConsole",
"ManagerConsole".
- Redfish ManagerConsole == SSH to port 22 == Phosphor User manager
Phosphor “ssh” privilege
- Redfish HostConsole == SSH to port 2200 (host console), Which
OpenBMC implements using the Phosphor User manager Phosphor “ssh”
privilege.
The 'web' group does not control access to the web interface, and
doesn't appear to do anything. The 'redfish' in the UserGroups is
mapped to both Redfish and WebUI AccountTypes even when there is
no 'web' group in the UserGroups.
Test:
Pass Redfish Service Validator
$ curl -k -X GET
https://$bmc@r5:18080/redfish/v1/AccountService/Accounts/webuser
{
...
"AccountTypes": [
"Redfish",
"WebUI"
],
...
Signed-off-by: Abhishek Patel <Abhishek.Patel@ibm.com>
Change-Id: Iaa9b6c07b3d26e8994be28a50c22437e0bc9bc8f
Signed-off-by: Shantappa Teekappanavar <shantappa.teekappanavar@ibm.com>
|
|
https://black.readthedocs.io/en/stable/
Is a formatter that takes a more opinionated stance on pep8 compliance
than others, and as such gives us more consistent python code, even if
that's not currently enforced by ci. In addition, it allows patches to
automate their pep8 compliance similar to how we've done clang-format
for c++. We've done this transform other places throughout the codebase
and gotten a decent result, so duplicate it in bmcweb..
Run the black tool on update_schemas.py.
Tested: Reran update_schemas.py, and generated output is identical
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I83f47025ac61d0afd5df87ddb33f84269160191c
|
|
An HTTP header of Accepts: */* throws a big wrench into our
implementation for a couple reasons. First, because it's the default in
a lot of commonly-used libraries, and second, because clients use it
when they certainly don't mean what the specification says it should
mean "ie, I accept ANY type".
This commit tries to address some of that, by making an explicit option
for content-type="ANY" and pushes it to the individual callers to handle
explicitly as if it were yet another type. In most protocols, there's a
"most common" representation, so protocols are free to use that, or to
explicitly handle it, and require that the user be explicit.
Tested:
Redfish Protocol Validator no longer locks up. (TBD, getting bugs filed
with protocol validator for this missing Accepts header).
For ServiceRoot
GET /redfish/v1 Accepts: application/json - returns json
GET /redfish/v1 Accepts: */* - returns json
GET /redfish/v1 Accepts: text/html - returns html
GET /redfish/v1 no-accepts header - returns json
Redfish-service-validator passes.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Iae6711ae587115d3e159a48a6fc46a903ed6c403
|
|
The Dimm response has some missing fields i.e. Manufacturer and
FirmwareRevision, due to some properties not being unpacked. This
commit fixes that issue.
Tested:
Redfish validator passed
Dimm Response before fix shows missing Manufacturer and
FirmwareRevision fields
```
wget -qO- http://localhost:80/redfish/v1/Systems/system/Memory/dimm0
"@odata.id": "/redfish/v1/Systems/system/Memory/dimm0",
"@odata.type": "#Memory.v1_11_0.Memory",
"AllowedSpeedsMHz": [],
"BaseModuleType": "...",
"BusWidthBits": ...,
"CapacityMiB": .....,
"DataWidthBits": ..,
"ErrorCorrection": ".....",
<<<======= Missing FirmwareRevision field
"Id": "dimm0",
"Links": {
"Chassis": {
"@odata.id": "...."
}
},
"Location": {
"PartLocation": {
"LocationType": "Slot",
"ServiceLabel": "DIMM6"
}
},
<<<<==== Missing Manufacturer field
"MemoryDeviceType": "...",
"MemoryType": "....",
"Model": "",
"Name": "DIMM Slot",
"OperatingSpeedMhz": ....,
"PartNumber": "......",
"RankCount": ....,
"SerialNumber": "....",
"SparePartNumber": "..",
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
}
}
```
Dimm Response after fix shows Manufacturer and
FirmwareRevision fields present
```
wget -qO- http://localhost:80/redfish/v1/Systems/system/Memory/dimm0
{
"@odata.id": "/redfish/v1/Systems/system/Memory/dimm0",
"@odata.type": "#Memory.v1_11_0.Memory",
"AllowedSpeedsMHz": [],
"BaseModuleType": "....",
"BusWidthBits": ...,
"CapacityMiB": ....,
"DataWidthBits": ...,
"ErrorCorrection": "...",
"FirmwareRevision": "...",
"Id": "dimm0",
"Links": {
"Chassis": {
"@odata.id": "...."
}
},
"Location": {
"PartLocation": {
"LocationType": "Slot",
"ServiceLabel": "DIMM6"
}
},
"Manufacturer": "....",
"MemoryDeviceType": "...",
"MemoryType": "...",
"Model": "",
"Name": "DIMM Slot",
"OperatingSpeedMhz": ...,
"PartNumber": "...",
"RankCount": ...,
"SerialNumber": ".....",
"SparePartNumber": "...",
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
}
}
```
Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
Change-Id: I4de83a5038fe77e19a1b8b16e479348677fb30c1
|
|
Like other C++ projects, unit tests normally are in a separate repo and
respect the folder structure of the file under test.
This commit deleted all "ut" folder and move tests to a "test" folder.
The test folder also has similar structure as the main folder.
This commit also made neccessary include changes to make codes compile.
Unused tests are untouched.
Tested: unit test passed.
Reference:
[1] https://github.com/grpc/grpc/tree/master/test
[2] https://github.com/boostorg/core/tree/414dfb466878af427d33b36e6ccf84d21c0e081b/test
[3] Many other OpenBMC repos: https://github.com/openbmc/entity-manager/tree/master/test
[4] https://stackoverflow.com/questions/2360734/whats-a-good-directory-structure-for-larger-c-projects-using-makefile
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I4521c7ef5fa03c47cca5c146d322bbb51365ee96
|
|
This patchset transitions System dump route handlers to the new style
of calling common dump handlers via std::bind_front() instead of
defining a lambda. BMC dump and FaultLog dump were previously
transitioned to the new style (see "LogService: Add support for Fault
Log" at https://gerrit.openbmc.org/c/openbmc/bmcweb/+/53175).
Note that System dump wasn't using a common dump handler for outputting
its LogService info (/redfish/v1/Systems/system/LogServices/Dump/)
before, so calling the common handler here is new.
No expected client impact.
Tested:
Get System dump LogService info:
curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Systems/system/LogServices/Dump/
(Diffed the ouput before and after applying this patchset and confirmed
they were equivalent except for the "DateTime", as expected. Also added
unit tests for getting dump LogService info.)
Create System dump entry. (Existing code for creating an entry via the
Redfish LogService action CollectDiagnosticData isn't currently working
for System dump, so instead directly call the corresponding D-Bus
method by running the following from the BMC console):
busctl call xyz.openbmc_project.Dump.Manager /xyz/openbmc_project/dump/system xyz.openbmc_project.Dump.Create CreateDump a{sv} 0
Get Entry:
curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Systems/system/LogServices/Dump/Entries/1
Get Entry Collection:
curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Systems/system/LogServices/Dump/Entries
Delete Entry:
curl -k -H "X-Auth-Token: $token" -X DELETE http://${bmc}/redfish/v1/Systems/system/LogServices/Dump/Entries/1
Clear Log:
curl -k -H "X-Auth-Token: $token" -X POST http://${bmc}/redfish/v1/Systems/system/LogServices/Dump/Actions/LogService.ClearLog
Redfish Service Validator succeeded on the following URI tree:
/redfish/v1/Systems/system/LogServices/Dump
Signed-off-by: Claire Weinan <cweinan@google.com>
Change-Id: I5d66da17794c29672be8713481018bf3ce397ddf
|
|
Made the auto-generated headers and the openbmc registry include what
they use. Also alligned the include style.
Tested: code compiles.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I6577d5e12bc02da3bd7bf5780f89a4860b314e19
|
|
This patch reused similar patterns in |REGISTRY_HEADER| so that the
python code is more readable. It also moved the clang-format off macro
and warning a bit in so they are all consistent with each other.
Tested: code compiles.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: If18de0d9f89088f9b5732613ecf59520650bb11a
|
|
The existing code doesn't propogate errors of subqueries correctly.
This commit corrects the behavior, so that the final response gets all
error message of subqueries and the "highest priority" HTTP code.
DMTF doesn't specify how expand queries handle error codes, since using
subqueries is an implementation choice that we made in this project.
What we did here follows existing behavior of this project, and follows
the error message section of the Redfish spec;
[1] https://redfish.dmtf.org/schemas/DSP0266_1.15.1.html#error-responses
As for now, this commit uses the worst HTTP code among all the error
code. See query_param.hpp, function |propogateErrorCode| for detailed
order of the errror codes.
Tested:
1. this is difficult to test, but I hijacked the code so it returns
errors in TaskServices, then I verified that "/redfish/v1?$expand=."
correctly returns 500 and the gets the error message set.
2. unit test so that when there are multiple errors, the final response
gets a generate error message.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I0c1ebdd9015f389801db9150d687027485f1203c
|
|
1. added bmcweb_persistent_data.json
2. removed Pycharm and Intellij related ignores since they are all
commented and unused. If needed, can be added in the future. I don't
expect people use people use Gradle and Maven in this C++ project.
Tested: bmcweb_persistent_data.json is ignored in git. CLion and
Pycharm settings are ignored.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I58212588beda314ca7401065e083dd1654158da7
|
|
We don't want to aggregate JsonSchemas as-is since it can introduce
problems related to inconsistent versions between the aggregating and
satellite BMCs. For now we will just assume that the aggregating BMC
will match all satellite BMCs in terms of schemas and versions.
There was also an edge case where we are not adding prefixes to "Uri"
keys. These are used by Registries resources. Now we make a case-
insensitive check to see if a key ends with "uri" in order to
determine if we need to add the prefix to the resource ID.
Tested:
Requests to /redfish/v1/JsonSchemas only show schemas on the
aggregating BMC.
Responses from /redfish/v1/Registries/<id> now contain the
aggregation prefix in the value associated with the "Uri" key.
~# curl localhost/redfish/v1/Registries/5B247A_TaskEvent
{
...
"Location": [
{
...
"Uri": "/redfish/v1/Registries/5B247A_TaskEvent/TaskEvent"
}
],
...
}
Signed-off-by: Carson Labrado <clabrado@google.com>
Change-Id: I935785740c05ad0ac3e8c682a72ae1d1419054a8
|
|
It was found that as part of
c1d019a6056a2a0ef50e577b3139ab5a8dc49355 Sensor optimization
We missed updating the odata.id for the expand case. This wasn't really
found because most clients either use expand, or they don't, and
depending on which path you take, both paths are valid. With that said,
we should be following the spec here, and returning the same result
regardless of whether we're being processed as expand or not.
This patchset is a little rough, and probably should be iterated on.
TODO (at a later date). Try to get a tool that can detect these
failures.
Tested: Tested by @Carson to resolve the regression.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ieed7796895a3c5937fd901d5afa7dd4ea0693099
|
|
EffectiveFamily, EffectiveModel, MicrocodeInfo, Id, and SparePartNumber
all have default values specified in the OpenBMC DBus data model. Do
not populate these attributes as outlined in DBUS_USAGE.md.
Tested: Compiled. bmcweb does not crash at startup.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I8bfb7a8fef28d2ab6a7d77fb809c0b3e51e368f8
|