log-manager: enable non-standard path for local tests
Enable the log-manager to be launched with a path other than
`/var/phosphor-logging` to allow it to be ran on a development system
for test purposes. This required some refactoring throughout as to
how paths were handled.
Tested:
After running tests, `/tmp/phosphor-logging` is populated with
entries. Launching `./builddir/phosphor-log-manager
/tmp/phosphor-logging`, the log-manager will have the entries on
dbus:
```
$ busctl --user tree xyz.openbmc_project.Logging
└─ /xyz
└─ /xyz/openbmc_project
└─ /xyz/openbmc_project/logging
├─ /xyz/openbmc_project/logging/entry
│ ├─ /xyz/openbmc_project/logging/entry/100
│ ├─ /xyz/openbmc_project/logging/entry/101
│ ├─ /xyz/openbmc_project/logging/entry/102
│ ├─ /xyz/openbmc_project/logging/entry/103
```
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I84968edeed0dcf73aaf8bb653060b6d3400b9b7b
diff --git a/test/elog_errorwrap_test.hpp b/test/elog_errorwrap_test.hpp
index d8b1295..82269c4 100644
--- a/test/elog_errorwrap_test.hpp
+++ b/test/elog_errorwrap_test.hpp
@@ -2,6 +2,7 @@
#include "elog_serialize.hpp"
#include "log_manager.hpp"
+#include "paths.hpp"
#include "xyz/openbmc_project/Common/error.hpp"
#include <phosphor-logging/elog-errors.hpp>
@@ -87,7 +88,7 @@
bus(sdbusplus::bus::new_default()),
manager(bus, "/xyz/openbmc_test/abc")
{
- fs::create_directories(ERRLOG_PERSIST_PATH);
+ fs::create_directories(paths::error());
}
~TestLogManager()