binarystore: Add ReadOnly Mode

Add Read Only mode to the binary store. In this mode,
all blobs are not writable, no new blobs can be created and
the storage protobuf can't be modified in any way.

Also added simple API for reading/examining blob store
without modifying it.

Signed-off-by: Maksym Sloyko <maxims@google.com>
Change-Id: I12e3473351be98820d8e5df1b71a6d43699aa671
diff --git a/test/Makefile.am b/test/Makefile.am
index 742e7e2..2e07b58 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -19,7 +19,8 @@
 	handler_stat_unittest \
 	handler_open_unittest \
 	handler_readwrite_unittest \
-	handler_unittest
+	handler_unittest \
+	binarystore_unittest
 TESTS = $(check_PROGRAMS)
 
 parse_config_unittest_SOURCES = parse_config_unittest.cpp
@@ -71,3 +72,10 @@
 	$(top_builddir)/libbinarystore_la-binaryblob.pb.o \
 	-lprotobuf
 handler_readwrite_unittest_CXXFLAGS = $(PHOSPHOR_LOGGING_CFLAGS)
+
+binarystore_unittest_SOURCES = binarystore_unittest.cpp
+binarystore_unittest_LDADD = $(PHOSPHOR_LOGGING_LIBS) \
+	$(top_builddir)/binarystore.o \
+	$(top_builddir)/libbinarystore_la-binaryblob.pb.o \
+	-lprotobuf
+binarystore_unittest_CXXFLAGS = $(PHOSPHOR_LOGGING_CFLAGS)