Correction of VPD using ECC
ECC algorithm corrects VPD data in 32:1 bit ratio in the
event of corruption.
Main Test Cases:
1) Check correction of KW in records.
2) Check correction while writing and reading VPD.
3) Check for Module VPD correction.
Signed-off-by: Giridhari Krishna <giridharikrishnan@gmail.com>
Change-Id: I48a3db18df9d3a2aecde814610ab1b357e6f310d
diff --git a/test/ipz_parser/parser.cpp b/test/ipz_parser/parser.cpp
index 945467a..c4c7566 100644
--- a/test/ipz_parser/parser.cpp
+++ b/test/ipz_parser/parser.cpp
@@ -1,6 +1,7 @@
#include "ipz_parser.hpp"
#include <cassert>
+#include <const.hpp>
#include <defines.hpp>
#include <fstream>
#include <impl.hpp>
@@ -10,6 +11,9 @@
#include <gtest/gtest.h>
using namespace openpower::vpd;
+using namespace openpower::vpd::constants;
+
+constexpr uint32_t vpdOffset = 0;
TEST(IpzVpdParserApp, vpdGoodPath)
{
@@ -37,7 +41,7 @@
0x00, 0x52, 0x54, 0x04};
// call app for this vpd
- parser::Impl p(std::move(vpd), std::string{});
+ parser::Impl p(std::move(vpd), std::string{}, systemVpdFilePath, vpdOffset);
Store vpdStore = p.run();
static const std::string record = "VINI";
@@ -65,7 +69,7 @@
Binary vpd = {};
// VPD is empty
- parser::Impl p(std::move(vpd), std::string{});
+ parser::Impl p(std::move(vpd), std::string{}, systemVpdFilePath, vpdOffset);
// Expecting a throw here
EXPECT_THROW(p.run(), std::runtime_error);
@@ -98,7 +102,7 @@
// corrupt the VHDR
vpd[17] = 0x00;
- parser::Impl p(std::move(vpd), std::string{});
+ parser::Impl p(std::move(vpd), std::string{}, systemVpdFilePath, vpdOffset);
// Expecting a throw here
EXPECT_THROW(p.run(), std::runtime_error);
@@ -131,7 +135,7 @@
// corrupt the VTOC
vpd[61] = 0x00;
- parser::Impl p(std::move(vpd), std::string{});
+ parser::Impl p(std::move(vpd), std::string{}, systemVpdFilePath, vpdOffset);
// Expecting a throw here
EXPECT_THROW(p.run(), std::runtime_error);