Save persistent triggers to storage
Create json storage file for persistent triggers.
Handle persistent dbus property.
Save/remove persistent triggers on add/delete.
Cover code with UTs.
Tested:
- Passed unit tests
- Tested on QEMU
* adding new valid and invalid trigger from cli
* verifying if valid trigger is properly stored
* deleting existed trigger from storage
Change-Id: I243326e84833a8cb22075fbf565573b62b205b4a
Signed-off-by: Cezary Zwolak <cezary.zwolak@intel.com>
Signed-off-by: Lukasz Kazmierczak <lukasz.kazmierczak@intel.com>
diff --git a/tests/src/params/trigger_params.hpp b/tests/src/params/trigger_params.hpp
index 95b19d2..08bed4b 100644
--- a/tests/src/params/trigger_params.hpp
+++ b/tests/src/params/trigger_params.hpp
@@ -42,13 +42,18 @@
return logToRedfishProperty;
}
+ TriggerParams& updateReport(bool updateReport)
+ {
+ updateReportProperty = updateReport;
+ return *this;
+ }
+
bool updateReport() const
{
return updateReportProperty;
}
- const std::vector<std::pair<sdbusplus::message::object_path, std::string>>&
- sensors() const
+ const TriggerSensors& sensors() const
{
return sensorsProperty;
}
@@ -74,12 +79,11 @@
bool discreteProperty = false;
bool logToJournalProperty = false;
bool logToRedfishProperty = false;
- bool updateReportProperty = false;
- std::vector<std::pair<sdbusplus::message::object_path, std::string>>
- sensorsProperty = {
- {sdbusplus::message::object_path(
- "/xyz/openbmc_project/sensors/temperature/BMC_Temp"),
- ""}};
+ bool updateReportProperty = true;
+ TriggerSensors sensorsProperty = {
+ {sdbusplus::message::object_path(
+ "/xyz/openbmc_project/sensors/temperature/BMC_Temp"),
+ ""}};
std::vector<std::string> reportNamesProperty = {"Report1"};
TriggerThresholdParams thresholdsProperty =
std::vector<numeric::ThresholdParam>{