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