Rahul Maheshwari | 51dee26 | 2019-03-06 23:36:21 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test IPMI and Redfish combinations for user management. |
| 3 | |
| 4 | Resource ../../lib/resource.robot |
| 5 | Resource ../../lib/bmc_redfish_resource.robot |
| 6 | Resource ../../lib/openbmc_ffdc.robot |
| 7 | Resource ../../lib/ipmi_client.robot |
| 8 | |
| 9 | Test Setup Test Setup Execution |
| 10 | Test Teardown Test Teardown Execution |
| 11 | |
| 12 | |
| 13 | *** Variables *** |
| 14 | |
| 15 | ${valid_password} 0penBmc1 |
Rahul Maheshwari | cf2336e | 2019-03-15 00:49:13 -0500 | [diff] [blame] | 16 | ${valid_password2} 0penBmc2 |
Rahul Maheshwari | 51dee26 | 2019-03-06 23:36:21 -0600 | [diff] [blame] | 17 | |
| 18 | ** Test Cases ** |
| 19 | |
| 20 | Create Admin Redfish User And Verify Login Via IPMI |
| 21 | [Documentation] Create user using redfish and verify via IPMI. |
| 22 | [Tags] Create_Admin_Redfish_User_And_Verify_Login_Via_IPMI |
| 23 | |
| 24 | ${random_username}= Generate Random String 8 [LETTERS] |
| 25 | Set Test Variable ${random_username} |
| 26 | |
| 27 | ${payload}= Create Dictionary |
| 28 | ... UserName=${random_username} Password=${valid_password} |
| 29 | ... RoleId=Administrator Enabled=${True} |
| 30 | Redfish.Post /redfish/v1/AccountService/Accounts body=&{payload} |
| 31 | ... valid_status_codes=[${HTTP_CREATED}] |
| 32 | |
| 33 | Verify IPMI Username And Password ${random_username} ${valid_password} |
| 34 | |
| 35 | |
Rahul Maheshwari | cf2336e | 2019-03-15 00:49:13 -0500 | [diff] [blame] | 36 | Update User Password Via Redfish And Verify Using IPMI |
| 37 | [Documentation] Update user password via Redfish and verify using IPMI. |
| 38 | [Tags] Update_User_Password_Via_Redfish_And_Verify_Using_IPMI |
| 39 | |
| 40 | # Create user using Redfish. |
| 41 | ${random_username}= Generate Random String 8 [LETTERS] |
| 42 | Set Test Variable ${random_username} |
| 43 | |
| 44 | ${payload}= Create Dictionary |
| 45 | ... UserName=${random_username} Password=${valid_password} |
| 46 | ... RoleId=Administrator Enabled=${True} |
| 47 | Redfish.Post /redfish/v1/AccountService/Accounts body=&{payload} |
| 48 | ... valid_status_codes=[${HTTP_CREATED}] |
| 49 | |
| 50 | # Update user password using Redfish. |
| 51 | ${payload}= Create Dictionary Password=${valid_password2} |
| 52 | Redfish.Patch /redfish/v1/AccountService/Accounts/${random_username} body=&{payload} |
| 53 | |
| 54 | # Verify that IPMI command works with new password and fails with older password. |
| 55 | Verify IPMI Username And Password ${random_username} ${valid_password2} |
| 56 | |
| 57 | Run Keyword And Expect Error Error: Unable to establish IPMI* |
| 58 | ... Verify IPMI Username And Password ${random_username} ${valid_password} |
| 59 | |
| 60 | |
| 61 | Delete User Via Redfish And Verify Using IPMI |
| 62 | [Documentation] Delete user via redfish and verify using IPMI. |
| 63 | [Tags] Delete_User_Via_Redfish_And_Verify_Using_IPMI |
| 64 | |
| 65 | # Create user using Redfish. |
| 66 | ${random_username}= Generate Random String 8 [LETTERS] |
| 67 | Set Test Variable ${random_username} |
| 68 | |
| 69 | ${payload}= Create Dictionary |
| 70 | ... UserName=${random_username} Password=${valid_password} |
| 71 | ... RoleId=Administrator Enabled=${True} |
| 72 | Redfish.Post /redfish/v1/AccountService/Accounts body=&{payload} |
| 73 | ... valid_status_codes=[${HTTP_CREATED}] |
| 74 | |
| 75 | # Delete user using Redfish. |
| 76 | Redfish.Delete /redfish/v1/AccountService/Accounts/${random_username} |
| 77 | |
| 78 | # Verify that IPMI command fails with deleted user. |
| 79 | Run Keyword And Expect Error Error: Unable to establish IPMI* |
| 80 | ... Verify IPMI Username And Password ${random_username} ${valid_password} |
| 81 | |
| 82 | |
Rahul Maheshwari | 51dee26 | 2019-03-06 23:36:21 -0600 | [diff] [blame] | 83 | *** Keywords *** |
| 84 | |
| 85 | Test Setup Execution |
| 86 | [Documentation] Do test case setup tasks. |
| 87 | |
| 88 | Redfish.Login |
| 89 | |
| 90 | |
| 91 | Test Teardown Execution |
| 92 | [Documentation] Do the post test teardown. |
| 93 | |
| 94 | FFDC On Test Case Fail |
| 95 | # Delete the test user. |
| 96 | Run Keyword And Ignore Error |
| 97 | ... Redfish.Delete /redfish/v1/AccountService/Accounts/${random_username} |
| 98 | |
| 99 | Redfish.Logout |