BMC stress test using REST/SSH/IPMI operations

Added:
   - Multiple REST operation
   - Multiple SSH operation
   - Multiple IPMI operation

Resolves  openbmc/openbmc-test-automation#743

Change-Id: Ib4b484aa030fad3f5b7764b489b2c4604b914b34
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/extended/test_bmc_stress_buster.robot b/extended/test_bmc_stress_buster.robot
new file mode 100644
index 0000000..4eff895
--- /dev/null
+++ b/extended/test_bmc_stress_buster.robot
@@ -0,0 +1,76 @@
+***Settings***
+Documentation   Generic REST/SSH/IPMI stress buster program.
+
+Library        ../lib/jobs_processing.py
+Resource       ../lib/rest_client.robot
+Resource       ../lib/connection_client.robot
+Resource       ../lib/ipmi_client.robot
+Resource       ../lib/utils.robot
+Resource       ../lib/openbmc_ffdc.robot
+
+Test Teardown  FFDC On Test Case Fail
+
+***Variables***
+
+# Caller can specify a value for the following using -v parms
+# Currently REST/SSH/IPMI session allowed.
+${REST_BUSTER_MAX}    ${16}
+${SSH_BUSTER_MAX}     ${16}
+${IPMI_BUSTER_MAX}    ${5}
+
+***Test Cases***
+
+Stress BMC REST Server
+    [Documentation]  Execute maximum allowed REST operation.
+    [Tags]  Stress_BMC_REST_Server
+    ${dict}=  Execute Process
+    ...  ${REST_BUSTER_MAX}  REST Enumerate Request On BMC
+    Dictionary Should Not Contain Value  ${dict}  False
+    ...  msg=One or more REST operations has failed.
+
+
+Stress BMC SSH Server
+    [Documentation]  Execute maximum allowed SSH operation.
+    [Tags]  Stress_BMC_SSH_Server
+    ${dict}=  Execute Process
+    ...  ${SSH_BUSTER_MAX}  SSH Connect And Execute Command
+    Dictionary Should Not Contain Value  ${dict}  False
+    ...  msg=One or more SSH operations has failed.
+
+
+Stress BMC IPMI Server
+    [Documentation]  Execute maximum allowed IPMI operation.
+    [Tags]  Stress_BMC_IPMI_Server
+    ${dict}=  Execute Process  ${IPMI_BUSTER_MAX}  IPMI Check Status
+    Dictionary Should Not Contain Value  ${dict}  False
+    ...  msg=One or more IPMI operations has failed.
+
+***Keywords***
+
+REST Enumerate Request On BMC
+    [Documentation]  Execute REST GET operation.
+
+    # Create REST session.
+    Create Session  openbmc  ${AUTH_URI}
+    ${headers}=  Create Dictionary  Content-Type=application/json
+    @{credentials}=  Create List  ${OPENBMC_USERNAME}  ${OPENBMC_PASSWORD}
+    ${data}=  Create Dictionary  data=@{credentials}
+    ${resp}=  Post Request  openbmc  /login  data=${data}  headers=${headers}
+    Should Be Equal As Strings  ${resp.status_code}  ${HTTP_OK}
+
+    # Trigger GET REST enumeration.
+    ${resp}=  Get Request  openbmc  /xyz/openbmc_project/software/enumerate
+    Should Be Equal As Strings  ${resp.status_code}  ${HTTP_OK}
+    Delete All Sessions
+
+
+SSH Connect And Execute Command
+    [Documentation]  Execute SSH command execution operation.
+    Open Connection And Log In
+    Execute Command On BMC  df -h
+    Close Connection
+
+
+IPMI Check Status
+    [Documentation]  Execute IPMI command execution operation.
+    Run IPMI Standard Command  chassis status
diff --git a/lib/jobs_processing.py b/lib/jobs_processing.py
index c730652..901cffb 100644
--- a/lib/jobs_processing.py
+++ b/lib/jobs_processing.py
@@ -21,16 +21,16 @@
 
     Description of argument(s):
     keyword_name    Keyword name to be executed.
-    return_dict     A dictionary consisting of pid/process output for the
+    return_dict     A dictionary consisting of pid/process status for the
                     keys/values. This function will append a new entry to
                     this dictionary.
     """
 
     pid = os.getpid()
-    output = BuiltIn().run_keyword(keyword_name)
+    status = BuiltIn().run_keyword_and_return_status(keyword_name)
 
-    # Build PID:<output> dictionary.
-    return_dict[str(pid)] = str(output)
+    # Build PID:<status> dictionary.
+    return_dict[str(pid)] = str(status)
 
 ###############################################################################