blob: 902ddf3852926ba445964bead5252bc52c55e86e [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 Williams331c4852021-04-16 15:38:59 -05007#include <filesystem>
Patrick Venturef18bf832018-10-26 18:14:00 -07008#include <sdbusplus/bus.hpp>
Matt Spinlerb181d9d2020-06-05 14:49:59 -05009#include <sdbusplus/test/sdbus_mock.hpp>
Patrick Venturef18bf832018-10-26 18:14:00 -070010
11#include <gtest/gtest.h>
12
Deepak Kodihalli707a3e12017-06-14 03:56:12 -050013namespace phosphor
14{
15namespace logging
16{
17namespace test
18{
19
Patrick Williams331c4852021-04-16 15:38:59 -050020namespace fs = std::filesystem;
Deepak Kodihalli707a3e12017-06-14 03:56:12 -050021
22char tmplt[] = "/tmp/logging_test.XXXXXX";
Matt Spinlerb181d9d2020-06-05 14:49:59 -050023sdbusplus::SdBusMock sdbusMock;
24sdbusplus::bus::bus bus = sdbusplus::get_mocked_new(&sdbusMock);
Nagaraju Goruganti05aae8b2017-08-30 07:56:12 -050025phosphor::logging::internal::Manager manager(bus, OBJ_INTERNAL);
Deepak Kodihalli707a3e12017-06-14 03:56:12 -050026
27class TestSerialization : public testing::Test
28{
Patrick Venturef18bf832018-10-26 18:14:00 -070029 public:
30 TestSerialization() : dir(fs::path(mkdtemp(tmplt)))
31 {
32 }
Deepak Kodihalli707a3e12017-06-14 03:56:12 -050033
Patrick Venturef18bf832018-10-26 18:14:00 -070034 ~TestSerialization()
35 {
36 fs::remove_all(dir);
37 }
Deepak Kodihalli707a3e12017-06-14 03:56:12 -050038
Patrick Venturef18bf832018-10-26 18:14:00 -070039 fs::path dir;
Deepak Kodihalli707a3e12017-06-14 03:56:12 -050040};
41
42} // namespace test
43} // namespace logging
44} // namespace phosphor