commit | de167a6f30c0f32683480e06c6e81cfc9d4eb37b | [log] [tgz] |
---|---|---|
author | Nan Zhou <nanzhoumails@gmail.com> | Wed Jun 01 04:47:45 2022 +0000 |
committer | Nan Zhou <nanzhoumails@gmail.com> | Wed Jun 01 19:03:31 2022 +0000 |
tree | 37dc92f208f41951691d86afc0db1ab9c39fce7d | |
parent | e6bd846d38bf7bb565b3f6a9aa8236543feb59f4 [diff] |
SensorCollection: use inline functions+bind_front This commit changes the `/redfish/v1/Chassis/<str>/Sensors/` route to take std::bind_front instead of lambdas. We can clearly see the indent levels decrease. It increases the readability. Tested: 1. trivial change; code compiles. 2. tested on my local mock environment; URL:/redfish/v1/Chassis/fake_chassis/Sensors/ Response: { "@odata.id": "/redfish/v1/Chassis/fake_chassis/Sensors", "@odata.type": "#SensorCollection.SensorCollection", "Description": "Collection of Sensors for this Chassis", "Members": [ { "@odata.id": "/redfish/v1/Chassis/fake_chassis/Sensors/sensor0" }, { "@odata.id": "/redfish/v1/Chassis/fake_chassis/Sensors/sensor1" }, { "@odata.id": "/redfish/v1/Chassis/fake_chassis/Sensors/sensor5" }, { "@odata.id": "/redfish/v1/Chassis/fake_chassis/Sensors/sensor6" } ], "Members@odata.count": 4, "Name": "Sensors" } 3. Service Validator Passes *** /redfish/v1/Chassis/fake_chassis/Sensors Type (SensorCollection.SensorCollection), GET SUCCESS (time: 0:00:00.002345) Attempt 1 of /redfish/v1/Chassis/fake_chassis/Sensors/sensor0 Response Time for GET to /redfish/v1/Chassis/fake_chassis/Sensors/sensor0: 0.006815780187025666 seconds. Attempt 1 of /redfish/v1/Chassis/fake_chassis/Sensors/sensor1 Response Time for GET to /redfish/v1/Chassis/fake_chassis/Sensors/sensor1: 0.004200570052489638 seconds. Attempt 1 of /redfish/v1/Chassis/fake_chassis/Sensors/sensor5 Response Time for GET to /redfish/v1/Chassis/fake_chassis/Sensors/sensor5: 0.004602659028023481 seconds. Attempt 1 of /redfish/v1/Chassis/fake_chassis/Sensors/sensor6 Response Time for GET to /redfish/v1/Chassis/fake_chassis/Sensors/sensor6: 0.00432420102879405 seconds. PASS Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Ibdebd9b5427db5b42d5047367ae8548fa981ddea
This component attempts to be a "do everything" embedded webserver for openbmc.
At this time, the webserver implements a few interfaces:
BMCWeb is configured by setting -D
flags that correspond to options in bmcweb/meson_options.txt
and then compiling. For example, meson <builddir> -Dkvm=disabled ...
followed by ninja
in build directory. The option names become C++ preprocessor symbols that control which code is compiled into the program.
meson builddir ninja -C builddir
meson builddir -Dbuildtype=minsize -Db_lto=true -Dtests=disabled ninja -C buildir
If any of the dependencies are not found on the host system during configuration, meson automatically gets them via its wrap dependencies mentioned in bmcweb/subprojects
.
meson builddir -Dwrap_mode=nofallback ninja -C builddir
meson builddir -Dbuildtype=debug ninja -C builddir
meson builddir -Db_coverage=true -Dtests=enabled ninja -C builddir test ninja -C builddir coverage
When BMCWeb starts running, it reads persistent configuration data (such as UUID and session data) from a local file. If this is not usable, it generates a new configuration.
When BMCWeb SSL support is enabled and a usable certificate is not found, it will generate a self-sign a certificate before launching the server. The keys are generated by the secp384r1
algorithm. The certificate
C=US, O=OpenBMC, CN=testhost
,SHA-256
algorithm.