Method to split FFDC files by time stamp

There is no major change from the existing logic but more of a
restructuring for maintainability.

The changes introduces the following functionaliies
   - Split FFDC into files by failure time stamp
   - Remove SCP logic and use execute and create logic flow
   - Add method call to directly invoke user define keywords
     as part of the default FFDC list
   - Method to save test case execution history

Resolves openbmc/openbmc-test-automation#77

Change-Id: Ia16fdde942a5e9cbf6909f1530e9c6f2a1c6ab0a
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/openbmc_ffdc_list.py b/lib/openbmc_ffdc_list.py
index 3a2950a..15cd86f 100644
--- a/lib/openbmc_ffdc_list.py
+++ b/lib/openbmc_ffdc_list.py
@@ -2,7 +2,6 @@
 '''
 #############################################################
 #    @file     openbmc_ffdc_list.py
-#    @author:  George Keishing
 #
 #    @brief    List for FFDC ( First failure data capture )
 #              commands and files to be collected as a part
@@ -17,17 +16,20 @@
 #-----------------------------------------------------------------
 #Dict Name {  Index string : { Key String :  Comand string} }
 #-----------------------------------------------------------------
-FFDC_CMD = {
+# Add cmd's needed to be part of the ffdc report manifest file
+FFDC_BMC_CMD = {
              'DRIVER INFO' :
                      {
-                        'FW Level' : 'cat /etc/os-release',
-                        'OS Details' : 'uname -a',
+                        #String Name         Command
                         'Build Info' : 'cat /etc/version',
+                        'FW Level'   : 'cat /etc/os-release',
                      },
              'BMC DATA' :
                      {
-                        'System journal log' : 'journalctl --no-pager',
-                        'Displays processor activity' : 'top -n 1 -b',
+                        'BMC OS'     : 'uname -a',
+                        'BMC Uptime' : 'uptime',
+                        'BMC Proc Info' : 'cat /proc/cpuinfo',
+                        'BMC File System Disk Space Usage' : 'df -hT',
                      },
              'APPLICATION DATA' :
                      {
@@ -35,13 +37,23 @@
                      },
            }
 
-# add file list needed to be offload from BMC
-FFDC_FILE = {
+# Add file name and correcponding command needed for BMC
+FFDC_BMC_FILE = {
              'BMC FILES' :
                      {
-                        # Sample example how to add the file that
-                        # is needed to be offloaded
-                        #'Release info' : '/etc/os-release',
+                        #File Name         Command
+                        'BMC_proc_list' : 'top -n 1 -b',
+                        'BMC_journalctl.log' : 'journalctl --no-pager',
+                     },
+           }
+
+# Define your keywords in method/utils and call here
+FFDC_METHOD_CALL = {
+             'BMC LOGS' :
+                     {
+                        #Description             Keyword name 
+                        'FFDC Generic Report' : 'BMC FFDC Manifest',
+                        'BMC Specific Files'  : 'BMC FFDC Files',
                      },
            }
 
@@ -52,27 +64,48 @@
 class openbmc_ffdc_list():
 
     ########################################################################
-    #   @@brief   This method returns the list from the dictionary for cmds
+    #   @brief    This method returns the list from the dictionary for cmds
     #   @param    i_type: @type string: string index lookup
     #   @return   List of key pair from the dictionary
     ########################################################################
-    def get_ffdc_cmd(self,i_type):
-        return FFDC_CMD[i_type].items()
+    def get_ffdc_bmc_cmd(self,i_type):
+        return FFDC_BMC_CMD[i_type].items()
 
     ########################################################################
-    #   @@brief   This method returns the list from the dictionary for scp
+    #   @brief    This method returns the list from the dictionary for scp
     #   @param    i_type: @type string: string index lookup
     #   @return   List of key pair from the dictionary
     ########################################################################
-    def get_ffdc_file(self,i_type):
-        return FFDC_FILE[i_type].items()
+    def get_ffdc_bmc_file(self,i_type):
+        return FFDC_BMC_FILE[i_type].items()
 
     ########################################################################
-    #   @@brief   This method returns the list index from dictionary
+    #   @brief    This method returns the list index from dictionary
     #   @return   List of index to the dictionary
     ########################################################################
-    def get_ffdc_index(self):
-        return FFDC_CMD.keys()
+    def get_ffdc_cmd_index(self):
+        return FFDC_BMC_CMD.keys()
+
+    ########################################################################
+    #   @brief    This method returns the list index from dictionary
+    #   @return   List of index to the dictionary
+    ########################################################################
+    def get_ffdc_file_index(self):
+        return FFDC_BMC_FILE.keys()
+
+    ########################################################################
+    #   @brief    This method returns the key pair from the dictionary
+    #   @return   Index of the method dictionary
+    ########################################################################
+    def get_ffdc_method_index(self):
+        return FFDC_METHOD_CALL.keys()
+
+    ########################################################################
+    #   @brief    This method returns the key pair from the dictionary
+    #   @return   List of key pair keywords
+    ########################################################################
+    def get_ffdc_method_call(self,i_type):
+        return FFDC_METHOD_CALL[i_type].items()
 
     ########################################################################
     #   @brief    Returns the stripped strings
@@ -81,4 +114,3 @@
     ########################################################################
     def get_strip_string(self, i_str):
         return ''.join(e for e in i_str if e.isalnum())
-