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/common.cpp b/test/common.cpp
index 8905793..89cad22 100644
--- a/test/common.cpp
+++ b/test/common.cpp
@@ -1,5 +1,4 @@
 #include "config.h"
 
-const char* ERRLOG_PERSIST_PATH = "/tmp/errors";
-const char* EXTENSION_PERSIST_DIR = "/tmp/extensions";
+const char* PERSIST_PATH_ROOT = "/tmp/phosphor-logging";
 const bool IS_UNIT_TEST = true;
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()
diff --git a/test/elog_quiesce_test.cpp b/test/elog_quiesce_test.cpp
index a865168..7894f95 100644
--- a/test/elog_quiesce_test.cpp
+++ b/test/elog_quiesce_test.cpp
@@ -2,6 +2,7 @@
 
 #include "elog_entry.hpp"
 #include "log_manager.hpp"
+#include "paths.hpp"
 
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/test/sdbus_mock.hpp>
@@ -28,7 +29,7 @@
     TestQuiesceOnError() : manager(mockedBus, OBJ_INTERNAL)
     {
         // Ensure any errors serializing to filesystem have directory created
-        std::filesystem::create_directory(ERRLOG_PERSIST_PATH);
+        std::filesystem::create_directories(paths::error());
     }
 };
 
diff --git a/test/elog_update_ts_test.cpp b/test/elog_update_ts_test.cpp
index 07d9613..e8ddc09 100644
--- a/test/elog_update_ts_test.cpp
+++ b/test/elog_update_ts_test.cpp
@@ -4,6 +4,7 @@
 #include "elog_serialize.hpp"
 #include "extensions.hpp"
 #include "log_manager.hpp"
+#include "paths.hpp"
 
 #include <filesystem>
 #include <thread>
@@ -34,11 +35,11 @@
 TEST(TestUpdateTS, testChangeResolved)
 {
     // Setting resolved will serialize, so need this directory.
-    fs::create_directory(ERRLOG_PERSIST_PATH);
+    fs::create_directories(paths::error());
 
-    if (!fs::exists(ERRLOG_PERSIST_PATH))
+    if (!fs::exists(paths::error()))
     {
-        ADD_FAILURE() << "Could not create " << ERRLOG_PERSIST_PATH << "\n";
+        ADD_FAILURE() << "Could not create " << paths::error() << "\n";
         exit(1);
     }
 
@@ -50,7 +51,7 @@
     std::srand(std::time(nullptr));
     uint32_t id = std::rand();
 
-    if (fs::exists(fs::path{ERRLOG_PERSIST_PATH} / std::to_string(id)))
+    if (fs::exists(fs::path{paths::error()} / std::to_string(id)))
     {
         std::cerr << "Another testcase is using ID " << id << "\n";
         id = std::rand();
@@ -96,7 +97,7 @@
     EXPECT_EQ(updateTS, elog.updateTimestamp());
 
     // Leave the directory in case other CI instances are running
-    fs::remove(fs::path{ERRLOG_PERSIST_PATH} / std::to_string(id));
+    fs::remove(fs::path{paths::error()} / std::to_string(id));
 }
 
 TEST(TestResolveProhibited, testResolveFlagChange)
diff --git a/test/openpower-pels/meson.build b/test/openpower-pels/meson.build
index d2a44c9..14021a9 100644
--- a/test/openpower-pels/meson.build
+++ b/test/openpower-pels/meson.build
@@ -67,7 +67,7 @@
 openpower_test_lib = static_library(
     'openpower_test_lib',
     'pel_utils.cpp',
-    'paths.cpp',
+    'pel_paths.cpp',
     libpel_sources,
     peltool_sources,
     '../common.cpp',
diff --git a/test/openpower-pels/paths.cpp b/test/openpower-pels/pel_paths.cpp
similarity index 100%
rename from test/openpower-pels/paths.cpp
rename to test/openpower-pels/pel_paths.cpp