Prashanth Katti | fa699cf | 2020-04-06 10:13:33 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Connections and authentication module stability tests. |
| 3 | |
| 4 | Resource ../lib/bmc_redfish_resource.robot |
| 5 | Resource ../lib/bmc_network_utils.robot |
| 6 | Resource ../lib/openbmc_ffdc.robot |
Anvesh Kumar Rayankula | 85df137 | 2020-04-28 05:01:14 -0500 | [diff] [blame] | 7 | Resource ../lib/resource.robot |
| 8 | Resource ../lib/utils.robot |
| 9 | Resource ../lib/connection_client.robot |
Prashanth Katti | fa699cf | 2020-04-06 10:13:33 -0500 | [diff] [blame] | 10 | Library ../lib/bmc_network_utils.py |
| 11 | |
Anvesh Kumar Rayankula | 85df137 | 2020-04-28 05:01:14 -0500 | [diff] [blame] | 12 | Library SSHLibrary |
Prashanth Katti | fa699cf | 2020-04-06 10:13:33 -0500 | [diff] [blame] | 13 | Library OperatingSystem |
| 14 | Library Collections |
| 15 | |
| 16 | *** Variables *** |
| 17 | |
Anvesh Kumar Rayankula | 85df137 | 2020-04-28 05:01:14 -0500 | [diff] [blame] | 18 | ${iterations} 10000 |
| 19 | ${hostname} test_hostname |
| 20 | ${MAX_UNAUTH_PER_IP} ${5} |
Prashanth Katti | fa699cf | 2020-04-06 10:13:33 -0500 | [diff] [blame] | 21 | |
| 22 | *** Test Cases *** |
| 23 | |
| 24 | Test Patch Without Auth Token Fails |
| 25 | [Documentation] Send patch method without auth token and verify it throws an error. |
| 26 | [Tags] Test Patch Without Auth Token Fails |
| 27 | |
| 28 | Redfish.Patch ${REDFISH_NW_PROTOCOL_URI} body={'HostName': '${hostname}'} |
| 29 | ... valid_status_codes=[${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}] |
| 30 | |
| 31 | |
| 32 | Flood Patch Without Auth Token And Check Stability Of BMC |
| 33 | [Documentation] Flood patch method without auth token and check BMC stability. |
| 34 | [Tags] Flood_Patch_Without_Auth_Token_And_Check_Stability_Of_BMC |
| 35 | @{status_list}= Create List |
| 36 | |
| 37 | FOR ${i} IN RANGE ${1} ${iterations} |
| 38 | Log To Console ${i}th iteration |
| 39 | Run Keyword And Ignore Error |
| 40 | ... Redfish.Patch ${REDFISH_NW_PROTOCOL_URI} body={'HostName': '${hostname}'} |
| 41 | |
| 42 | # Every 100th iteration, check BMC allows patch with auth token. |
| 43 | ${status}= Run Keyword If ${i} % 100 == 0 Run Keyword And Return Status |
| 44 | ... Login And Configure Hostname |
| 45 | Run Keyword If ${status} == False Append To List ${status_list} ${status} |
| 46 | END |
| 47 | ${verify_count}= Evaluate ${iterations}/100 |
| 48 | ${fail_count}= Get Length ${status_list} |
| 49 | |
| 50 | Should Be Equal ${fail_count} 0 msg=Patch operation failed ${fail_count} times in ${verify_count} attempts |
| 51 | |
| 52 | |
Anvesh Kumar Rayankula | 85df137 | 2020-04-28 05:01:14 -0500 | [diff] [blame] | 53 | Verify Uer Cannot Login After 5 Non-Logged In Sessions |
| 54 | [Documentation] User should not be able to login when there |
| 55 | ... are 5 non-logged in sessions. |
| 56 | [Tags] Verify_User_Cannot_Login_After_5_Non-Logged_In_Sessions |
| 57 | |
| 58 | FOR ${i} IN RANGE ${0} ${MAX_UNAUTH_PER_IP} |
| 59 | SSHLibrary.Open Connection ${OPENBMC_HOST} |
| 60 | Start Process ssh ${OPENBMC_USERNAME}@${OPENBMC_HOST} shell=True |
| 61 | END |
| 62 | |
| 63 | SSHLibrary.Open Connection ${OPENBMC_HOST} |
| 64 | ${status}= Run Keyword And Return Status SSHLibrary.Login ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} |
| 65 | Should Be Equal ${status} ${False} |
| 66 | |
| 67 | |
Prashanth Katti | fa699cf | 2020-04-06 10:13:33 -0500 | [diff] [blame] | 68 | *** Keywords *** |
| 69 | |
| 70 | Login And Configure Hostname |
| 71 | [Documentation] Login and configure hostname |
| 72 | |
| 73 | [Teardown] Redfish.Logout |
| 74 | |
| 75 | Redfish.Login |
| 76 | |
| 77 | Redfish.patch ${REDFISH_NW_PROTOCOL_URI} body={'HostName': '${hostname}'} |
| 78 | ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}] |
| 79 | |