Revert "created AddReportFutureVersion dbus method"
This reverts commit 753e4b3c843dd5d1068949c4106a6389f0e0ffbc.
Reason for revert: Breaks bmcweb, same approach is needed for changed properties
Change-Id: Id868159df916fcf0bdd7fc5062f8c51187fcc7e2
diff --git a/tests/src/helpers/interfaces/labeled_reading_parameter_helpers.hpp b/tests/src/helpers/interfaces/labeled_reading_parameter_helpers.hpp
index d0b1fff..9a46d0c 100644
--- a/tests/src/helpers/interfaces/labeled_reading_parameter_helpers.hpp
+++ b/tests/src/helpers/interfaces/labeled_reading_parameter_helpers.hpp
@@ -1,7 +1,7 @@
#pragma once
#include "helpers/interfaces/labeled_sensor_parameter_helpers.hpp"
-#include "types/types.hpp"
+#include "interfaces/types.hpp"
#include <ostream>
diff --git a/tests/src/helpers/interfaces/labeled_sensor_parameter_helpers.hpp b/tests/src/helpers/interfaces/labeled_sensor_parameter_helpers.hpp
index 395f8d1..ef2eb6b 100644
--- a/tests/src/helpers/interfaces/labeled_sensor_parameter_helpers.hpp
+++ b/tests/src/helpers/interfaces/labeled_sensor_parameter_helpers.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "types/types.hpp"
+#include "interfaces/types.hpp"
#include <ostream>
diff --git a/tests/src/params/report_params.hpp b/tests/src/params/report_params.hpp
index bf78add..25422bc 100644
--- a/tests/src/params/report_params.hpp
+++ b/tests/src/params/report_params.hpp
@@ -1,7 +1,7 @@
#pragma once
+#include "interfaces/types.hpp"
#include "report_manager.hpp"
-#include "types/types.hpp"
#include <chrono>
#include <string>
@@ -86,14 +86,10 @@
"/xyz/openbmc_project/sensors/power/p1")},
utils::enumToString(OperationType::single),
"MetricId1",
- "Metadata1",
- utils::enumToString(CollectionTimeScope::point),
- 0u},
+ "Metadata1"},
{{sdbusplus::message::object_path(
"/xyz/openbmc_project/sensors/power/p2")},
utils::enumToString(OperationType::single),
"MetricId2",
- "Metadata2",
- utils::enumToString(CollectionTimeScope::point),
- 0u}};
+ "Metadata2"}};
};
diff --git a/tests/src/test_metric.cpp b/tests/src/test_metric.cpp
index 786f025..e91750d 100644
--- a/tests/src/test_metric.cpp
+++ b/tests/src/test_metric.cpp
@@ -8,8 +8,6 @@
#include <gmock/gmock.h>
using namespace testing;
-using namespace std::chrono_literals;
-
namespace tstring = utils::tstring;
using Timestamp = uint64_t;
@@ -21,8 +19,7 @@
std::make_shared<NiceMock<SensorMock>>();
std::shared_ptr<Metric> sut = std::make_shared<Metric>(
- sensorMock, OperationType::avg, "id", "metadata",
- CollectionTimeScope::point, CollectionDuration(0ms));
+ sensorMock, OperationType::avg, "id", "metadata");
};
TEST_F(TestMetric, subscribesForSensorDuringInitialization)
diff --git a/tests/src/test_report.cpp b/tests/src/test_report.cpp
index ece4be8..80c0a9c 100644
--- a/tests/src/test_report.cpp
+++ b/tests/src/test_report.cpp
@@ -53,8 +53,7 @@
LabeledSensorParameters("service"s + id, "path"s + id);
auto metricParameters = LabeledMetricParameters(
std::move(sensorParameters), utils::toOperationType(i),
- "id"s + id, "metadata"s + id, CollectionTimeScope::point,
- CollectionDuration(0ms));
+ "id"s + id, "metadata"s + id);
ON_CALL(*metricMocks[i], dumpConfiguration())
.WillByDefault(Return(std::move(metricParameters)));
@@ -127,7 +126,7 @@
const T& newValue)
{
auto setPromise = std::promise<boost::system::error_code>();
- auto future = setPromise.get_future();
+ auto setFuture = setPromise.get_future();
sdbusplus::asio::setProperty(
*DbusEnvironment::getBus(), DbusEnvironment::serviceName(), path,
Report::reportIfaceName, property, std::move(newValue),
@@ -135,7 +134,7 @@
std::move(setPromise)](boost::system::error_code ec) mutable {
setPromise.set_value(ec);
});
- return DbusEnvironment::waitForFuture(std::move(future));
+ return DbusEnvironment::waitForFuture(std::move(setFuture));
}
boost::system::error_code deleteReport(const std::string& path)
@@ -263,32 +262,20 @@
"ReadingParameters",
nlohmann::json(
{{{tstring::SensorPath::str(),
- {{tstring::Service::str(), "service0"},
- {tstring::Path::str(), "path0"}}},
+ {{"service", "service0"}, {"path", "path0"}}},
{tstring::OperationType::str(), OperationType::single},
{tstring::Id::str(), "id0"},
- {tstring::MetricMetadata::str(), "metadata0"},
- {tstring::CollectionTimeScope::str(),
- CollectionTimeScope::point},
- {tstring::CollectionDuration::str(), 0}},
+ {tstring::MetricMetadata::str(), "metadata0"}},
{{tstring::SensorPath::str(),
- {{tstring::Service::str(), "service1"},
- {tstring::Path::str(), "path1"}}},
+ {{"service", "service1"}, {"path", "path1"}}},
{tstring::OperationType::str(), OperationType::max},
{tstring::Id::str(), "id1"},
- {tstring::MetricMetadata::str(), "metadata1"},
- {tstring::CollectionTimeScope::str(),
- CollectionTimeScope::point},
- {tstring::CollectionDuration::str(), 0}},
+ {tstring::MetricMetadata::str(), "metadata1"}},
{{tstring::SensorPath::str(),
- {{tstring::Service::str(), "service2"},
- {tstring::Path::str(), "path2"}}},
+ {{"service", "service2"}, {"path", "path2"}}},
{tstring::OperationType::str(), OperationType::min},
{tstring::Id::str(), "id2"},
- {tstring::MetricMetadata::str(), "metadata2"},
- {tstring::CollectionTimeScope::str(),
- CollectionTimeScope::point},
- {tstring::CollectionDuration::str(), 0}}}))));
+ {tstring::MetricMetadata::str(), "metadata2"}}}))));
TEST_P(TestReportStore, settingPersistencyToTrueStoresReport)
{
diff --git a/tests/src/test_report_manager.cpp b/tests/src/test_report_manager.cpp
index d9ea4af..519606f 100644
--- a/tests/src/test_report_manager.cpp
+++ b/tests/src/test_report_manager.cpp
@@ -57,7 +57,7 @@
addReportPromise.set_value({ec, path});
},
DbusEnvironment::serviceName(), ReportManager::reportManagerPath,
- ReportManager::reportManagerIfaceName, "AddReportFutureVersion",
+ ReportManager::reportManagerIfaceName, "AddReport",
params.reportName(), params.reportingType(),
params.emitReadingUpdate(), params.logToMetricReportCollection(),
static_cast<uint64_t>(params.interval().count()),
@@ -74,10 +74,10 @@
*DbusEnvironment::getBus(), DbusEnvironment::serviceName(),
ReportManager::reportManagerPath,
ReportManager::reportManagerIfaceName, property,
- [&propertyPromise](const boost::system::error_code& ec, T t) {
+ [&propertyPromise](boost::system::error_code ec, T t) {
if (ec)
{
- utils::setException(propertyPromise, "Get property failed");
+ utils::setException(propertyPromise, "GetProperty failed");
return;
}
propertyPromise.set_value(t);
@@ -274,9 +274,7 @@
"/xyz/openbmc_project/sensors/power/p1")},
utils::enumToString(operationType),
"MetricId1",
- "Metadata1",
- utils::enumToString(CollectionTimeScope::point),
- 0u}});
+ "Metadata1"}});
reportFactoryMock.expectMake(_, reportParams, Ref(*sut), Ref(storageMock))
.WillOnce(Return(ByMove(std::move(reportMockPtr))));
@@ -314,10 +312,7 @@
return LabeledMetricParameters(
LabeledSensorParameters("service", std::get<0>(item)),
utils::stringToOperationType(std::get<1>(item)),
- std::get<2>(item), std::get<3>(item),
- utils::stringToCollectionTimeScope(std::get<4>(item)),
- CollectionDuration(
- std::chrono::milliseconds(std::get<5>(item))));
+ std::get<2>(item), std::get<3>(item));
});
}