Deepak Kodihalli | 707a3e1 | 2017-06-14 03:56:12 -0500 | [diff] [blame] | 1 | #include "config.h" |
2 | |||||
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 3 | #include "log_manager.hpp" |
4 | |||||
5 | #include <stdlib.h> | ||||
6 | |||||
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 7 | #include <sdbusplus/bus.hpp> |
Matt Spinler | b181d9d | 2020-06-05 14:49:59 -0500 | [diff] [blame] | 8 | #include <sdbusplus/test/sdbus_mock.hpp> |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 9 | |
Patrick Williams | 2544b41 | 2022-10-04 08:41:06 -0500 | [diff] [blame^] | 10 | #include <filesystem> |
11 | |||||
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 12 | #include <gtest/gtest.h> |
13 | |||||
Deepak Kodihalli | 707a3e1 | 2017-06-14 03:56:12 -0500 | [diff] [blame] | 14 | namespace phosphor |
15 | { | ||||
16 | namespace logging | ||||
17 | { | ||||
18 | namespace test | ||||
19 | { | ||||
20 | |||||
Patrick Williams | 331c485 | 2021-04-16 15:38:59 -0500 | [diff] [blame] | 21 | namespace fs = std::filesystem; |
Deepak Kodihalli | 707a3e1 | 2017-06-14 03:56:12 -0500 | [diff] [blame] | 22 | |
23 | char tmplt[] = "/tmp/logging_test.XXXXXX"; | ||||
Matt Spinler | b181d9d | 2020-06-05 14:49:59 -0500 | [diff] [blame] | 24 | sdbusplus::SdBusMock sdbusMock; |
Patrick Williams | 45e8352 | 2022-07-22 19:26:52 -0500 | [diff] [blame] | 25 | sdbusplus::bus_t bus = sdbusplus::get_mocked_new(&sdbusMock); |
Nagaraju Goruganti | 05aae8b | 2017-08-30 07:56:12 -0500 | [diff] [blame] | 26 | phosphor::logging::internal::Manager manager(bus, OBJ_INTERNAL); |
Deepak Kodihalli | 707a3e1 | 2017-06-14 03:56:12 -0500 | [diff] [blame] | 27 | |
28 | class TestSerialization : public testing::Test | ||||
29 | { | ||||
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 30 | public: |
Patrick Williams | 2544b41 | 2022-10-04 08:41:06 -0500 | [diff] [blame^] | 31 | TestSerialization() : dir(fs::path(mkdtemp(tmplt))) {} |
Deepak Kodihalli | 707a3e1 | 2017-06-14 03:56:12 -0500 | [diff] [blame] | 32 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 33 | ~TestSerialization() |
34 | { | ||||
35 | fs::remove_all(dir); | ||||
36 | } | ||||
Deepak Kodihalli | 707a3e1 | 2017-06-14 03:56:12 -0500 | [diff] [blame] | 37 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 38 | fs::path dir; |
Deepak Kodihalli | 707a3e1 | 2017-06-14 03:56:12 -0500 | [diff] [blame] | 39 | }; |
40 | |||||
41 | } // namespace test | ||||
42 | } // namespace logging | ||||
43 | } // namespace phosphor |