summaryrefslogtreecommitdiffstats
path: root/test/openpower-pels/paths.cpp
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-07-17 13:54:30 -0500
committerMatt Spinler <spinler@us.ibm.com>2019-08-05 12:49:54 -0500
commit89fa082a68c975128db6fa96eab33200c6bc7bb6 (patch)
tree30ef8f010c8431536b631c47fa54bab43ecc2f51 /test/openpower-pels/paths.cpp
parentcb6b059eec52ddfe099221de003d7dca86ce1db0 (diff)
downloadphosphor-logging-89fa082a68c975128db6fa96eab33200c6bc7bb6.tar.gz
phosphor-logging-89fa082a68c975128db6fa96eab33200c6bc7bb6.zip
PEL: Add repository to save PELs
Create the Repository class that can save PELs in (and later retrieve them from) the filesystem. It provides an add() method that can add a PEL object to the repository. Now, when the Manager class sees an OpenBMC event log created with the RAWPEL metadata in the AdditionalData property that points at a file that contains a PEL, it can save that PEL. Before the PEL is saved, the log ID and commit timestamp fields in the PEL will be updated - the log ID to a unique value, and the timestamp to the current time. Change-Id: I8dbaddf0f155bcb6d40b933294ada83feb75ce53
Diffstat (limited to 'test/openpower-pels/paths.cpp')
-rw-r--r--test/openpower-pels/paths.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/openpower-pels/paths.cpp b/test/openpower-pels/paths.cpp
index 464b92c..27f4bce 100644
--- a/test/openpower-pels/paths.cpp
+++ b/test/openpower-pels/paths.cpp
@@ -22,5 +22,18 @@ std::filesystem::path getPELIDFile()
return idFile;
}
+std::filesystem::path getPELRepoPath()
+{
+ static std::string repoPath;
+
+ if (repoPath.empty())
+ {
+ char templ[] = "/tmp/repopathtestXXXXXX";
+ std::filesystem::path dir = mkdtemp(templ);
+ repoPath = dir;
+ }
+ return repoPath;
+}
+
} // namespace pels
} // namespace openpower
OpenPOWER on IntegriCloud