Use proper dbus path when possible.
Following methods and properties were updated to use full dbus path,
instead of internal telemetry id:
- TriggerManager.AddTrigger() - 'reportIds' arg
- Trigger.ReportIds - renamed to 'Reports'
- Report.TriggerIds - renamed to 'Triggers'
Testing done:
- UTs were updated and are passing.
Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
Change-Id: I78d812d38289fac575d25b48503cc8b9c6f736fe
diff --git a/tests/src/params/trigger_params.hpp b/tests/src/params/trigger_params.hpp
index b17ea86..65f423e 100644
--- a/tests/src/params/trigger_params.hpp
+++ b/tests/src/params/trigger_params.hpp
@@ -1,16 +1,29 @@
#pragma once
+#include "report.hpp"
#include "types/duration_types.hpp"
#include "types/trigger_types.hpp"
+#include "utils/dbus_path_utils.hpp"
+#include "utils/transform.hpp"
#include <sdbusplus/message.hpp>
#include <chrono>
#include <utility>
+using sdbusplus::message::object_path;
+
class TriggerParams
{
public:
+ TriggerParams()
+ {
+ reportsProperty =
+ utils::transform(reportIdsProperty, [](const auto& id) {
+ return utils::pathAppend(utils::constants::reportDirPath, id);
+ });
+ }
+
TriggerParams& id(std::string val)
{
idProperty = std::move(val);
@@ -57,6 +70,21 @@
TriggerParams& reportIds(std::vector<std::string> val)
{
reportIdsProperty = std::move(val);
+ reportsProperty = utils::transform<std::vector>(
+ reportIdsProperty, [](const auto& id) {
+ return utils::pathAppend(utils::constants::reportDirPath, id);
+ });
+ return *this;
+ }
+
+ const std::vector<object_path>& reports() const
+ {
+ return reportsProperty;
+ }
+
+ TriggerParams& reports(std::vector<object_path> val)
+ {
+ reportsProperty = std::move(val);
return *this;
}
@@ -79,7 +107,9 @@
std::vector<LabeledSensorInfo> labeledSensorsProperty = {
{"service1", "/xyz/openbmc_project/sensors/temperature/BMC_Temp",
"metadata1"}};
- std::vector<std::string> reportIdsProperty = {"Report1"};
+ std::vector<std::string> reportIdsProperty = {"Report1",
+ "Prefixed/Report2"};
+ std::vector<object_path> reportsProperty;
LabeledTriggerThresholdParams labeledThresholdsProperty =
std::vector<numeric::LabeledThresholdParam>{
numeric::LabeledThresholdParam{numeric::Type::lowerCritical,