Add support to collect OEM redfish path in FFDC

Changes:
     - Added new keyword to collect OEM redfish properties.
     - Added new variable OEM_REDFISH_PATH

Tested:
    robot -v OPENBMC_HOST:xx.xx.xx.xx -v OEM_REDFISH_PATH:/ibm/v1  tools/myffdc.robot

User can key in their own OEM path in the command line as above.

Change-Id: Ibdcd80bb3036a1f460320cb275e6267b8f4e1561
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/bmc_redfish_utils.py b/lib/bmc_redfish_utils.py
index 8ba416a..21358d7 100644
--- a/lib/bmc_redfish_utils.py
+++ b/lib/bmc_redfish_utils.py
@@ -297,7 +297,7 @@
                     continue
 
                 self._rest_response_ = \
-                    self._redfish_.get(resource, valid_status_codes=[200, 404, 500])
+                    self._redfish_.get(resource, valid_status_codes=[200, 404, 405, 500])
                 # Enumeration is done for available resources ignoring the
                 # ones for which response is not obtained.
                 if self._rest_response_.status != 200:
diff --git a/lib/openbmc_ffdc_list.py b/lib/openbmc_ffdc_list.py
index cacb95f..e1abf61 100755
--- a/lib/openbmc_ffdc_list.py
+++ b/lib/openbmc_ffdc_list.py
@@ -167,6 +167,7 @@
         'Dump HB Files': 'SCP Dump HB Files',
         'PEL Files': 'Collect PEL Log',
         'Redfish Log': 'Enumerate Redfish Resources',
+        'Redfish OEM Log': 'Enumerate Redfish OEM Resources',
     },
 }
 
diff --git a/lib/openbmc_ffdc_methods.robot b/lib/openbmc_ffdc_methods.robot
index 17ed80a..c13d16e 100755
--- a/lib/openbmc_ffdc_methods.robot
+++ b/lib/openbmc_ffdc_methods.robot
@@ -585,6 +585,36 @@
     [Return]  ${ffdc_file_list}
 
 
+Enumerate Redfish OEM Resources
+    [Documentation]  Enumerate /<oem>/v1 resources and properties to
+    ...              a file. Return a list which contains the file name.
+    [Arguments]  ${log_prefix_path}=${LOG_PREFIX}
+
+    # Description of argument(s):
+    # log_prefix_path    The location specifying where to create FFDC file(s).
+
+    # No-op by default if input is not supplied from command line.
+    Return From Keyword If   "${OEM_REDFISH_PATH}" == "${EMPTY}"
+
+    # Login is needed to fetch Redfish information.
+    # If login fails, return from keyword.
+    ${status}=  Run Keyword And Return Status  Redfish.Login
+    Return From Keyword If   ${status} == ${False}
+
+    # Get the Redfish resources and properties.
+    ${json_data}=  redfish_utils.Enumerate Request  ${OEM_REDFISH_PATH}
+
+    @{ffdc_file_list}=  Create List
+    ${logpath}=  Catenate  SEPARATOR=  ${log_prefix_path}
+    ...  redfish_oem_resource_properties.txt
+    Create File  ${logpath}
+    Write Data To File  "${\n}${json_data}${\n}"  ${logpath}
+
+    Append To List  ${ffdc_file_list}  ${logpath}
+
+    [Return]  ${ffdc_file_list}
+
+
 Collect eSEL Log
     [Documentation]  Create raw and formatted eSEL files.
     [Arguments]  ${log_prefix_path}=${LOG_PREFIX}
diff --git a/lib/resource.robot b/lib/resource.robot
index a758074..76d1e7c 100755
--- a/lib/resource.robot
+++ b/lib/resource.robot
@@ -10,6 +10,9 @@
 # By default power, support x86 as well.
 ${PLATFORM_ARCH_TYPE}             power
 
+# FFDC Redfish OEM path /<oem>/v1/
+${OEM_REDFISH_PATH}               ${EMPTY}
+
 # Transition REST vs Redfish ONLY temporary changes for stagging
 # automation infrastructure change and for continuity.
 ${REDFISH_SUPPORT_TRANS_STATE}    ${0}