libpldmresponder getBiosTable: delete bios tables

This commit deletes all the three persistent bios tables before
serving a request to getBIOSTable for type "string". This is done
to make the BIOS tables consistent with the corresponding dbus property
values which might have changed after the tables are constructed and
sent over to Host.

Change-Id: Ic9bea66a2db5e2313d13423688a6b3e8bb127c9c
Signed-off-by: Sampa Misra <sampmisr@in.ibm.com>
diff --git a/libpldmresponder/bios.cpp b/libpldmresponder/bios.cpp
index 3f379cb..a246bb7 100644
--- a/libpldmresponder/bios.cpp
+++ b/libpldmresponder/bios.cpp
@@ -1004,9 +1004,23 @@
     switch (tableType)
     {
         case PLDM_BIOS_STRING_TABLE:
+        {
+            try
+            {
+                fs::remove(fs::path(std::string(BIOS_TABLES_DIR) + "/" +
+                                    stringTableFile));
+                fs::remove(fs::path(std::string(BIOS_TABLES_DIR) + "/" +
+                                    attrTableFile));
+                fs::remove(fs::path(std::string(BIOS_TABLES_DIR) + "/" +
+                                    attrValTableFile));
+            }
+            catch (const std::exception& e)
+            {
+            }
 
             response = getBIOSStringTable(biosStringTable, request);
-            break;
+        }
+        break;
         case PLDM_BIOS_ATTR_TABLE:
 
             if (biosStringTable.isEmpty())