test: vpnor: Use MAP_SHARED for read-only file memory map

It's not well defined whether a private mapping of a resource that is
MAP_SHARED on a separate file descriptor will see the updates done via
the shared mapping, though under Linux if the private mapping is not
written then we can expect updates from the shared mapping to propagate
(copy-on-write). However, we get a concrete guarantee of the desired
behaviour (observing the effects of the write) if we use MAP_SHARED.

Change-Id: If6a053209a979ee5b96ed09c60fbbd9bdb060a32
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/vpnor/test/write_prsv.cpp b/vpnor/test/write_prsv.cpp
index 26f1d86..6e0ca0f 100644
--- a/vpnor/test/write_prsv.cpp
+++ b/vpnor/test/write_prsv.cpp
@@ -49,7 +49,7 @@
     /* Verify */
     fd = open((root.prsv() / "TEST1").c_str(), O_RDONLY);
     assert(fd >= 0);
-    map = mmap(NULL, sizeof(src), PROT_READ, MAP_PRIVATE, fd, 0);
+    map = mmap(NULL, sizeof(src), PROT_READ, MAP_SHARED, fd, 0);
     assert(map != MAP_FAILED);
 
     rc = memcmp(src, map, sizeof(src));
diff --git a/vpnor/test/write_rw.cpp b/vpnor/test/write_rw.cpp
index 1ee5c6c..1c4bd38 100644
--- a/vpnor/test/write_rw.cpp
+++ b/vpnor/test/write_rw.cpp
@@ -47,7 +47,7 @@
     rc = write_flash(ctx, 0x1000, src, sizeof(src));
     assert(rc == 0);
     fd = open((root.rw() / "TEST1").c_str(), O_RDONLY);
-    map = mmap(NULL, sizeof(src), PROT_READ, MAP_PRIVATE, fd, 0);
+    map = mmap(NULL, sizeof(src), PROT_READ, MAP_SHARED, fd, 0);
     assert(map != MAP_FAILED);
     rc = memcmp(src, map, sizeof(src));
     assert(rc == 0);