Read the partition file from the vpnor.

This fix reads the file from the partition,
Memory map to it and then copy the asked memory
area to the reserved memory area.

Change-Id: I4b2987e628bc4820edfeb1b0a81e5d1cbb8e7cf1
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/test/create_read_window_vpnor.cpp b/test/create_read_window_vpnor.cpp
index 8121498..d9bcccc 100644
--- a/test/create_read_window_vpnor.cpp
+++ b/test/create_read_window_vpnor.cpp
@@ -13,7 +13,7 @@
 #include <fstream>
 #include <experimental/filesystem>
 
-constexpr auto line = "partition01=HBB,00000000,00000400,ECC,PRESERVED";
+constexpr auto line = "partition01=HBB,00000000,0001000,ECC,PRESERVED";
 constexpr auto partition = "HBB";
 char tmplt[] = "/tmp/create_read_test.XXXXXX";
 uint8_t data[8] = { 0xaa, 0x55, 0xaa, 0x66, 0x77, 0x88, 0x99, 0xab };
@@ -86,6 +86,10 @@
     rc = memcmp(ctx->mem, data, 6);
     assert(rc == 0);
 
+    //TODO: Add few more test cases for read from multiple partitions(PRSV/RW)
+    //      Read beyond the partition file size.
+    //      openbmc/openbmc#1868
+
     fs::remove_all(fs::path{tmpdir});
     return rc;
 }