Lines Matching full:pel

18 #include "extensions/openpower-pels/pel.hpp"
63 auto pel = std::make_unique<PEL>(data); in TEST_F() local
66 EXPECT_TRUE(pel->valid()); in TEST_F()
67 EXPECT_EQ(pel->id(), 0x80818283); in TEST_F()
68 EXPECT_EQ(pel->plid(), 0x50515253); in TEST_F()
69 EXPECT_EQ(pel->userHeader().subsystem(), 0x10); in TEST_F()
70 EXPECT_EQ(pel->userHeader().actionFlags(), 0x80C0); in TEST_F()
73 auto flattenedData = pel->data(); in TEST_F()
75 EXPECT_EQ(flattenedData.size(), pel->size()); in TEST_F()
81 auto pel = std::make_unique<PEL>(data); in TEST_F() local
83 auto origTime = pel->commitTime(); in TEST_F()
84 pel->setCommitTime(); in TEST_F()
85 auto newTime = pel->commitTime(); in TEST_F()
89 // Make a new PEL and check new value is still there in TEST_F()
90 auto newData = pel->data(); in TEST_F()
91 auto newPel = std::make_unique<PEL>(newData); in TEST_F()
98 auto pel = std::make_unique<PEL>(data); in TEST_F() local
100 auto origID = pel->id(); in TEST_F()
101 pel->assignID(); in TEST_F()
102 auto newID = pel->id(); in TEST_F()
106 // Make a new PEL and check new value is still there in TEST_F()
107 auto newData = pel->data(); in TEST_F()
108 auto newPel = std::make_unique<PEL>(newData); in TEST_F()
115 auto pel = std::make_unique<PEL>(data, 0x42); in TEST_F() local
117 EXPECT_TRUE(pel->valid()); in TEST_F()
118 EXPECT_EQ(pel->obmcLogID(), 0x42); in TEST_F()
128 auto pel = std::make_unique<PEL>(data); in TEST_F() local
130 EXPECT_TRUE(pel->privateHeader().valid()); in TEST_F()
131 EXPECT_FALSE(pel->userHeader().valid()); in TEST_F()
132 EXPECT_FALSE(pel->valid()); in TEST_F()
137 pel = std::make_unique<PEL>(data); in TEST_F()
139 EXPECT_FALSE(pel->privateHeader().valid()); in TEST_F()
140 EXPECT_TRUE(pel->userHeader().valid()); in TEST_F()
141 EXPECT_FALSE(pel->valid()); in TEST_F()
147 auto pel = std::make_unique<PEL>(data); in TEST_F() local
149 EXPECT_FALSE(pel->privateHeader().valid()); in TEST_F()
150 EXPECT_FALSE(pel->userHeader().valid()); in TEST_F()
151 EXPECT_FALSE(pel->valid()); in TEST_F()
171 PEL pel{regEntry, 42, timestamp, phosphor::logging::Entry::Level::Error, in TEST_F() local
174 EXPECT_TRUE(pel.valid()); in TEST_F()
175 EXPECT_EQ(pel.privateHeader().obmcLogID(), 42); in TEST_F()
176 EXPECT_EQ(pel.userHeader().severity(), 0x40); in TEST_F()
178 EXPECT_EQ(pel.primarySRC().value()->asciiString(), in TEST_F()
186 for (const auto& section : pel.optionalSections()) in TEST_F()
208 ASSERT_FALSE(pel.isHwCalloutPresent()); in TEST_F()
215 PEL pel2{regEntry, 42, in TEST_F()
225 // the PEL that's created is exactly 16KB since the UserData
239 // Over the 16KB max PEL size in TEST_F()
245 PEL pel{regEntry, 42, timestamp, phosphor::logging::Entry::Level::Error, in TEST_F() local
248 EXPECT_TRUE(pel.valid()); in TEST_F()
249 EXPECT_EQ(pel.size(), 16384); in TEST_F()
252 const auto& optSections = pel.optionalSections(); in TEST_F()
296 PEL pel{data}; in TEST_F() local
298 const auto& sections = pel.optionalSections(); in TEST_F()
322 auto newData = pel.data(); in TEST_F()
340 PEL pel{data}; in TEST_F() local
341 EXPECT_FALSE(pel.valid()); in TEST_F()
343 const auto& sections = pel.optionalSections(); in TEST_F()
431 (name.find("test-openpower-pels-pel") != std::string::npos); in TEST_F()
460 PEL pel{data}; in TEST_F() local
467 // actual valid JSON (PEL::toJSON() usually handles that). in TEST_F()
469 auto jsonString = pel.privateHeader().getJSON('O'); in TEST_F()
476 jsonString = pel.userHeader().getJSON('O'); in TEST_F()
483 for (const auto& section : pel.optionalSections()) in TEST_F()
607 // Pull the CBOR back out of the PEL section in TEST_F()
740 // Test Adding FFDC from files to a PEL
770 PEL pel{regEntry, 42, timestamp, phosphor::logging::Entry::Level::Error, in TEST_F() local
773 EXPECT_TRUE(pel.valid()); in TEST_F()
776 EXPECT_EQ(pel.size(), 16384); in TEST_F()
782 for (const auto& section : pel.optionalSections()) in TEST_F()
801 // Create a PEL with device callouts
871 PEL pel{regEntry, 42, in TEST_F() local
876 ASSERT_TRUE(pel.primarySRC().value()->callouts()); in TEST_F()
877 auto& callouts = pel.primarySRC().value()->callouts()->callouts(); in TEST_F()
879 ASSERT_TRUE(pel.isHwCalloutPresent()); in TEST_F()
889 const auto& section = pel.optionalSections().back(); in TEST_F()
902 "PEL Internal Debug Data": { in TEST_F()
911 actualJSON.contains("/PEL Internal Debug Data/SRC"_json_pointer)); in TEST_F()
912 EXPECT_EQ(actualJSON["PEL Internal Debug Data"]["SRC"], in TEST_F()
913 expectedJSON["PEL Internal Debug Data"]["SRC"]); in TEST_F()
925 PEL pel{regEntry, 42, in TEST_F() local
931 EXPECT_FALSE(pel.primarySRC().value()->callouts()); in TEST_F()
935 const auto& section = pel.optionalSections().back(); in TEST_F()
947 "{\"PEL Internal Debug Data\":{\"SRC\":" in TEST_F()
952 actualJSON.contains("/PEL Internal Debug Data/SRC"_json_pointer)); in TEST_F()
953 EXPECT_EQ(actualJSON["PEL Internal Debug Data"]["SRC"], in TEST_F()
954 expectedJSON["PEL Internal Debug Data"]["SRC"]); in TEST_F()
969 // the PEL as an FFDC file. Also has a duplicate that in TEST_F()
1018 PEL pel{regEntry, 42, 5, phosphor::logging::Entry::Level::Error, in TEST_F() local
1021 ASSERT_TRUE(pel.valid()); in TEST_F()
1022 ASSERT_TRUE(pel.primarySRC().value()->callouts()); in TEST_F()
1023 const auto& callouts = pel.primarySRC().value()->callouts()->callouts(); in TEST_F()
1025 ASSERT_TRUE(pel.isHwCalloutPresent()); in TEST_F()
1058 // the PEL as an FFDC file. in TEST_F()
1085 PEL pel{regEntry, 42, 5, phosphor::logging::Entry::Level::Error, in TEST_F() local
1088 ASSERT_TRUE(pel.valid()); in TEST_F()
1089 ASSERT_TRUE(pel.primarySRC().value()->callouts()); in TEST_F()
1090 const auto& callouts = pel.primarySRC().value()->callouts()->callouts(); in TEST_F()
1092 ASSERT_FALSE(pel.isHwCalloutPresent()); in TEST_F()
1130 // PEL sections are 4B aligned so add padding before the compare in checkJournalSection()
1168 PEL pel{regEntry, 42, in TEST_F() local
1176 checkJournalSection(pel.optionalSections().back(), expected); in TEST_F()
1179 pelSectsWithOneUD = pel.privateHeader().sectionCount(); in TEST_F()
1190 // A 20000 byte line won't fit in a PEL in TEST_F()
1195 PEL pel{regEntry, 42, in TEST_F() local
1200 // Check for 1 fewer sections than in the previous PEL in TEST_F()
1201 EXPECT_EQ(pel.privateHeader().sectionCount(), pelSectsWithOneUD - 1); in TEST_F()
1227 PEL pel{regEntry, 42, in TEST_F() local
1234 ASSERT_EQ(pel.privateHeader().sectionCount(), pelSectsWithOneUD + 2); in TEST_F()
1236 const auto& optionalSections = pel.optionalSections(); in TEST_F()
1260 // A 20000 byte line won't fit in a PEL in TEST_F()
1265 PEL pel{regEntry, 42, in TEST_F() local
1271 ASSERT_EQ(pel.privateHeader().sectionCount(), pelSectsWithOneUD); in TEST_F()
1273 checkJournalSection(pel.optionalSections().back(), expected4); in TEST_F()
1277 // API to collect and parse the User Data section of the PEL.
1278 nlohmann::json getDIMMInfo(const auto& pel) in getDIMMInfo() argument
1303 "/PEL Internal Debug Data/DIMMs Info Fetch Error"_json_pointer)) in getDIMMInfo()
1306 "/PEL Internal Debug Data/DIMMs Info Fetch Error"_json_pointer); in getDIMMInfo()
1315 std::ranges::any_of(pel.optionalSections(), hasDIMMInfo); in getDIMMInfo()
1321 // SysInfo User Data section of the PEL
1372 PEL pel{entry, 42, timestamp, phosphor::logging::Entry::Level::Error, in TEST_F() local
1374 nlohmann::json dimmInfoJson = getDIMMInfo(pel); in TEST_F()
1398 // When PEL has FRU callouts but PHAL is not enabled.
1431 PEL pel{entry, 42, timestamp, phosphor::logging::Entry::Level::Error, in TEST_F() local
1434 nlohmann::json dimmInfoJson = getDIMMInfo(pel); in TEST_F()
1441 // When the PEL doesn't contain any type of callouts
1451 PEL pel{entry, 42, timestamp, phosphor::logging::Entry::Level::Error, in TEST_F() local
1454 nlohmann::json dimmInfoJson = getDIMMInfo(pel); in TEST_F()
1461 // When the PEL has DIMM callouts, but failed to fetch DI property value
1498 PEL pel{entry, 42, timestamp, phosphor::logging::Entry::Level::Error, in TEST_F() local
1501 nlohmann::json dimmInfoJson = getDIMMInfo(pel); in TEST_F()