summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDeepak Kodihalli <dkodihal@in.ibm.com>2017-07-11 23:01:39 -0500
committerPatrick Williams <patrick@stwcx.xyz>2017-07-19 22:58:34 +0000
commitd1d7930d5d86e7a537fa46e1137bb4131ee52c07 (patch)
treefe4721011e034e2b264fa1255918883390411e6f /test
parentabd52a78941e91bb603772a252c3a98477fec44d (diff)
downloadphosphor-mboxd-d1d7930d5d86e7a537fa46e1137bb4131ee52c07.tar.gz
phosphor-mboxd-d1d7930d5d86e7a537fa46e1137bb4131ee52c07.zip
vpnor: make PNOR block size configurable
The vpnor code would assume a PNOR FFS block size of 4K. Make it possible to supply this value, since it needn't always be 4K. Change-Id: I21463b05f1047e93705ba82d46f746056568dcc5 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Diffstat (limited to 'test')
-rw-r--r--test/create_pnor_partition_table.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/create_pnor_partition_table.cpp b/test/create_pnor_partition_table.cpp
index bda443c..ec78e70 100644
--- a/test/create_pnor_partition_table.cpp
+++ b/test/create_pnor_partition_table.cpp
@@ -30,7 +30,8 @@ int main()
partitionFile.write(empty.data(), empty.size());
partitionFile.close();
- const openpower::virtual_pnor::partition::Table table(fs::path{tmpdir});
+ const openpower::virtual_pnor::partition::Table
+ table(fs::path{tmpdir}, 4 * 1024, 64 * 1024 * 1024);
pnor_partition_table expectedTable{};
expectedTable.data.magic = PARTITION_HEADER_MAGIC;
@@ -39,7 +40,8 @@ int main()
expectedTable.data.entry_size = sizeof(pnor_partition);
expectedTable.data.entry_count = 1; // 1 partition
expectedTable.data.block_size = 4096;
- expectedTable.data.block_count = 2; // 1 table block and 1 partition block
+ expectedTable.data.block_count =
+ (64 * 1024 * 1024) / expectedTable.data.block_size;
expectedTable.checksum =
openpower::virtual_pnor::details::checksum(expectedTable.data);
OpenPOWER on IntegriCloud