test: write the vpnor file(flash)

Add the test binary which runs the following test cases
1) Write to the read only partition
2) Write to the RW partition
3) Write to the preserved partition.
4) Write beyond the partition file length.
5) other boundary test cases.

Resolves openbmc/openbmc#1479

Change-Id: Ifd4f0e89e434a26e2579415a973fe1bfdbb3e66f
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/Makefile.am b/Makefile.am
index 4f49644..4e59529 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -164,6 +164,20 @@
 	$(PHOSPHOR_LOGGING_LIBS) \
 	$(PHOSPHOR_DBUS_INTERFACES_LIBS)
 
+test_write_flash_vpnor_SOURCES = \
+	$(TEST_MBOX_VPNOR_SRCS) \
+	mboxd_flash.c \
+	mboxd_pnor_partition_table.cpp \
+	mboxd_flash_virtual.cpp \
+	mtd.c \
+	pnor_partition.cpp \
+	test/write_flash_vpnor.cpp
+test_write_flash_vpnor_LDFLAGS = $(OESDK_TESTCASE_FLAGS)
+test_write_flash_vpnor_LDADD = -lstdc++fs \
+	$(SDBUSPLUS_LIBS) \
+	$(PHOSPHOR_LOGGING_LIBS) \
+	$(PHOSPHOR_DBUS_INTERFACES_LIBS)
+
 check_PROGRAMS = test/sanity \
 		 test/copy_flash \
 		 test/erase_flash \
@@ -195,7 +209,8 @@
 if VIRTUAL_PNOR_ENABLED
 check_PROGRAMS += \
 	test/create_pnor_partition_table \
-	test/create_read_window_vpnor
+	test/create_read_window_vpnor \
+	test/write_flash_vpnor
 endif
 
 TESTS = $(check_PROGRAMS)