Added IPMI and SSH stability for large network traffic

Signed-off-by: Prashanth Katti <prkatti1@in.ibm.com>
Change-Id: Ic6452eb7d871e7f0edf2faa29e11e666590c1754
diff --git a/security/test_bmc_network_security.robot b/security/test_bmc_network_security.robot
index 529e024..e6becb8 100644
--- a/security/test_bmc_network_security.robot
+++ b/security/test_bmc_network_security.robot
@@ -2,12 +2,14 @@
 Documentation  Network stack stress tests using "nping" tool.
 
 Resource                ../lib/resource.robot
-Resource                ../../lib/bmc_redfish_resource.robot
+Resource                ../lib/bmc_redfish_resource.robot
+Resource                ../lib/ipmi_client.robot
 
 Library                 OperatingSystem
 Library                 String
 Library                 ../lib/gen_robot_valid.py
 Library                 ../lib/bmc_network_utils.py
+Library                 ../lib/ipmi_utils.py
 
 Suite Setup             Suite Setup Execution
 
@@ -18,6 +20,7 @@
 ${delay}                1000ms
 ${count}                4
 ${program_name}         nping
+${iterations}           5000
 
 *** Test Cases ***
 
@@ -47,7 +50,7 @@
 
     # Send large number of packets to Redfish interface.
     ${packet_loss}=  Send Network Packets And Get Packet Loss
-    ...  ${OPENBMC_HOST}  5000  ${TCP_PACKETS}  ${REDFISH_INTERFACE}
+    ...  ${OPENBMC_HOST}  ${iterations}  ${TCP_PACKETS}  ${REDFISH_INTERFACE}
     Should Be Equal  ${packet_loss}  0.0
     ...  msg=FAILURE: BMC is dropping some packets.
 
@@ -55,6 +58,37 @@
     Redfish.Login
     Redfish.Logout
 
+
+Send Network Packets Continuously To IPMI Port
+    [Documentation]  Send network packets continuously to IPMI port and verify stability.
+    [Tags]  Send_Network_Packets_Continuously_To_IPMI_Port
+
+    # Send large number of packets to IPMI port.
+    ${packet_loss}=  Send Network Packets And Get Packet Loss
+    ...  ${OPENBMC_HOST}  ${iterations}  ${TCP_PACKETS}  ${IPMI_PORT}
+    Should Be Equal  ${packet_loss}  0.0
+    ...  msg=FAILURE: BMC is dropping some packets.
+
+    # Check if IPMI interface is functional.
+    Run IPMI Standard Command  chassis status
+
+
+Send Network Packets Continuously To SSH Port
+    [Documentation]  Send network packets continuously to SSH port and verify stability.
+    [Tags]  Send_Network_Packets_Continuously_To_SSH_Port
+
+    # Send large number of packets to SSH port.
+    ${packet_loss}=  Send Network Packets And Get Packet Loss
+    ...  ${OPENBMC_HOST}  ${iterations}  ${TCP_PACKETS}  ${SSH_PORT}
+    Should Be Equal  ${packet_loss}  0.0
+    ...  msg=FAILURE: BMC is dropping some packets.
+
+    # Check if SSH interface is functional.
+
+    SSHLibrary.Open Connection  ${OPENBMC_HOST}
+    Open Connection And Log In  ${OPENBMC_USERNAME}  ${OPENBMC_PASSWORD}
+
+
 *** Keywords ***
 
 Suite Setup Execution