Age | Commit message (Collapse) | Author | Files | Lines |
|
Since the GetSubTreePaths method has been implemented in dbus_utility
and this commit is to integrate all the places where the
GetSubTreePaths method is called, and use the method in dbus_utility
uniformly.
Requires https://gerrit.openbmc.org/c/openbmc/sdbusplus/+/60020 to
build.
Tested: Redfish Validator Passed
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ie4140d4484a7e4f4b943013f4371ffd2d44a22e9
|
|
Make validateParams use of actionParams (InsertMediaActionParams
structure) instead of fields one by one.
This will make possible to remove reference to crow::Response in lambda
containing vaildateParams structure.
Tested:
none, code change
Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Change-Id: I0f2ac76f6f7e578cb29527cd1e8f1d8ba9e94960
|
|
If you look at an OpenBMC build, every source file is compiled for every
source unit. This is pretty wasteful, but meson documents how to reuse
object files between link units. This has a couple benefits:
- Source files are only compiled once
- There are less likely to be unit-test specific binary differences (if,
for example, the unit tests used different compiler flags).
- Errors in a source file only appear once in the output, instead of 10
times.
On my 36 core Xeon, a normal build went from 2m38s down to 2m34s, which
is quite underwhelming, and less than you'd expect from a change this
large, but it turns out that if you have more parallelism than you have
compile units, building things twice doesn't appear to matter much.
With that said, if I simulate a smaller machine, using -J 8, the build
time with this commit remains at 2m38s, whereas the commit previous to
this takes 4m48s, so clearly there's some benefit here.
This regression appears to have been caused by
0ad63df8aa8ab60f74395794d8ffce64c82ee031 which caused us to build
multiple executables (one per unit test). This fixes the regression.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ib77e8679b69e0f2242f65c20b129f2fb8e370edb
|
|
In aggregation we need to account for when a satellite BMC supports a
resource collection that the aggregating BMC does not. We need to
add links in responses from upstream resources to indicate that these
satellite only resources exist. These top level collections do not
always have the location format of /redfish/v1/<collection_id>. We
determine all of those from the schema rather than hardcoding a few
choice exceptions that do not fit that format such as
/redfish/v1/UpdateService/FirmwareInventory.
This patch is the first step in accomplishing this. We parse all
xml schema files in order to determine what are the top level
collection URIs. For URIs that are upstream from top level collections
we'll be able to derive what URIs could appear in the response which
are also on the same path to a top level collection.
The xml files for resources that aren't currently supported by bmcweb
are ignored when creating the schema index and later deleted once the
above parsing completes.
Later patches will use this information to make sure that we are
properly handling all schema defined top level collections.
Tested:
Compiles with aggregation enabled
Signed-off-by: Carson Labrado <clabrado@google.com>
Change-Id: Icff825f4e4e9d84c96254561350f82839abdc074
|
|
Add ServiceProviderNotify property that can be used to indicate that
this event log should be notified to the service provider, if that is
implemented on the system.
ServiceProviderNotify is an enum.
Supported options are - "NotSupported", "Notify" and "Inhibit".
The dbus interface and all implementations have been moved to an enum
with the default value of NotSupported. When the value is NotSupported,
this property is left off Redfish.
For more details refer to
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/47683
Tested: Manually tested on the system, Run Redfish validator. Found no
error.
'''
curl -k
https://$bmc/redfish/v1/Systems/system/LogServices/EventLog/Entries
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries",
"@odata.type": "#LogEntryCollection.LogEntryCollection",
"Description": "Collection of System Event Log 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": "1970-01-01T00:04:20.865+00:00",
"EntryType": "Event",
"Id": "1",
"Message": "xyz.openbmc_project.Software.Image.Error.ImageFailure",
"Modified": "1970-01-01T00:04:20.865+00:00",
"Name": "System Event Log Entry",
"Resolved": false,
"Severity": "Critical"
},
....
....
],
"Members@odata.count": 49,
"Name": "System Event Log Entries"
}
'''
busctl set-property xyz.openbmc_project.Logging
/xyz/openbmc_project/logging/entry/99
xyz.openbmc_project.Logging.Entry ServiceProviderNotify s
xyz.openbmc_project.Logging.Entry.Notify.Notify
busctl get-property xyz.openbmc_project.Logging
/xyz/openbmc_project/logging/entry/99
xyz.openbmc_project.Logging.Entry ServiceProviderNotify
Entry ServiceProviderNotify
Signed-off-by: Abhishek Patel <Abhishek.Patel@ibm.com>
Change-Id: I774bfec157481ccc9b4966bf5e8cc8f7d9a06fd0
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
The current LDAP group map on /redfish/v1/AccountService is incorrect
and is creating a bad JSON response. instead of an array of objects, is
creating a nested array of objects. The problem is visible on the
website adding a new LDAP group map, it will show 2 empty rows instead
of one with the correct data.
The current JSON data is:
"RemoteRoleMapping": [
[
{
"RemoteGroup": "groupname"
}
],
[
{
"LocalRole": "Operator"
}
]
],
The correct JSON is:
"RemoteRoleMapping": [
{
"LocalRole": "Operator",
"RemoteGroup": "groupname"
}
],
The tests redfish/account_service/test_ldap_configuration crashed
BMCWEB generates around 9 core dump files.
Tested:
redfish/account_service/test_ldap_configuration passed the tests
Adding a new LDAP group map on the website, showing the correct data,
Change-Id: I5de7db372ceff1cc596da2b04f5fd730415f7216
Signed-off-by: Jorge Cisneros <jcisneros3@lenovo.com>
|
|
This TODO was implemented long ago by DMTF. Remove the comment.
Tested: Comment only.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I4b0fc7c6fefa316d1cf824711d542f17a6f1a682
|
|
Clang warns on this enum no matter what we do. Rather than adding all
27 entries of the boost::beast::verb to this, lets just ignore the
warning.
Tested: Code compiles on clang without warnings
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Iba5809d8f855abe7f040d81d6052eb385be8f5a1
|
|
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I710b68218f5df32088a0ce90250763cd765b054a
|
|
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
|
|
c1d019a6056a2a0ef50e577b3139ab5a8dc49355 Sensor Optimization
Recently changed the way Ids were calculated in the sensor subsystem.
Unfortunately, it wasn't clear to the author that this would effect the
sensor override system, which relies on matching up a member ID with a
dbus path, and was broken by this change.
This commit breaks out the code to calculate the type and name from a
given URI segment into a helper method.
Tested: Inspection only. Very few systems support this feature. Code appears more correct than previously, which is known broken, so the lack of testing here seems reasonable.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I9aa8099a947a36b5ce914bc07ae60f1ebf0d209b
|
|
This likely has no performance implications in practice, but getting a
clean cppcheck run is good. Suggestion was implemented per cppcheck.
Tested: This is in the deprecated rest API. Not sure how much testing
we need to do.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I1658697730ac07c7cdefd2b73c80ee65fba4dedb
|
|
Per cpp core guidelines, this type should be const.
Tested: Code compiles. Trivial const change. cppcheck no longer warns
on this line.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I04aae41701ba1203ff4a68f0b06df2459ee7bb2f
|
|
Even for schemas we ignore, we should still generate the enums for them,
just to keep changes like [1] smaller.
Tested: Code compiles. No functional binary change.
[1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/55215
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I78adf1204a319bc14900152f94161afea21f2e07
|
|
CBOR is a more efficient way to represent json, and something that, as
you can see from this patch, is relatively trivial to implement in our
current nlohmann json handlers. This allows users that specify an
accepts header of "application/cbor" to request the BMC produce a cbor
response.
This feature adds 1520 bytes (1.48KB) to the binary size of bmcweb.
For ServiceRoot
GET /redfish/v1 Accepts: application/json - returns json
GET /redfish/v1 Accepts: application/cbor - returns cbor
GET /redfish/v1 Accepts: */* - returns json
GET /redfish/v1 Accepts: text/html - returns html
GET /redfish/v1 no-accepts header - returns json
For service root, CBOR encoding drops the payload size from 1520 bytes
on my system, to 1021 byes, which is a significant improvement in the
number of bytes we need to compress.
Redfish-service-validator passes.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I847e678cf79dfd7d55e6d3b26960c419e47063af
|
|
Despite introduction of a new enum class containing method verbs,
some functions were still using the one from Boost. This had caused
erratic behaviour when trying to create a websocket
(e.g. /nbd/<str>), because enum value of old type was compared to the
one of new type. This change fixes that.
Tested:
Verified that websockets are now created without errors.
Change-Id: I52c874de9b02463618143d3b031f5c795dd42ad8
Signed-off-by: Michal Orzel <michalx.orzel@intel.com>
Signed-off-by: Snehalatha Venkatesh <snehalathax.v@intel.com>
|
|
This diff looks bad. The only thing that changed functionally is
changing:
password(std::move(password)), roleId(std::move(roleId))
in the labmda capture to
password, roldId
because password and roleid are getting used later. Unfortunately,
clang decides to rearrange this whole lambda.
Tested: Passes cppcheck.
'''
curl -vvvv --insecure --user root:0penBmc -X PATCH -d '{"Password": "0penBmc1"}' https://192.168.7.2/redfish/v1/AccountService/Accounts/root
'''
Succeeds at patching the root password.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I97b10a40d0b271b211bf4e6c09888d3cd568a3d0
|
|
Clang correctly notes that, because the segments() object is an rvalue,
and is destroyed after the std::string_view is used on the next line,
this is technically undefined behavior. Make these use owning
std::strings instead of std::string_view to avoid the lifetime problem.
Tested:
Enabled aggregation without including a satellite config. Sending a
GET request to /redfish/v1/Chassis/5B247A_Test returned a 404 due to
hitting one of the sections of changed code. The other section is not
currently reachable, but uses the same type of change.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I1b2b2ad444e2718c0cb167f4506ea1d0915b3a5b
Signed-off-by: Carson Labrado <clabrado@google.com>
|
|
cppcheck comments that this can be const. Unfortunately, this looks
like a false positive, where cppcheck cannot see through the
std::replace template.
Tested: This is in the set pid loop handler that doesn't have any good
tests with it. Code compiles, and only inspection is possible at this
time.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I21eaadcc37b2f3993e63b39d471cbf118d88119a
|
|
cppcheck warns that this is a copy, so fix it.
Tested: cppcheck no longer warns on this line. Unfortunately, virtual
media does not have a backend, so this is dead code. No way to test at
this point.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I1e98ca63ee346ad683844e5637a173f64286102a
|
|
If given a bad URI, e.g. "https://$bmc/?a=id;" return http bad request
(400) like we do other places, e.g. a few lines below.
Certain scanners expect to see bad request when crawling and probing for
vulnerabilities and using not valid URIs. Just dropping the connection
causes errors with these scanners. They think connection problem or
worse the server was taken down.
Tested: Tested downstream https://$bmc/?a=id; returns bad request.
Change-Id: I99a52d4c5e7f366046c5de1cf22c4db95ab39e13
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
cppcheck correctly notes that a lot of our variables can be declared at
more specific scopes, and in every case, it seems to be correct.
Tested: Redfish service validator passes. Unit test coverage on others.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ia4414410d0e8f74a3bd40fdc0e0232450d1a6416
|
|
The expected hash value is incorrect resulting in meson failing when
downloading boost 1.81.0. Updates the expcted value to be the actual
hash value.
Tested:
Boost 1.81.0 is downloaded by meson when it does not exist on the
local machine. All tests pass.
Run-time dependency Boost found: NO (tried system)
Downloading boost source from https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.bz2
Download size: 118797750
Downloading: ..........
Executing subproject boost
Signed-off-by: Carson Labrado <clabrado@google.com>
Change-Id: I36f26ec883bd08922fda3e5dc3a272bc4ef496a6
|
|
GET function on the config files path now lists all the contents
including sub directories. Creation of subdirectories under config files
is not allowed from the UI, however its possible to create manually.
If we try to access a subfolder with GET command, bmcweb handle the
folder name as file name and crashes trying to open.
Hence we limit the use of subfolder under config files by not listing
them in the response of the GET command. And returning an error if the
user is trying to run a GET on subfolder created manually.
Tested:
Create subfolder under configfiles path
curl -k -H "X-Auth-Token: $bmc_token" -X GET -D patch1.txt
https://${bmc}/ibm/v1/Host/ConfigFiles
Without fix:
Lists all contents of the ConfigFiles folder
With Fix:
lists only the regular files
Run the command with subfolder
curl -k -H "X-Auth-Token: $bmc_token" -X GET -D patch1.txt
https://${bmc}/ibm/v1/Host/ConfigFiles/testfolder
Without fix:
bmcweb crashes
With the fix:
“Description”: “Resource Not Found”
Change-Id: I71ef5523c6bc425e880a28a6e1175c677ef0a102
Signed-off-by: Jishnu C M <jishnunambiarcm@duck.com>
|
|
Due to the path of the dhcp has been changed from
`/xyz/openbmc_project/network/config/dhcp` to
`/xyz/openbmc_project/network/dhcp`.
Cause cannot get/set the dhcp configuration.
See:
https: //gerrit.openbmc.org/c/openbmc/phosphor-networkd/+/58725
Tested:
```
Without internal error.
~# curl -k -X PATCH -H "X-Auth-Token: $token" https://$bmc/redfish/v1/Managers/bmc/EthernetInterfaces/eth1 \
--data-raw '{"DHCPv4":{"DHCPEnabled":false}}'
{
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The request completed successfully.",
"MessageArgs": [],
"MessageId": "Base.1.13.0.Success",
"MessageSeverity": "OK",
"Resolution": "None"
}
]
}
```
Signed-off-by: Jian Zhang <zhangjian.3032@bytedance.com>
Change-Id: Ib455cbe69c47b3075321a8225a5a69bff136dbe8
|
|
The new boost URL now interops properly with std::string_view, which is
great, and cleans up a bunch of mediocre code to convert one to another.
It has also been pulled into boost-proper, so we no longer need a
boost-url dependency that's separate.
Unfortunately, boost url makes these improvements by changing
boost::string_view for boost::urls::const_string, which causes us to
have some compile errors on the missing type.
The bulk of these changes fall into a couple categories, and have to be
executed in one commit.
string() is replaced with buffer() on the url and url_view types
boost::string_view is replaced by std::string_view for many times, in
many cases removing a temporary that we had in the code previously.
Tested: Code compiles with boost 1.81.0 beta.
Redfish service validator passes.
Pretty good unit test coverage for URL-specific use cases.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I8d3dc89b53d1cc390887fe53605d4867f75f76fd
|
|
While performing the firmware updates, task will be created for tracking
the background update progress and state. There are error associated
with that code currently.
Errors on TaskId's:
- Internal errors
"Messages": [
....
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The request failed due to an internal service error. The service is still operational.",
....
}
]
- Always task is in RUNNING state.
"PercentComplete": 0,
"TaskState": "Running",
Issue details:
- Percentage: The "Progress" property in D-Bus interface
"xyz.openbmc_project.Software.ActivationProgress" is of type
"uint8_t" but bmcweb is reading type as string and that is leading to
failure and invalid values.
- TaskState: TaskState is read from d-bus after recieving associated
signal but that is not updated properly and that caused the failure.
this commit corrects the same.
Tested:
After fix, task which is created for firmware update is showing correct
"PercentageComplete" and 'TaskState".
"PercentComplete": 100,
"TaskState": "Completed",
Signed-off-by: Gayathri Leburu <gayathri.leburu@intel.com>
Signed-off-by: moni kumar <monix.kumar@intel.com>
Signed-off-by: AppaRao Puli <apparao.puli@intel.com>
Change-Id: I0354cdecc9d9ddd47b017591402fd7b3149d12ca
|
|
black and isort are enabled in the openbmc-build-scripts on Python files
to have a consistent formatting. Re-run the formatter on the whole
repository.
Change-Id: I00a6615fdb2b47ffee38e4bf649dd644eb636844
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
Redfish, the final frontier. These are the voyages of bmcweb. Its
five-year mission: to explore strange new protocols, to seek out new
corner cases and new segmentation faults, to boldly go where no
web-server has gone before.
This commit marks a journey that has taken years, getting a fully
compliant, open source Redfish instance. While there is still quite a
few things to improve, Redfish Protocol Validator passing means that
bmcweb is capable of implementing all the "shall" statements in the
protocol standard that are being tested. A great thanks go out to all
the 173 unique contributors that got it to this point.
Tested: Documentation only.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I786d194c602e4a424f15ddea180da939535e48e9
|
|
Python packaging seems to have changed to be much more stringent about
what version strings is accepts. It's not clear why this was done, but
we need a fix to unbreak CI.
This commit adds more parsing code into the script to parse out version
numbers from the form of LogEntry.v1_2_3 to split them up into a custom
class, and sort manually. Despite dropping the dependency, this ends up
dropping a net 7 lines of code compared to using the library, so it
seems worth it, especially given the breaking API change.
One seemingly unrelated change was that we were adding schema folders to
the sort lists, which don't sort well because they have no version
numbers or extensions. This fixes to only add individual files to the
list of things to sort.
Tested:
Code no longer crashes.
Running update_schemas.py generates the same result (with one minor
same-prefix sort order change).
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I1a792ffb4ad7bc71637ab1aa0648a245949aeeee
|
|
A recent regression causes failures on Thermal and Power paths that have
to grab inventory items. This commit changes to search for the right
path.
Tested: Gunnar tested on a Witherspoon. No longer see Internal Errors.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I0f7468ecf948f3cbfecb20c9ad470dced370ad3a
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
Base on Sensor.v1_2_0.json[1], add the Accuracy property to sensors.
At present, the D-Bus interface[2] has been exposed in the
phosphor-hwmon repo[3], and this function will be synchronized to the
dbus-sensor repo in the future.
[1]http://redfish.dmtf.org/schemas/v1/Sensor.v1_2_0.json
[2]https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/53569
[3]https://gerrit.openbmc.org/c/openbmc/phosphor-hwmon/+/57839
Tested: built bmcweb successfully and validator passes
get Accuracy:
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/
Chassis/chassis/Sensors/temperature_inlet
{
"@odata.id": "/redfish/v1/Chassis/chassis/Sensors/temperature_inlet",
"@odata.type": "#Sensor.v1_2_0.Sensor",
"Accuracy": 5.0,
"Id": "Sensors_inlet",
"Name": "inlet",
...
}
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ie51356d810f63ba70c56ce702d6bbeb97e279530
|
|
Per [1], daemons implementing sensors are supposed to implement an
ObjectManager at /xyz/openbmc_project/sensors. Once this is made
consistent, there is no need for this complex code to search for an
ObjectManager instance, when we can simply look it up.
This commit deletes the ObjectManager search code, which saves a Dbus
call for any sensor read done within thermal or sensor schemas.
This does have the negative of requiring that ObjectMapper implements
its ObjectManager on "/". Considering there is only one implementation
of ObjectMapper, this seems reasonable to hardcode.
Tested:
Redfish Service Validator passes.
'''
curl --insecure --user root:0penBmc https://192.168.10.156/redfish/v1/Chassis/Tyan_S7106_Baseboard/Thermal
'''
returns the sensors on an S7106 platform.
[1] https://github.com/openbmc/phosphor-dbus-interfaces/blob/991b2b8bdbc950f2a85aebfc29d1b34ea3264686/yaml/xyz/openbmc_project/Sensor/Value.interface.yaml#L18
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I69071848c685c33320d920d9faec16e5a1b563ca
|
|
OpenBMC tends to have a significant problem in doing the appropriate
lookups from the schema files, and many bugs have been injected by users
picking a bad enum, or mistyping the casing of an enum value.
At the same time, nlohmann::json has recently added first class support
for enums, https://json.nlohmann.me/features/enum_conversion/
This commit attempts to build a set of redfish includes file with all
the available Redfish enums in an easy to use enum class. This makes it
very clear which enums are supported by the schemas we produce, and adds
very little to no extra boilerplate on the human-written code we
produced previously.
Note, in the generated enum class, because of our use of the clang-tidy
check for macros, the clang-tidy check needs an exception for these
macros that don't technically follow the coding standard. This seems
like a reasonable compromise, and in this case, given that nlohmann
doesn't support a non-macro version of this.
One question that arises is what this does to the binary size.... Under
the current compiler optimizations, and with the current best practices,
it leads to an overall increase in binary size of ~1200 bytes for the
enum machinery, then approximately 200 bytes for every call site we
switch over. We should decide if this nominal increase is reasonable.
Tested: Redfish protocol validator runs with same number of failures as
previously.
Redfish Service Validator passes (one unrelated qemu-specific exception)
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I7c7ee4db0823f7c57ecaa59620b280b53a46e2c1
|
|
There are a number of properties of Type "string (uri)" for which we
do not currently support adding prefixes. This patch adds support
for all existing URI properties which are missed by the existing
implementation.
This change will be needed by future patches which will expand
aggregation support to all top level collections defined by the
schema. Those collections that are not currently supported include
properties whose URIs should be fixed, but would be missed by the
existing implementation.
Tested:
New unit test passes.
URI properties are still handled correctly.
```shell
curl localhost/redfish/v1/Chassis/5B247A_<chassisID>
{
"@odata.id": "/redfish/v1/Chassis/5B247A_<chassisID>",
"@odata.type": "#Chassis.v1_16_0.Chassis",
"Actions": {
"#Chassis.Reset": {
"@Redfish.ActionInfo": "/redfish/v1/Chassis/5B247A_<chassisID>/ResetActionInfo",
"target": "/redfish/v1/Chassis/5B247A_<chassisID>/Actions/Chassis.Reset"
}
},
...
}
```
Signed-off-by: Carson Labrado <clabrado@google.com>
Change-Id: I3b3e06ee3191564d266598f7bc9f1641e6fcb333
|
|
openbmc-build-scripts by default uses git-ls-files and so does meson.
There is no reason to add untracked files into the .clang-ignore.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ie308bf5d8d18eadcfe8f4943b467f4f61a92f289
|
|
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I1402cbd84c916792ca2fc0ad0f34db661cbdfa72
|
|
Reformat the repository using the latest from openbmc-build-scripts.
Add the `static/redfish` directory to be ignored by prettier since
these files come from elsewhere and having the ability to do a direct
diff is handy.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I74464d6f97047b4888a591e0d8a4f5ca970ac69e
|
|
Currently getting single PostCode entry returns a LogEntryCollection
with the specified LogEntry in its Members. Since Redfish Service
Validator does not follow the links in LogServiceCollection[1], such
unexpected behavior passes the validator. This commit makes it return
the LogEntry itself (or 404 Not Found) when requesting it.
Fixes Github issue #236 (https://github.com/openbmc/bmcweb/issues/236)
[1] https://github.com/DMTF/Redfish-Service-Validator/issues/519
Tested:
* Confirmed getting a valid PostCode entry now returns a LogEntry, and
getting invalid entries like B0-1, B1-0, B1-999 or 123 (Not properly-
formatted ID) responds with 404 Not Found.
* Get PostCode log entries collection still returns LogEntryCollection
containing first 1000 PostCode entries by default.
* Redfish Service Validator passed.
Change-Id: Ice6b8742caea96ad3d436d57898202fe7362b150
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
|
|
If-Match is a header in the HTTP specification[1] designed for handling
atomic operations within a given HTTP tree. It allows a mechanism for
an implementation to explicitly declare "only take this action if the
resource has not been changed". While most things within the Redfish
tree don't require this level of interlocking, it continues to round out
our redfish support for the specific use cases that might require it.
Redfish specification 6.5 states:
If a service supports the return of the ETag header on a resource, the
service may respond with HTTP 428 status code if the If-Match or
If-None-Match header is missing from the PUT or PATCH request for the
same resource, as specified in RFC6585
This commit implements that behavior for all handlers to follow the
following flow.
If If-Match is present
Repeat the same request as a GET
Compare the ETag produced by the GET, to the one provided by If-Match
If they don't match, return 428
if they do match, re-run the query.
[1] https://www.rfc-editor.org/rfc/rfc2616#section-14.24
As a consequence, this requires declaring copy and move constructors
onto the Request object, so the request object can have its lifetime
extended through a request, which is very uncommon.
Tested:
Tests run on /redfish/v1/AccountService/Accounts/root
PATCH with correct If-Match returns 200 success
PATCH with an incorrect If-Match returns 419 precondition required
GET returns the resource as expected
Redfish service validator passes
Redfish protocol validator passes! ! ! ! !
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I530ab255259c32fe4402eb8e5104bd091925c77b
|
|
While implementing https://gerrit.openbmc.org/c/openbmc/bmcweb/+/57932,
there has been an issue where there is a circular dependency between
routing.hpp and privileges.hpp. This code move predates this change
to resolve it before implementing the heart of redfish authz.
Circular dependency will occur when we try to use the http verb
index variables in privilege.hpp. If this occurs routing.hpp
and privilege.hpp will co-depend on each other
and this code move prevents this from occuring.
Tested:
bitbake bmcweb
Code compiles (code move only)
Redfish Validator passed on next commit
Signed-off-by: Edward Lee <edwarddl@google.com>
Change-Id: I46551d9fe222e702d239ed3ea6d3d7e505d488c8
|
|
As is, the router designates routes for every possible boost verb, of
which there are 31. In bmcweb, we only make use of 6 of those verbs, so
that ends up being quite a bit of wasted space and cache non-locality.
This commit invents a new enum class for declaring a subset of boost
verbs that we support, and a mapping between bmcweb verbs and boost
verbs.
Then it walks through and updates the router to support converting one
to another.
Tested:
Unit Tested
Redfish Service Validator performed on future commit
Signed-off-by: Ed Tanous <edtanous@google.com>
Signed-off-by: Edward Lee <edwarddl@google.com>
Change-Id: I3c89e896c632a5d4134dbd08a30b313c12a60de6
|
|
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I6bcc6c72e1855c7de7c8b1e88cbab01e92b4070d
|
|
The NIC LinkStatus was being assigned a LinkUp or NoLink value
depending on whether the NIC is enabled.
Subsequent code unconditionally overwrites the LinkStatus.
The LinkStatus needs to take into account the NIC enabled state as
well as the link up/down state.
Tested:
Confirmed NIC enabled/link active resulted in LinkUp.
Confrimed NIC enabled/no-carrier resulted in LinkDown.
Connfimred NIC disable resulted in NoLink.
Change-Id: Iece3686cac9714e427b0e100f486a4ced334f7af
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
|
|
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
|
|
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
|
|
Only set createNewObject to true when corresponding interface not found
in the object.
Tested on Bletchley:
- Add new StepwiseController called SWTest
Body in JSON format
```
{
"Oem": {
"OpenBmc": {
"Fan": {
"StepwiseControllers": {
"SWTest": {
"Direction": "Floor",
"Inputs": [
"MB_U402_THERM_LOCAL"
],
"NegativeHysteresis": 1.0,
"PositiveHysteresis": 2.0,
"Steps": [
{
"Output": 0.0,
"Target": 48.0
},
{
"Output": 15.0,
"Target": 49.0
}
],
"Zones": [
{
"@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanZones/Zone0"
}
]
}
}
}
}
}
}
```
Checking object from dbus
```
root@bletchley:~# busctl introspect xyz.openbmc_project.EntityManager \
> /xyz/openbmc_project/inventory/system/chassis/Bletchley_Chassis/SWTest \
> xyz.openbmc_project.Configuration.Stepwise
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
.Delete method - - -
.Class property s "Floor" emits-change writable
.Inputs property as 1 "MB U402 THERM LOCAL" emits-change writable
.Name property s "SWTest" emits-change writable
.NegativeHysteresis property d 1 emits-change writable
.Output property ad 2 0 15 emits-change writable
.PositiveHysteresis property d 2 emits-change writable
.Reading property ad 2 48 49 emits-change writable
.Type property s "Stepwise" emits-change writable
.Zones property as 1 "Zone0" emits-change writable
```
- Patch SWTest properties
Body in JSON format
```
{
"Oem": {
"OpenBmc": {
"Fan": {
"StepwiseControllers": {
"SWTest": {
"NegativeHysteresis": 3.0,
"PositiveHysteresis": 4.0
}
}
}
}
}
}
```
Checking object from dbus
```
root@bletchley:~# busctl introspect xyz.openbmc_project.EntityManager \
> /xyz/openbmc_project/inventory/system/chassis/Bletchley_Chassis/SWTest \
> xyz.openbmc_project.Configuration.Stepwise
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
.Delete method - - -
.Class property s "Floor" emits-change writable
.Inputs property as 1 "MB U402 THERM LOCAL" emits-change writable
.Name property s "SWTest" emits-change writable
.NegativeHysteresis property d 3 emits-change writable
.Output property ad 2 0 15 emits-change writable
.PositiveHysteresis property d 4 emits-change writable
.Reading property ad 2 48 49 emits-change writable
.Type property s "Stepwise" emits-change writable
.Zones property as 1 "Zone0" emits-change writable
```
- Delete SWTest object
Body in JSON format
```
{
"Oem": {
"OpenBmc": {
"Fan": {
"StepwiseControllers": {
"SWTest": null
}
}
}
}
}
```
Object deleted from dbus
```
root@bletchley:~# busctl introspect xyz.openbmc_project.EntityManager \
> /xyz/openbmc_project/inventory/system/chassis/Bletchley_Chassis/SWTest \
> xyz.openbmc_project.Configuration.Stepwise
Failed to introspect object /xyz/openbmc_project/inventory/system/chassis/Bletchley_Chassis/SWTest of service xyz.openbmc_project.EntityManager: Unknown object '/xyz/openbmc_project/inventory/system/chassis/Bletchley_Chassis/SWTest'.
```
Signed-off-by: Potin Lai <potin.lai@quantatw.com>
Change-Id: I482e942ee3c76dca17af522765d8b3aa9dc8678b
|
|
Cable Length property value is NaN by default. The current
implementation ignores processing other remaining Cable properties
if the length is NaN. Per Ed's comment here we need to
ignore if length is NaN and continue to process remaining properties:
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/50265/4..7/redfish-core\
/lib/cable.hpp#b51
Testing:
1. Validator test not done, assumed it is OK since it is a minor change
in the code logic.
2. curl testing:
$ curl -k https://user:password@host:18080/redfish/v1/Cables/dp0_cable1
{
"@odata.id": "/redfish/v1/Cables/dp0_cable1",
"@odata.type": "#Cable.v1_0_0.Cable",
"CableType": "",
"Id": "dp0_cable1",
"Name": "Cable"
}
Signed-off-by: Shantappa Teekappanavar <shantappa.teekappanavar@ibm.com>
Change-Id: If73828484d91bbf2eee45a31973c825bab008ba4
|
|
The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* bus_t
* exception_t
* manager_t
* match_t
* message_t
* object_t
* slot_t
Change-Id: I4af62f309f4cd3bb51759fa18de2448235e557fe
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
GET /redfish/v1/Systems/system/PCIeDevices/<str>/PCIeFunctions/<str>
return resourceNotFound messages.
Test:
GET /redfish/v1/Systems/system/PCIeDevices/<str>/PCIeFunctions/<str>
return the expected information of PCIeDevices.
Signed-off-by: Tony Lee <tony.lee@quantatw.com>
Change-Id: I1587a74e77225939dec8030bba7fb04865e8051e
|