Anves Kumar rayankula | a87b1b1 | 2020-05-06 01:18:28 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test root user expire password. |
| 3 | |
| 4 | Resource ../lib/resource.robot |
| 5 | Resource ../lib/bmc_redfish_resource.robot |
| 6 | Resource ../lib/ipmi_client.robot |
| 7 | Library ../lib/bmc_ssh_utils.py |
| 8 | Library SSHLibrary |
| 9 | |
| 10 | Test Setup Test Setup Execution |
Anves Kumar rayankula | a87b1b1 | 2020-05-06 01:18:28 -0500 | [diff] [blame] | 11 | |
| 12 | *** Test Cases *** |
| 13 | |
| 14 | Expire Root Password And Check IPMI Access Fails |
| 15 | [Documentation] Expire root user password and expect an error while access via IPMI. |
| 16 | [Tags] Expire_Root_Password_And_Check_IPMI_Access_Fails |
Anves Kumar rayankula | 6792114 | 2020-05-14 04:03:24 -0500 | [diff] [blame] | 17 | [Teardown] Run Keywords Wait Until Keyword Succeeds 1 min 10 sec |
| 18 | ... Restore Default Password For Root User AND FFDC On Test Case Fail |
Anves Kumar rayankula | a87b1b1 | 2020-05-06 01:18:28 -0500 | [diff] [blame] | 19 | |
| 20 | Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} |
| 21 | |
| 22 | ${output} ${stderr} ${rc}= BMC Execute Command passwd --expire ${OPENBMC_USERNAME} |
| 23 | Should Contain ${output} password expiry information changed |
| 24 | |
| 25 | ${status}= Run Keyword And Return Status Run External IPMI Standard Command lan print -v |
| 26 | Should Be Equal ${status} ${False} |
| 27 | |
Anves Kumar rayankula | 6792114 | 2020-05-14 04:03:24 -0500 | [diff] [blame] | 28 | Expire And Change Root User Password And Access Via SSH |
| 29 | [Documentation] Expire and change root user password and access via SSH. |
| 30 | [Tags] Expire_Root_User_Password_And_Access_Via_SSH |
| 31 | [Teardown] Run Keywords Wait Until Keyword Succeeds 1 min 10 sec |
| 32 | ... Restore Default Password For Root User AND FFDC On Test Case Fail |
| 33 | |
| 34 | Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} |
| 35 | |
| 36 | ${output} ${stderr} ${rc}= BMC Execute Command passwd --expire ${OPENBMC_USERNAME} |
| 37 | Should Contain ${output} password expiry information changed |
| 38 | |
| 39 | # Change to a valid password. |
| 40 | ${resp}= Redfish.Patch /redfish/v1/AccountService/Accounts/${OPENBMC_USERNAME} |
| 41 | ... body={'Password': '0penBmc123'} valid_status_codes=[${HTTP_OK}] |
| 42 | |
| 43 | # Verify login with the new password through SSH. |
| 44 | Open Connection And Log In ${OPENBMC_USERNAME} 0penBmc123 |
| 45 | |
| 46 | |
| 47 | Expire Root Password And Update Bad Password Length Via Redfish |
| 48 | [Documentation] Expire root password and update bad password via Redfish and expect an error. |
| 49 | [Tags] Expire_Root_Password_And_Update_Bad_Password_Length_Via_Redfish |
| 50 | [Teardown] Run Keywords Wait Until Keyword Succeeds 1 min 10 sec |
| 51 | ... Restore Default Password For Root User AND FFDC On Test Case Fail |
| 52 | |
| 53 | Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} |
| 54 | ${output} ${stderr} ${rc}= BMC Execute Command passwd --expire ${OPENBMC_USERNAME} |
| 55 | Should Contain ${output} password expiry information changed |
| 56 | |
| 57 | ${status}= Run Keyword And Return Status |
| 58 | ... Redfish.Patch /redfish/v1/AccountService/Accounts/${OPENBMC_USERNAME} |
| 59 | ... body={'Password': '0penBmc0penBmc0penBmc'} |
| 60 | Should Be Equal ${status} ${False} |
Anves Kumar rayankula | a87b1b1 | 2020-05-06 01:18:28 -0500 | [diff] [blame] | 61 | |
| 62 | *** Keywords *** |
| 63 | |
| 64 | Test Setup Execution |
| 65 | [Documentation] Test setup execution. |
| 66 | |
| 67 | Redfish.login |
| 68 | Valid Length OPENBMC_PASSWORD min_length=8 |
| 69 | |
| 70 | Restore Default Password For Root User |
| 71 | [Documentation] Restore default password for root user (i.e. 0penBmc). |
| 72 | |
| 73 | # Set default password for root user. |
Anves Kumar rayankula | 6792114 | 2020-05-14 04:03:24 -0500 | [diff] [blame] | 74 | Redfish.Patch /redfish/v1/AccountService/Accounts/${OPENBMC_USERNAME} |
| 75 | ... body={'Password': '${OPENBMC_PASSWORD}'} valid_status_codes=[${HTTP_OK}] |
Anves Kumar rayankula | a87b1b1 | 2020-05-06 01:18:28 -0500 | [diff] [blame] | 76 | # Verify that root user is able to run Redfish command using default password. |
| 77 | Redfish.login |
Anves Kumar rayankula | 6792114 | 2020-05-14 04:03:24 -0500 | [diff] [blame] | 78 | |