blob: b6c24ed3083bbd9900dea135b83ca3c6d8fbc91f [file] [log] [blame]
Deepak Kodihalli707a3e12017-06-14 03:56:12 -05001#include "config.h"
2
Patrick Venturef18bf832018-10-26 18:14:00 -07003#include "log_manager.hpp"
4
5#include <stdlib.h>
6
Patrick Venturef18bf832018-10-26 18:14:00 -07007#include <sdbusplus/bus.hpp>
Matt Spinlerb181d9d2020-06-05 14:49:59 -05008#include <sdbusplus/test/sdbus_mock.hpp>
Patrick Venturef18bf832018-10-26 18:14:00 -07009
Patrick Williams2544b412022-10-04 08:41:06 -050010#include <filesystem>
11
Patrick Venturef18bf832018-10-26 18:14:00 -070012#include <gtest/gtest.h>
13
Deepak Kodihalli707a3e12017-06-14 03:56:12 -050014namespace phosphor
15{
16namespace logging
17{
18namespace test
19{
20
Patrick Williams331c4852021-04-16 15:38:59 -050021namespace fs = std::filesystem;
Deepak Kodihalli707a3e12017-06-14 03:56:12 -050022
23char tmplt[] = "/tmp/logging_test.XXXXXX";
Matt Spinlerb181d9d2020-06-05 14:49:59 -050024sdbusplus::SdBusMock sdbusMock;
Patrick Williams45e83522022-07-22 19:26:52 -050025sdbusplus::bus_t bus = sdbusplus::get_mocked_new(&sdbusMock);
Nagaraju Goruganti05aae8b2017-08-30 07:56:12 -050026phosphor::logging::internal::Manager manager(bus, OBJ_INTERNAL);
Deepak Kodihalli707a3e12017-06-14 03:56:12 -050027
28class TestSerialization : public testing::Test
29{
Patrick Venturef18bf832018-10-26 18:14:00 -070030 public:
Patrick Williams2544b412022-10-04 08:41:06 -050031 TestSerialization() : dir(fs::path(mkdtemp(tmplt))) {}
Deepak Kodihalli707a3e12017-06-14 03:56:12 -050032
Patrick Venturef18bf832018-10-26 18:14:00 -070033 ~TestSerialization()
34 {
35 fs::remove_all(dir);
36 }
Deepak Kodihalli707a3e12017-06-14 03:56:12 -050037
Patrick Venturef18bf832018-10-26 18:14:00 -070038 fs::path dir;
Deepak Kodihalli707a3e12017-06-14 03:56:12 -050039};
40
41} // namespace test
42} // namespace logging
43} // namespace phosphor