pnor_partition_table: Refactor to allow tests to specify patch location

The Table class was unhelpful for testing in a couple of ways:

1. It attempted to access files on the filesystem whilst parsing ToC
   entries
2. It incorrectly assumed the location of the files it was accessing

Both of these issues come down to handling of patch files and the
configuration of the 'actual' member of the partition struct.

Hoist the handling of the partition entry's data size out of the ToC
parser, and rework the Table constructor to only require a struct
mbox_context pointer.  We can then use the paths member of mbox_context
to find the patch location rather than hard-code the value generated by
the configure script.

This prompts a rework and rename of the wrapper functions in
mboxd_pnor_partition_table.{cpp,h} to better align with the new
behaviour of the Table constructor. Reworking the wrappers has knock-on
effects in the tests, but the changes are straight-forward.

Change-Id: I87e63daf0d28b93566f7e5cb565cbf0790428479
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/pnor_partition_table.hpp b/pnor_partition_table.hpp
index 88c8fb9..10dccdd 100644
--- a/pnor_partition_table.hpp
+++ b/pnor_partition_table.hpp
@@ -7,6 +7,7 @@
 #include <numeric>
 #include <experimental/filesystem>
 #include "common.h"
+#include "mbox.h"
 #include "pnor_partition_defs.h"
 
 namespace openpower
@@ -89,15 +90,11 @@
     /** @brief Constructor accepting the path of the directory
      *         that houses the PNOR partition files.
      *
-     *  @param[in] directory - path of the directory housing PNOR partitions
-     *  @param[in] blockSize - PNOR block size, in bytes. See
-     *             open-power/hostboot/blob/master/src/usr/pnor/ffs.h for
-     *             the PNOR FFS structure.
-     *  @param[in] pnorSize - PNOR size, in bytes
+     *  @param[in] ctx - Acquire sizes and paths relevant to the table
      *
      * Throws MalformedTocEntry, InvalidTocEntry
      */
-    Table(fs::path&& directory, size_t blockSize, size_t pnorSize);
+    Table(const struct mbox_context* ctx);
 
     Table(const Table&) = delete;
     Table& operator=(const Table&) = delete;
@@ -182,9 +179,11 @@
   private:
     /** @brief Prepares a vector of PNOR partition structures.
      *
+     *  @param[in] ctx - An mbox context providing partition locations
+     *
      * Throws: MalformedTocEntry, InvalidTocEntry
      */
-    void preparePartitions();
+    void preparePartitions(const struct mbox_context* ctx);
 
     /** @brief Prepares the PNOR header.
      */