Trigger: make dbus properties writable
This change allows to modify 'Sensors', 'ReportNames' and 'Thresholds'
dbus properties of Trigger interface. They are required by Redfish to
implement PATCH functionality for Trigger schema.
Some backend changes were required to enable this functionality, and as
such few improvements were made for existing code:
- NumericThreshold and DiscreteThreshold now have common implementation
where it was possible.
- Internal sensor info structure for Trigger is now the same as the one
used for Report. This resulted in breaking compatibility with previous
Trigger persistency data.
- Added getInfo / getParams methods for Sensor and Threshold interfaces.
They are used by Trigger dbus getters and persistency mechanism now,
instead of storing this data in Trigger object.
Testing done:
- Unit tests were expanded and are passing
- dbus setters for Sensors and Thresholds are working and modifications
are reflected by calling appropriate getters.
Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
Change-Id: I7a14c15a30d78ce872342b5f938aba43c77be9c0
diff --git a/tests/src/test_report_manager.cpp b/tests/src/test_report_manager.cpp
index a18579c..10b4de9 100644
--- a/tests/src/test_report_manager.cpp
+++ b/tests/src/test_report_manager.cpp
@@ -215,9 +215,9 @@
reportParams.metricParameters(
std::vector<LabeledMetricParameters>{{LabeledMetricParameters{
- {LabeledSensorParameters{"Service",
- "/xyz/openbmc_project/sensors/power/p1",
- "Metadata1"}},
+ {LabeledSensorInfo{"Service",
+ "/xyz/openbmc_project/sensors/power/p1",
+ "Metadata1"}},
OperationType::single,
"MetricId1",
CollectionTimeScope::point,
@@ -229,7 +229,7 @@
for (size_t i = 0; i < ReportManager::maxNumberMetrics; i++)
{
- metricParamsVec.emplace_back(LabeledSensorParameters{
+ metricParamsVec.emplace_back(LabeledSensorInfo{
"Service", "/xyz/openbmc_project/sensors/power/p1", "Metadata1"});
}
@@ -396,9 +396,9 @@
{
reportParams.metricParameters(
std::vector<LabeledMetricParameters>{{LabeledMetricParameters{
- {LabeledSensorParameters{"Service",
- "/xyz/openbmc_project/sensors/power/p1",
- "Metadata1"}},
+ {LabeledSensorInfo{"Service",
+ "/xyz/openbmc_project/sensors/power/p1",
+ "Metadata1"}},
operationType,
"MetricId1",
CollectionTimeScope::point,