PEL: Keep PEL attributes in Repository map

Instead of the Repository class only storing the path to a PEL file for
a corresponding PEL ID, change it to a structure that includes the PEL's
size and action flags as well as the path.  This way, a PEL won't have
to be read from the filesystem to find these values every time someone
needs them.

These new fields will be needed by the code that sends PELs to the host.

Change-Id: I7650b6cbad12cc120426854767403f5cba2ee572
diff --git a/test/openpower-pels/repository_test.cpp b/test/openpower-pels/repository_test.cpp
index 34de855..8596840 100644
--- a/test/openpower-pels/repository_test.cpp
+++ b/test/openpower-pels/repository_test.cpp
@@ -255,3 +255,48 @@
     repo.remove(id);
     EXPECT_EQ(removed.size(), 0);
 }
+
+TEST_F(RepositoryTest, TestGetAttributes)
+{
+    uint32_t pelID = 0;
+    std::bitset<16> actionFlags;
+
+    {
+        Repository repo{repoPath};
+
+        // Add a PEL to the repo
+        auto data = pelDataFactory(TestPELType::pelSimple);
+        auto pel = std::make_unique<PEL>(data);
+        repo.add(pel);
+
+        pelID = pel->id();
+        actionFlags = pel->userHeader().actionFlags();
+
+        using ID = Repository::LogID;
+        ID id{ID::Pel(pelID)};
+
+        auto a = repo.getPELAttributes(id);
+        EXPECT_TRUE(a);
+        EXPECT_EQ((*a).get().actionFlags, actionFlags);
+
+        id.pelID.id = 0;
+        a = repo.getPELAttributes(id);
+        EXPECT_FALSE(a);
+    }
+
+    {
+        // Restore the repository and check again
+        Repository repo{repoPath};
+
+        using ID = Repository::LogID;
+        ID id{ID::Pel(pelID)};
+
+        auto a = repo.getPELAttributes(id);
+        EXPECT_TRUE(a);
+        EXPECT_EQ((*a).get().actionFlags, actionFlags);
+
+        id.pelID.id = 0;
+        a = repo.getPELAttributes(id);
+        EXPECT_FALSE(a);
+    }
+}