summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRatan Gupta <ratagupt@in.ibm.com>2017-06-06 15:04:23 +0530
committerRatan Gupta <ratagupt@in.ibm.com>2017-06-29 22:08:39 +0530
commit6a98e18394fa529c281a28175494423fec920ffb (patch)
treef8e6616dda12c77efb67c241fbd5c8aac617b140 /test
parentc0ef98774c3e0f3e365c745f0b82ec0b8739ca47 (diff)
downloadphosphor-mboxd-6a98e18394fa529c281a28175494423fec920ffb.tar.gz
phosphor-mboxd-6a98e18394fa529c281a28175494423fec920ffb.zip
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>
Diffstat (limited to 'test')
-rw-r--r--test/create_read_window_vpnor.cpp6
1 files changed, 5 insertions, 1 deletions
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 @@ extern "C" {
#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 @@ int main()
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;
}
OpenPOWER on IntegriCloud