PEL: Save invalid host PELs to a file
To aid in debug of when the host sends down an invalid PEL, save the PEL
to the file 'badPEL' in the PEL repo path. This only saves a single one
at a time to keep things simple.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I3b630433712d63cadd971aa87a02f76a9a366849
diff --git a/test/openpower-pels/pel_manager_test.cpp b/test/openpower-pels/pel_manager_test.cpp
index 530dfd5..00427c2 100644
--- a/test/openpower-pels/pel_manager_test.cpp
+++ b/test/openpower-pels/pel_manager_test.cpp
@@ -176,6 +176,10 @@
EXPECT_EQ(logger.ad["SRC"], (*invalidPEL.primarySRC())->asciiString());
EXPECT_EQ(logger.ad["PEL_SIZE"], std::to_string(data.size()));
+ // Check that the bad PEL data was saved to a file.
+ auto badPELData = readPELFile(getPELRepoPath() / "badPEL");
+ EXPECT_EQ(*badPELData, data);
+
fs::remove_all(pelFilename.parent_path());
}