George Keishing | 61364e5 | 2019-10-01 12:01:19 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation OpenBMC user management test. |
| 3 | |
| 4 | Resource ../lib/rest_client.robot |
| 5 | Resource ../lib/openbmc_ffdc.robot |
| 6 | Resource ../lib/utils.robot |
| 7 | Library SSHLibrary |
| 8 | |
| 9 | Test Teardown Test Teardown Execution |
| 10 | |
| 11 | *** Variables **** |
| 12 | |
| 13 | ${test_password} 0penBmc123 |
| 14 | |
| 15 | *** Test Cases *** |
| 16 | |
| 17 | |
| 18 | Verify At Least One User In List |
| 19 | [Documentation] Verify user list API list minimum one user. |
| 20 | [Tags] Verify_At_Least_One_User_In_List |
| 21 | [Teardown] FFDC On Test Case Fail |
| 22 | |
| 23 | ${bmc_user_uris}= Read Properties ${BMC_USER_URI}list |
| 24 | Valid Value bmc_user_uris |
| 25 | |
| 26 | |
| 27 | Verify Root Password Update |
| 28 | [Documentation] Update system "root" user password and verify. |
| 29 | [Tags] Verify_Root_Password_Update |
| 30 | |
| 31 | Delete All Sessions |
| 32 | |
| 33 | Initialize OpenBMC |
| 34 | Update Root Password ${test_password} |
| 35 | |
| 36 | # Time for user manager to sync. |
| 37 | Sleep 5 s |
| 38 | |
| 39 | Delete All Sessions |
| 40 | |
| 41 | # SSH Login to BMC with new "root" password. |
| 42 | SSHLibrary.Open Connection ${OPENBMC_HOST} |
| 43 | SSHLibrary.Login ${OPENBMC_USERNAME} ${test_password} |
| 44 | |
| 45 | # REST Login to BMC with new "root" password. |
| 46 | Initialize OpenBMC rest_password=${test_password} |
| 47 | |
| 48 | ${resp}= Get Request openbmc ${BMC_USER_URI}enumerate |
| 49 | Valid Value resp.status_code [${HTTP_OK}] |
| 50 | |
| 51 | |
| 52 | *** Keywords *** |
| 53 | |
| 54 | Test Teardown Execution |
| 55 | [Documentation] Do test teardown task. |
| 56 | |
| 57 | # REST Login to BMC with new "root" password. |
| 58 | Initialize OpenBMC rest_password=${test_password} |
| 59 | Update Root Password |
| 60 | Sleep 5 s |
| 61 | Delete All Sessions |
| 62 | |
| 63 | # SSH Login to BMC with user default "root" password. |
| 64 | SSHLibrary.Open Connection ${OPENBMC_HOST} |
| 65 | SSHLibrary.Login ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} |
| 66 | |
| 67 | # REST Login to BMC with user default "root" password. |
| 68 | Initialize OpenBMC |
| 69 | |
| 70 | FFDC On Test Case Fail |
| 71 | Close All Connections |