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 |
| 16 | |
| 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 | |
| 36 | *** Keywords *** |
| 37 | |
| 38 | Test Setup Execution |
| 39 | [Documentation] Do test case setup tasks. |
| 40 | |
| 41 | Redfish.Login |
| 42 | |
| 43 | |
| 44 | Test Teardown Execution |
| 45 | [Documentation] Do the post test teardown. |
| 46 | |
| 47 | FFDC On Test Case Fail |
| 48 | # Delete the test user. |
| 49 | Run Keyword And Ignore Error |
| 50 | ... Redfish.Delete /redfish/v1/AccountService/Accounts/${random_username} |
| 51 | |
| 52 | Redfish.Logout |