diff options
author | jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> | 2020-03-05 01:26:38 +0300 |
---|---|---|
committer | Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> | 2020-03-14 20:18:43 +0300 |
commit | 91e130a365a0d3b93357e6efa0a5be8a0b53c6d1 (patch) | |
tree | 781f03cfc4e45771972aeb9bfd80fbe9ff7380cd /redfish-core/lib/sensors.hpp | |
parent | 818ea7b8f06292eaaa82ba67ef21933f50d71192 (diff) | |
download | bmcweb-91e130a365a0d3b93357e6efa0a5be8a0b53c6d1.tar.xz |
Allow unrestricted sensor override through flag
Allow overriding sensor values without any restriction based on
BMCWEB_INSECURE_UNRESTRICTED_SENSOR_OVERRIDE flag
Tested:
1. Redfish validator - passed for this new change
2. Verified for BMCWEB_ENABLE_VALIDATION_UNSECURE_FEATURE is OFF and
BMCWEB_INSECURE_UNRESTRICTED_SENSOR_OVERRIDE is ON
Case 1:
1. Enable manufacturing mode by pressing power button while bmc booting
2. Patch sensor values from Redfish.
Redfish URI:
PATCH https://<BMC-IP>/redfish/v1/Chassis/WC_Baseboard/Thermal
Body:
{
"Temperatures": [
{
"MemberId": "SSB_Temp",
"ReadingCelsius":112
}
]
}
Response:
{
"@odata.id": "/redfish/v1/Chassis/WC_Baseboard/Thermal",
"@odata.type": "#Thermal.v1_4_0.Thermal",
"Fans": [],
"Id": "Thermal",
"Name": "Thermal",
"Temperatures": []
}
3. Sensor value Overridden successfully
Case 2: Verified for ValidationUnsecure mode.
Case 3: Tested without SpecialMode mode
1. Stop the specialmodemgr.service service
2. Patch sensor values from Redfish.
3. Sensor value Overridden successfully
Case 4:
1. Disable manufacturing mode
Command: ipmitool raw 0x30 0xB4 3 0
Response: //Success
2. Patch sensor values from Redfish.
3. Sensor value Overridden successfully
Signed-off-by: jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
Change-Id: I0557cc88d2aceebade4b78e4478e17feecb6e088
Diffstat (limited to 'redfish-core/lib/sensors.hpp')
-rw-r--r-- | redfish-core/lib/sensors.hpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp index 3caaeedec9..9061165297 100644 --- a/redfish-core/lib/sensors.hpp +++ b/redfish-core/lib/sensors.hpp @@ -2597,7 +2597,7 @@ bool findSensorNameUsingSensorPath( * * @param res response object * @param allCollections Collections extract from sensors' request patch info - * @param chassisSubNode Chassis Node for which the query has to happen + * @param chassisSubNode Chassis Node for which the query has to happen */ void setSensorsOverride( std::shared_ptr<SensorsAsyncResp> sensorAsyncResp, @@ -2774,17 +2774,17 @@ void checkAndDoSensorsOverride( messages::internalError(sensorAsyncResp->res); return; } - if (!resp.size()) - { - // Special mode manager doesn't exist, proceed with sensor - // override - setSensorsOverride(sensorAsyncResp, allCollections); - return; - } +#ifdef BMCWEB_INSECURE_UNRESTRICTED_SENSOR_OVERRIDE + // Proceed with sensor override + setSensorsOverride(sensorAsyncResp, allCollections); + return; +#endif if (resp.size() != 1) { - BMCWEB_LOG_DEBUG << "Queried object count mismatch. "; + BMCWEB_LOG_WARNING + << "Overriding sensor value is not allowed - Internal " + "error in querying SpecialMode property."; messages::internalError(sensorAsyncResp->res); return; } |