blob: 27f4bce78010bb68c6afb8649f367ace3195d996 [file] [log] [blame]
Matt Spinlerdf13bdb2019-07-10 16:54:13 -05001#include "extensions/openpower-pels/paths.hpp"
2
3#include <filesystem>
4
5namespace openpower
6{
7namespace pels
8{
9
10// Use paths that work in unit tests.
11
12std::filesystem::path getPELIDFile()
13{
14 static std::string idFile;
15
16 if (idFile.empty())
17 {
18 char templ[] = "/tmp/logidtestXXXXXX";
19 std::filesystem::path dir = mkdtemp(templ);
20 idFile = dir / "logid";
21 }
22 return idFile;
23}
24
Matt Spinler89fa0822019-07-17 13:54:30 -050025std::filesystem::path getPELRepoPath()
26{
27 static std::string repoPath;
28
29 if (repoPath.empty())
30 {
31 char templ[] = "/tmp/repopathtestXXXXXX";
32 std::filesystem::path dir = mkdtemp(templ);
33 repoPath = dir;
34 }
35 return repoPath;
36}
37
Matt Spinlerdf13bdb2019-07-10 16:54:13 -050038} // namespace pels
39} // namespace openpower