manashsarma | 677408d | 2021-06-22 07:35:33 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This suite is to test service user functionality via Redfish. |
| 3 | |
George Keishing | 33be359 | 2022-03-08 08:52:25 -0600 | [diff] [blame] | 4 | Resource ../../lib/connection_client.robot |
manashsarma | 94c97d8 | 2021-07-09 05:25:45 -0500 | [diff] [blame] | 5 | Resource ../../lib/openbmc_ffdc.robot |
| 6 | Resource ../../lib/bmc_redfish_utils.robot |
manashsarma | 677408d | 2021-06-22 07:35:33 -0500 | [diff] [blame] | 7 | |
| 8 | Suite Setup Suite Setup Execution |
| 9 | Suite Teardown Redfish.Logout |
| 10 | Test Teardown FFDC On Test Case Fail |
| 11 | |
George Keishing | 7c32f30 | 2023-10-10 16:11:46 +0530 | [diff] [blame^] | 12 | Force Tags Service_User |
manashsarma | 677408d | 2021-06-22 07:35:33 -0500 | [diff] [blame] | 13 | |
| 14 | *** Test Cases *** |
| 15 | |
manashsarma | 70adc25 | 2021-07-15 07:07:48 -0500 | [diff] [blame] | 16 | Verify Service User Availability |
manashsarma | 677408d | 2021-06-22 07:35:33 -0500 | [diff] [blame] | 17 | [Documentation] Verify service user avalability. |
manashsarma | 70adc25 | 2021-07-15 07:07:48 -0500 | [diff] [blame] | 18 | [Tags] Verify_Service_User_Availability |
manashsarma | 677408d | 2021-06-22 07:35:33 -0500 | [diff] [blame] | 19 | |
| 20 | # Verify that service user has administrator privilege. |
| 21 | ${role_config}= Redfish_Utils.Get Attribute |
| 22 | ... /redfish/v1/AccountService/Accounts/service RoleId |
| 23 | |
| 24 | Should Be Equal Administrator ${role_config} |
| 25 | |
| 26 | |
manashsarma | 94c97d8 | 2021-07-09 05:25:45 -0500 | [diff] [blame] | 27 | Verify Creating User With Service Username |
| 28 | [Documentation] Verify that user with service username can not be created. |
manashsarma | 70adc25 | 2021-07-15 07:07:48 -0500 | [diff] [blame] | 29 | [Tags] Verify_Creating_User_With_Service_Username |
manashsarma | 94c97d8 | 2021-07-09 05:25:45 -0500 | [diff] [blame] | 30 | |
| 31 | ${payload}= Create Dictionary |
| 32 | ... UserName=service Password=TestPwd1 RoleId=Operator Enabled=${True} |
| 33 | Redfish.Post /redfish/v1/AccountService/Accounts/ body=&{payload} |
manashsarma | 5786f28 | 2021-08-10 06:40:53 -0500 | [diff] [blame] | 34 | ... valid_status_codes=[${HTTP_FORBIDDEN}] |
manashsarma | 94c97d8 | 2021-07-09 05:25:45 -0500 | [diff] [blame] | 35 | |
manashsarma | 70adc25 | 2021-07-15 07:07:48 -0500 | [diff] [blame] | 36 | |
| 37 | Verify Modifying Service User Password |
| 38 | [Documentation] Verify error while modifying service user password in Redfish. |
| 39 | [Tags] Verify_Modifying_Service_User_Password |
| 40 | |
| 41 | ${payload}= Create Dictionary Password=NewTestPwd123 |
| 42 | # Modification of service user password is not allowed via Redfish API. |
| 43 | Redfish.Patch /redfish/v1/AccountService/Accounts/service body=&{payload} |
manashsarma | 5786f28 | 2021-08-10 06:40:53 -0500 | [diff] [blame] | 44 | ... valid_status_codes=[${HTTP_FORBIDDEN}] |
manashsarma | 70adc25 | 2021-07-15 07:07:48 -0500 | [diff] [blame] | 45 | |
| 46 | |
manashsarma | 8fe2b2d | 2021-07-23 01:59:06 -0500 | [diff] [blame] | 47 | Verify Renaming Service User |
| 48 | [Documentation] Verify error while renaming service user via Redfish. |
manashsarma | 39122c1 | 2021-07-26 01:57:37 -0500 | [diff] [blame] | 49 | [Tags] Verify_Renaming_Service_User |
manashsarma | 8fe2b2d | 2021-07-23 01:59:06 -0500 | [diff] [blame] | 50 | |
| 51 | ${payload}= Create Dictionary UserName=new_service |
| 52 | Redfish.Patch /redfish/v1/AccountService/Accounts/service body=&{payload} |
manashsarma | 5786f28 | 2021-08-10 06:40:53 -0500 | [diff] [blame] | 53 | ... valid_status_codes=[${HTTP_FORBIDDEN}] |
manashsarma | 8fe2b2d | 2021-07-23 01:59:06 -0500 | [diff] [blame] | 54 | |
| 55 | |
manashsarma | 39122c1 | 2021-07-26 01:57:37 -0500 | [diff] [blame] | 56 | Verify Deleting Service User |
| 57 | [Documentation] Verify error while deleting service user via Redfish. |
| 58 | [Tags] Verify_Deleting_Service_User |
| 59 | |
manashsarma | 5786f28 | 2021-08-10 06:40:53 -0500 | [diff] [blame] | 60 | Redfish.Delete /redfish/v1/AccountService/Accounts/service valid_status_codes=[${HTTP_FORBIDDEN}] |
manashsarma | 39122c1 | 2021-07-26 01:57:37 -0500 | [diff] [blame] | 61 | |
| 62 | |
manashsarma | 9b429d6 | 2021-11-11 04:16:37 -0600 | [diff] [blame] | 63 | Verify Modifying Service User Role |
| 64 | [Documentation] Verify error while modifyig service user role via Redfish. |
| 65 | [Tags] Verify_Modifying_Service_User_Role |
| 66 | |
| 67 | ${payload}= Create Dictionary RoleId=Operator |
| 68 | Redfish.Patch /redfish/v1/AccountService/Accounts/service body=&{payload} |
| 69 | ... valid_status_codes=[${HTTP_FORBIDDEN}] |
| 70 | |
| 71 | |
manashsarma | 677408d | 2021-06-22 07:35:33 -0500 | [diff] [blame] | 72 | *** Keywords *** |
| 73 | |
| 74 | Suite Setup Execution |
| 75 | [Documentation] Do suite setup tasks. |
| 76 | |
| 77 | Redfish.Login |