OEM Inband IPMI factory reset

Changes:
    - Minor existing IPMI client fixes.
    - Added test to factory reset BMC via Host.

Resolves  openbmc/openbmc-test-automation#1444

Change-Id: Icde753a16df59e5da062ae78bbb449b7c004534f
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/ipmi_client.robot b/lib/ipmi_client.robot
index 9d8a93c..4f6e0f2 100755
--- a/lib/ipmi_client.robot
+++ b/lib/ipmi_client.robot
@@ -27,9 +27,9 @@
     [Documentation]  Run the given IPMI command.
     [Arguments]  ${args}
     ${resp}=  Run Keyword If  '${IPMI_COMMAND}' == 'External'
-    ...  Run External IPMI RAW Command  ${args}
+    ...  Run External IPMI Raw Command  ${args}
     ...  ELSE IF  '${IPMI_COMMAND}' == 'Inband'
-    ...  Run Inband IPMI RAW Command  ${args}
+    ...  Run Inband IPMI Raw Command  ${args}
     ...  ELSE IF  '${IPMI_COMMAND}' == 'Dbus'
     ...  Run Dbus IPMI RAW Command  ${args}
     ...  ELSE  Fail  msg=Invalid IPMI Command type provided : ${IPMI_COMMAND}
@@ -106,7 +106,7 @@
     Should Be Empty  ${stderr}  msg=${stdout}
     [Return]  ${stdout}
 
-Run External IPMI RAW Command
+Run External IPMI Raw Command
     [Documentation]  Run the raw IPMI command externally.
     [Arguments]    ${args}
     ${ipmi_raw_cmd}=   Catenate  SEPARATOR=
@@ -291,3 +291,20 @@
     ${output}=  Fetch From Right  ${output}  ${SPACE}
 
     [Return]  ${output}
+
+
+Set BMC Network From Host
+    [Documentation]  Set BMC network from host.
+    [Arguments]  ${nw_info}
+
+    # Description of argument(s):
+    # nw_info    A dictionary containing the network information to apply.
+
+    Run Inband IPMI Standard Command
+    ...  lan set 1 ipaddr ${nw_info['IP Address']}
+
+    Run Inband IPMI Standard Command
+    ...  lan set 1 netmask ${nw_info['Subnet Mask']}
+
+    Run Inband IPMI Standard Command
+    ...  lan set 1 defgw ipaddr ${nw_info['Default Gateway IP']}