blob: d785d8d12c601d22faca42bf804dc053c8f1c9de [file] [log] [blame]
Prashanth Kattifa699cf2020-04-06 10:13:33 -05001*** Settings ***
2Documentation Connections and authentication module stability tests.
3
4Resource ../lib/bmc_redfish_resource.robot
5Resource ../lib/bmc_network_utils.robot
6Resource ../lib/openbmc_ffdc.robot
Anvesh Kumar Rayankula85df1372020-04-28 05:01:14 -05007Resource ../lib/resource.robot
8Resource ../lib/utils.robot
9Resource ../lib/connection_client.robot
Prashanth Kattifa699cf2020-04-06 10:13:33 -050010Library ../lib/bmc_network_utils.py
11
Anvesh Kumar Rayankula85df1372020-04-28 05:01:14 -050012Library SSHLibrary
Prashanth Kattifa699cf2020-04-06 10:13:33 -050013Library OperatingSystem
14Library Collections
15
16*** Variables ***
17
Anvesh Kumar Rayankula85df1372020-04-28 05:01:14 -050018${iterations} 10000
19${hostname} test_hostname
20${MAX_UNAUTH_PER_IP} ${5}
Prashanth Kattifa699cf2020-04-06 10:13:33 -050021
22*** Test Cases ***
23
24Test Patch Without Auth Token Fails
25 [Documentation] Send patch method without auth token and verify it throws an error.
George Keishing966a4c52020-05-13 10:53:58 -050026 [Tags] Test_Patch_Without_Auth_Token_Fails
Prashanth Kattifa699cf2020-04-06 10:13:33 -050027
28 Redfish.Patch ${REDFISH_NW_PROTOCOL_URI} body={'HostName': '${hostname}'}
29 ... valid_status_codes=[${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}]
30
31
32Flood 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 Rayankula85df1372020-04-28 05:01:14 -050053Verify 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 Kattifa699cf2020-04-06 10:13:33 -050068*** Keywords ***
69
70Login 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