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 |
| 11 | Test Teardown Test Teardown Execution |
| 12 | |
| 13 | *** Test Cases *** |
| 14 | |
| 15 | Expire Root Password And Check IPMI Access Fails |
| 16 | [Documentation] Expire root user password and expect an error while access via IPMI. |
| 17 | [Tags] Expire_Root_Password_And_Check_IPMI_Access_Fails |
| 18 | [Teardown] Run Keywords FFDC On Test Case Fail AND |
| 19 | ... Wait Until Keyword Succeeds 1 min 10 sec |
| 20 | ... Restore Default Password For Root User |
| 21 | |
| 22 | Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} |
| 23 | |
| 24 | ${output} ${stderr} ${rc}= BMC Execute Command passwd --expire ${OPENBMC_USERNAME} |
| 25 | Should Contain ${output} password expiry information changed |
| 26 | |
| 27 | ${status}= Run Keyword And Return Status Run External IPMI Standard Command lan print -v |
| 28 | Should Be Equal ${status} ${False} |
| 29 | |
| 30 | |
| 31 | *** Keywords *** |
| 32 | |
| 33 | Test Setup Execution |
| 34 | [Documentation] Test setup execution. |
| 35 | |
| 36 | Redfish.login |
| 37 | Valid Length OPENBMC_PASSWORD min_length=8 |
| 38 | |
| 39 | Restore Default Password For Root User |
| 40 | [Documentation] Restore default password for root user (i.e. 0penBmc). |
| 41 | |
| 42 | # Set default password for root user. |
| 43 | ${result}= Redfish.Patch /redfish/v1/AccountService/Accounts/${OPENBMC_USERNAME} |
| 44 | ... body={'Password': '${OPENBMC_PASSWORD}'} |
| 45 | # Verify that root user is able to run Redfish command using default password. |
| 46 | Redfish.login |