| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 1 | *** Settings *** | 
 | 2 | Documentation       Test suite for OpenBMC IPMI user management. | 
 | 3 |  | 
 | 4 | Resource            ../lib/ipmi_client.robot | 
 | 5 | Resource            ../lib/openbmc_ffdc.robot | 
| ganesanb | 0ae3620 | 2022-02-17 12:14:37 +0000 | [diff] [blame] | 6 | Resource            ../lib/bmc_network_utils.robot | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 7 | Library             ../lib/ipmi_utils.py | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 8 | Test Setup          Printn | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 9 |  | 
| Ashwini Chandrappa | 12be4b4 | 2022-03-15 23:02:07 -0500 | [diff] [blame] | 10 | Suite Setup         Suite Setup Execution | 
| Rahul Maheshwari | f646baa | 2019-02-20 12:29:35 -0600 | [diff] [blame] | 11 | Test Teardown       Test Teardown Execution | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 12 |  | 
| Matt Fischer | 6fb70d9 | 2023-10-24 19:06:33 -0600 | [diff] [blame] | 13 | Test Tags          IPMI_User | 
| George Keishing | 87dc442 | 2023-10-20 12:56:30 +0530 | [diff] [blame] | 14 |  | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 15 | *** Variables *** | 
 | 16 |  | 
 | 17 | ${invalid_username}     user% | 
 | 18 | ${invalid_password}     abc123 | 
| chithrag | c0582f7 | 2021-12-08 10:34:23 -0500 | [diff] [blame] | 19 | ${new_username}         newuser | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 20 | ${root_userid}          1 | 
 | 21 | ${operator_level_priv}  0x3 | 
| Rahul Maheshwari | c05bf56 | 2019-03-01 04:02:53 -0600 | [diff] [blame] | 22 | ${user_priv}            2 | 
 | 23 | ${operator_priv}        3 | 
| Rahul Maheshwari | ef0a735 | 2019-02-20 11:07:48 -0600 | [diff] [blame] | 24 | ${admin_level_priv}     4 | 
| Rahul Maheshwari | c19f838 | 2019-02-20 08:19:22 -0600 | [diff] [blame] | 25 | ${valid_password}       0penBmc1 | 
 | 26 | ${max_password_length}  20 | 
| Rahul Maheshwari | ef0a735 | 2019-02-20 11:07:48 -0600 | [diff] [blame] | 27 | ${ipmi_setaccess_cmd}   channel setaccess | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 28 | &{password_values}      16=0penBmc10penBmc2  17=0penBmc10penBmc2B | 
 | 29 |               ...       20=0penBmc10penBmc2Bmc3  21=0penBmc10penBmc2Bmc34 | 
| Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 30 |               ...       7=0penBmc  8=0penBmc0 | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 31 | ${expected_max_ids}     15 | 
 | 32 | ${root_pattern}         ^.*\\sroot\\s.*ADMINISTRATOR.*$ | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 33 |  | 
| Ashwini Chandrappa | 5cefabf | 2021-08-30 23:48:14 -0500 | [diff] [blame] | 34 | # User defined count. | 
 | 35 | ${USER_LOOP_COUNT}      20 | 
 | 36 |  | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 37 | *** Test Cases *** | 
 | 38 |  | 
| Rahul Maheshwari | ffc7735 | 2019-02-25 09:05:27 -0600 | [diff] [blame] | 39 | Verify IPMI User Summary | 
 | 40 |     [Documentation]  Verify IPMI maximum supported IPMI user ID and | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 41 |     ...  enabled user from user summary. | 
| Rahul Maheshwari | ffc7735 | 2019-02-25 09:05:27 -0600 | [diff] [blame] | 42 |     [Tags]  Verify_IPMI_User_Summary | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 43 |     [Teardown]  Run Keywords  FFDC On Test Case Fail  AND | 
 | 44 |     ...  Delete Created User  ${random_userid} | 
| Rahul Maheshwari | ffc7735 | 2019-02-25 09:05:27 -0600 | [diff] [blame] | 45 |  | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 46 |     ${initial_user_count}  ${maximum_ids}=  Get Enabled User Count | 
 | 47 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 48 |     ${random_userid}  ${random_username}=  Create Random IPMI User | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 49 |     Set Test Variable  ${random_userid} | 
| Rahul Maheshwari | ffc7735 | 2019-02-25 09:05:27 -0600 | [diff] [blame] | 50 |     Run IPMI Standard Command  user enable ${random_userid} | 
 | 51 |  | 
| Sridevi Ramesh | 99a77db | 2025-03-19 11:58:15 -0500 | [diff] [blame] | 52 |     # Enable IPMI user and verify | 
 | 53 |     Enable IPMI User And Verify  ${random_userid} | 
 | 54 |  | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 55 |     # Verify number of currently enabled users. | 
 | 56 |     ${current_user_count}  ${maximum_ids}=  Get Enabled User Count | 
 | 57 |     ${calculated_count}=  Evaluate  ${initial_user_count} + 1 | 
 | 58 |     Should Be Equal As Integers  ${current_user_count}   ${calculated_count} | 
| Ashwini Chandrappa | 12be4b4 | 2022-03-15 23:02:07 -0500 | [diff] [blame] | 59 |  | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 60 |     # Verify maximum user count IPMI local user can have. | 
 | 61 |     Should Be Equal As Integers  ${maximum_ids}  ${expected_max_ids} | 
| Rahul Maheshwari | ffc7735 | 2019-02-25 09:05:27 -0600 | [diff] [blame] | 62 |  | 
 | 63 |  | 
| Tony Lee | 3d351ee | 2020-02-19 10:21:04 +0800 | [diff] [blame] | 64 | Verify IPMI User List | 
 | 65 |     [Documentation]  Verify user list via IPMI. | 
 | 66 |     [Tags]  Verify_IPMI_User_List | 
 | 67 |     [Teardown]  Run Keywords  FFDC On Test Case Fail  AND | 
 | 68 |     ...  Delete Created User  ${random_userid} | 
 | 69 |  | 
 | 70 |     ${random_userid}  ${random_username}=  Create Random IPMI User | 
 | 71 |     Set Test Variable  ${random_userid} | 
 | 72 |  | 
 | 73 |     Run IPMI Standard Command | 
 | 74 |     ...  user set password ${random_userid} ${valid_password} | 
 | 75 |     Run IPMI Standard Command  user enable ${random_userid} | 
 | 76 |     # Delay added for IPMI user to get enabled. | 
 | 77 |     Sleep  5s | 
 | 78 |     # Set admin privilege and enable IPMI messaging for newly created user. | 
 | 79 |     Set Channel Access  ${random_userid}  ipmi=on privilege=${admin_level_priv} | 
 | 80 |  | 
 | 81 |     ${users_access}=  Get User Access Ipmi  ${CHANNEL_NUMBER} | 
 | 82 |     Rprint Vars  users_access | 
 | 83 |  | 
 | 84 |     ${index}=  Evaluate  ${random_userid} - 1 | 
 | 85 |     # Verify the user access of created user. | 
 | 86 |     Valid Value  users_access[${index}]['id']  ['${random_userid}'] | 
 | 87 |     Valid Value  users_access[${index}]['name']  ['${random_username}'] | 
 | 88 |     Valid Value  users_access[${index}]['callin']  ['true'] | 
 | 89 |     Valid Value  users_access[${index}]['link']  ['false'] | 
 | 90 |     Valid Value  users_access[${index}]['auth']  ['true'] | 
 | 91 |     Valid Value  users_access[${index}]['ipmi']  ['ADMINISTRATOR'] | 
 | 92 |  | 
 | 93 |  | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 94 | Verify IPMI User Creation With Valid Name And ID | 
 | 95 |     [Documentation]  Create user via IPMI and verify. | 
| George Keishing | b98036a | 2022-01-31 12:39:47 -0600 | [diff] [blame] | 96 |     [Tags]  Verify_IPMI_User_Creation_With_Valid_Name_And_ID | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 97 |     [Teardown]  Run Keywords  FFDC On Test Case Fail  AND | 
 | 98 |     ...  Delete Created User  ${random_userid} | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 99 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 100 |     ${random_userid}  ${random_username}=  Create Random IPMI User | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 101 |     Set Test Variable  ${random_userid} | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 102 |  | 
 | 103 |  | 
 | 104 | Verify IPMI User Creation With Invalid Name | 
 | 105 |     [Documentation]  Verify error while creating IPMI user with invalid | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 106 |     ...  name (e.g. user name with special characters). | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 107 |     [Tags]  Verify_IPMI_User_Creation_With_Invalid_Name | 
 | 108 |  | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 109 |     ${random_userid}=  Find Free User Id | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 110 |     ${msg}=  Run Keyword And Expect Error  *  Run IPMI Standard Command | 
 | 111 |     ...  user set name ${random_userid} ${invalid_username} | 
 | 112 |     Should Contain  ${msg}  Invalid data | 
 | 113 |  | 
 | 114 |  | 
 | 115 | Verify IPMI User Creation With Invalid ID | 
 | 116 |     [Documentation]  Verify error while creating IPMI user with invalid | 
 | 117 |     ...  ID(i.e. any number greater than 15 or 0). | 
 | 118 |     [Tags]  Verify_IPMI_User_Creation_With_Invalid_ID | 
 | 119 |  | 
 | 120 |     @{id_list}=  Create List | 
 | 121 |     ${random_invalid_id}=  Evaluate  random.randint(16, 1000)  modules=random | 
 | 122 |     Append To List  ${id_list}  ${random_invalid_id} | 
 | 123 |     Append To List  ${id_list}  0 | 
 | 124 |  | 
| Sushil Singh | be97ffc | 2019-06-04 06:34:24 -0500 | [diff] [blame] | 125 |     FOR  ${id}  IN  @{id_list} | 
 | 126 |       ${msg}=  Run Keyword And Expect Error  *  Run IPMI Standard Command | 
 | 127 |       ...  user set name ${id} newuser | 
| Tony Lee | c8ed753 | 2020-01-09 16:15:16 +0800 | [diff] [blame] | 128 |       Should Contain Any  ${msg}  User ID is limited to range  Parameter out of range | 
| Sushil Singh | be97ffc | 2019-06-04 06:34:24 -0500 | [diff] [blame] | 129 |     END | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 130 |  | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 131 |  | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 132 | Verify Setting IPMI User With Invalid Password | 
| Sridevi Ramesh | 99a77db | 2025-03-19 11:58:15 -0500 | [diff] [blame] | 133 |     [Documentation]  Verify error while setting IPMI user with invalid password. | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 134 |     [Tags]  Verify_Setting_IPMI_User_With_Invalid_Password | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 135 |     [Teardown]  Run Keywords  FFDC On Test Case Fail  AND | 
 | 136 |     ...  Delete Created User  ${random_userid} | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 137 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 138 |     ${random_userid}  ${random_username}=  Create Random IPMI User | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 139 |     Set Test Variable  ${random_userid} | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 140 |  | 
 | 141 |     # Set invalid password for newly created user. | 
 | 142 |     ${msg}=  Run Keyword And Expect Error  *  Run IPMI Standard Command | 
 | 143 |     ...  user set password ${random_userid} ${invalid_password} | 
 | 144 |  | 
| Sushma M M | 97fccae | 2020-07-27 14:55:19 -0500 | [diff] [blame] | 145 |     # Delay added for user password to get set. | 
 | 146 |     Sleep  5s | 
 | 147 |  | 
| Anusha Dathatri | a54cddc | 2019-08-07 10:01:16 -0500 | [diff] [blame] | 148 |     Should Contain  ${msg}  Set User Password command failed | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 149 |  | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 150 |  | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 151 | Verify Setting IPMI Root User With New Name | 
| Sridevi Ramesh | 99a77db | 2025-03-19 11:58:15 -0500 | [diff] [blame] | 152 |     [Documentation]  Verify error while setting IPMI root user with new name. | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 153 |     [Tags]  Verify_Setting_IPMI_Root_User_With_New_Name | 
 | 154 |  | 
 | 155 |     # Set invalid password for newly created user. | 
 | 156 |     ${msg}=  Run Keyword And Expect Error  *  Run IPMI Standard Command | 
 | 157 |     ...  user set name ${root_userid} abcd | 
 | 158 |  | 
 | 159 |     Should Contain  ${msg}  Set User Name command failed | 
 | 160 |  | 
 | 161 |  | 
| Rahul Maheshwari | c19f838 | 2019-02-20 08:19:22 -0600 | [diff] [blame] | 162 | Verify IPMI User Password Via Test Command | 
 | 163 |     [Documentation]  Verify IPMI user password using test command. | 
 | 164 |     [Tags]  Verify_IPMI_User_Password_Via_Test_Command | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 165 |     [Teardown]  Run Keywords  FFDC On Test Case Fail  AND | 
 | 166 |     ...  Delete Created User  ${random_userid} | 
| Rahul Maheshwari | c19f838 | 2019-02-20 08:19:22 -0600 | [diff] [blame] | 167 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 168 |     ${random_userid}  ${random_username}=  Create Random IPMI User | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 169 |     Set Test Variable  ${random_userid} | 
| Rahul Maheshwari | c19f838 | 2019-02-20 08:19:22 -0600 | [diff] [blame] | 170 |  | 
 | 171 |     # Set valid password for newly created user. | 
 | 172 |     Run IPMI Standard Command | 
 | 173 |     ...  user set password ${random_userid} ${valid_password} | 
 | 174 |  | 
 | 175 |     # Verify newly set password using test command. | 
 | 176 |     ${msg}=  Run IPMI Standard Command | 
 | 177 |     ...  user test ${random_userid} ${max_password_length} ${valid_password} | 
 | 178 |  | 
 | 179 |     Should Contain  ${msg}  Success | 
 | 180 |  | 
 | 181 |  | 
| Rahul Maheshwari | ef0a735 | 2019-02-20 11:07:48 -0600 | [diff] [blame] | 182 | Verify Setting Valid Password For IPMI User | 
 | 183 |     [Documentation]  Set valid password for IPMI user and verify. | 
 | 184 |     [Tags]  Verify_Setting_Valid_Password_For_IPMI_User | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 185 |     [Teardown]  Run Keywords  FFDC On Test Case Fail  AND | 
 | 186 |     ...  Delete Created User  ${random_userid} | 
| Rahul Maheshwari | ef0a735 | 2019-02-20 11:07:48 -0600 | [diff] [blame] | 187 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 188 |     ${random_userid}  ${random_username}=  Create Random IPMI User | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 189 |     Set Test Variable  ${random_userid} | 
| Rahul Maheshwari | ef0a735 | 2019-02-20 11:07:48 -0600 | [diff] [blame] | 190 |  | 
 | 191 |     # Set valid password for newly created user. | 
 | 192 |     Run IPMI Standard Command | 
 | 193 |     ...  user set password ${random_userid} ${valid_password} | 
 | 194 |  | 
| Rahul Maheshwari | ef0a735 | 2019-02-20 11:07:48 -0600 | [diff] [blame] | 195 |     Run IPMI Standard Command  user enable ${random_userid} | 
 | 196 |  | 
| Rahul Maheshwari | 7d232ab | 2019-08-29 06:44:16 -0500 | [diff] [blame] | 197 |     # Delay added for IPMI user to get enable | 
 | 198 |     Sleep  5s | 
 | 199 |  | 
| Rahul Maheshwari | ef0a735 | 2019-02-20 11:07:48 -0600 | [diff] [blame] | 200 |     # Set admin privilege and enable IPMI messaging for newly created user | 
 | 201 |     Set Channel Access  ${random_userid}  ipmi=on privilege=${admin_level_priv} | 
 | 202 |  | 
 | 203 |     Verify IPMI Username And Password  ${random_username}  ${valid_password} | 
 | 204 |  | 
 | 205 |  | 
| Rahul Maheshwari | 404da0d | 2019-02-18 23:24:17 -0600 | [diff] [blame] | 206 | Verify IPMI User Creation With Same Name | 
 | 207 |     [Documentation]  Verify error while creating two IPMI user with same name. | 
 | 208 |     [Tags]  Verify_IPMI_User_Creation_With_Same_Name | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 209 |     [Teardown]  Run Keywords  FFDC On Test Case Fail  AND | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 210 |     ...  Delete Created User  ${random_userid} | 
| Rahul Maheshwari | 404da0d | 2019-02-18 23:24:17 -0600 | [diff] [blame] | 211 |  | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 212 |     ${random_userid}  ${random_username}=  Create Random IPMI User | 
| Rahul Maheshwari | 404da0d | 2019-02-18 23:24:17 -0600 | [diff] [blame] | 213 |  | 
 | 214 |     # Set same username for another IPMI user. | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 215 |     ${rand_userid_two}=  Find Free User Id | 
| Rahul Maheshwari | 404da0d | 2019-02-18 23:24:17 -0600 | [diff] [blame] | 216 |     ${msg}=  Run Keyword And Expect Error  *  Run IPMI Standard Command | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 217 |     ...  user set name ${rand_userid_two} ${random_username} | 
| Rahul Maheshwari | 404da0d | 2019-02-18 23:24:17 -0600 | [diff] [blame] | 218 |     Should Contain  ${msg}  Invalid data field in request | 
 | 219 |  | 
 | 220 |  | 
 | 221 | Verify Setting IPMI User With Null Password | 
 | 222 |     [Documentation]  Verify error while setting IPMI user with null | 
 | 223 |     ...  password. | 
 | 224 |     [Tags]  Verify_Setting_IPMI_User_With_Null_Password | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 225 |     [Teardown]  Run Keywords  FFDC On Test Case Fail  AND | 
 | 226 |     ...  Delete Created User  ${random_userid} | 
| Rahul Maheshwari | 404da0d | 2019-02-18 23:24:17 -0600 | [diff] [blame] | 227 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 228 |     ${random_userid}  ${random_username}=  Create Random IPMI User | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 229 |     Set Test Variable  ${random_userid} | 
| Rahul Maheshwari | 404da0d | 2019-02-18 23:24:17 -0600 | [diff] [blame] | 230 |  | 
 | 231 |     # Set null password for newly created user. | 
 | 232 |     ${msg}=  Run Keyword And Expect Error  *  Run IPMI Standard Command | 
 | 233 |     ...  user set password ${random_userid} "" | 
 | 234 |  | 
 | 235 |     Should Contain  ${msg}  Invalid data field in request | 
 | 236 |  | 
 | 237 |  | 
| Rahul Maheshwari | 645a113 | 2019-02-18 03:29:27 -0600 | [diff] [blame] | 238 | Verify IPMI User Deletion | 
 | 239 |     [Documentation]  Delete user via IPMI and verify. | 
 | 240 |     [Tags]  Verify_IPMI_User_Deletion | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 241 |     [Teardown]  Run Keywords  FFDC On Test Case Fail  AND | 
 | 242 |     ...  Delete Created User  ${random_userid} | 
| Rahul Maheshwari | 645a113 | 2019-02-18 03:29:27 -0600 | [diff] [blame] | 243 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 244 |     ${random_userid}  ${random_username}=  Create Random IPMI User | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 245 |     Set Test Variable  ${random_userid} | 
| Rahul Maheshwari | 645a113 | 2019-02-18 03:29:27 -0600 | [diff] [blame] | 246 |     # Delete IPMI User and verify | 
 | 247 |     Run IPMI Standard Command  user set name ${random_userid} "" | 
| Nagarjun B | 2649914 | 2023-02-16 15:20:14 +0530 | [diff] [blame] | 248 |     ${user_info}=  Get User Info  ${random_userid}  ${CHANNEL_NUMBER} | 
| Rahul Maheshwari | 645a113 | 2019-02-18 03:29:27 -0600 | [diff] [blame] | 249 |     Should Be Equal  ${user_info['user_name']}  ${EMPTY} | 
 | 250 |  | 
 | 251 |  | 
| Rahul Maheshwari | c05bf56 | 2019-03-01 04:02:53 -0600 | [diff] [blame] | 252 | Test IPMI User Privilege Level | 
 | 253 |     [Documentation]  Verify IPMI user with user privilege can only run user level commands. | 
 | 254 |     [Tags]  Test_IPMI_User_Privilege_Level | 
 | 255 |     [Template]  Test IPMI User Privilege | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 256 |     [Teardown]  Run Keywords  FFDC On Test Case Fail  AND | 
 | 257 |     ...  Delete Created User  ${random_userid} | 
| Rahul Maheshwari | c05bf56 | 2019-03-01 04:02:53 -0600 | [diff] [blame] | 258 |  | 
 | 259 |     #Privilege level     User Cmd Status  Operator Cmd Status  Admin Cmd Status | 
 | 260 |     ${user_priv}         Passed           Failed               Failed | 
 | 261 |  | 
 | 262 |  | 
 | 263 | Test IPMI Operator Privilege Level | 
| Sridevi Ramesh | 99a77db | 2025-03-19 11:58:15 -0500 | [diff] [blame] | 264 |     [Documentation]  Verify IPMI user with operator privilege can only run user and | 
 | 265 |     ...   operator level commands. | 
| Rahul Maheshwari | c05bf56 | 2019-03-01 04:02:53 -0600 | [diff] [blame] | 266 |     [Tags]  Test_IPMI_Operator_Privilege_Level | 
 | 267 |     [Template]  Test IPMI User Privilege | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 268 |     [Teardown]  Run Keywords  FFDC On Test Case Fail  AND | 
 | 269 |     ...  Delete Created User  ${random_userid} | 
| Rahul Maheshwari | c05bf56 | 2019-03-01 04:02:53 -0600 | [diff] [blame] | 270 |  | 
 | 271 |     #Privilege level     User Cmd Status  Operator Cmd Status  Admin Cmd Status | 
 | 272 |     ${operator_priv}     Passed           Passed               Failed | 
 | 273 |  | 
 | 274 |  | 
 | 275 | Test IPMI Administrator Privilege Level | 
 | 276 |     [Documentation]  Verify IPMI user with admin privilege can run all levels command. | 
 | 277 |     [Tags]  Test_IPMI_Administrator_Privilege_Level | 
 | 278 |     [Template]  Test IPMI User Privilege | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 279 |     [Teardown]  Run Keywords  FFDC On Test Case Fail  AND | 
 | 280 |     ...  Delete Created User  ${random_userid} | 
| Rahul Maheshwari | c05bf56 | 2019-03-01 04:02:53 -0600 | [diff] [blame] | 281 |  | 
 | 282 |     #Privilege level     User Cmd Status  Operator Cmd Status  Admin Cmd Status | 
 | 283 |     ${admin_level_priv}  Passed           Passed               Passed | 
 | 284 |  | 
 | 285 |  | 
| Rahul Maheshwari | 0c71f5e | 2019-02-20 03:52:55 -0600 | [diff] [blame] | 286 | Enable IPMI User And Verify | 
 | 287 |     [Documentation]  Enable IPMI user and verify that the user is able | 
 | 288 |     ...  to run IPMI command. | 
 | 289 |     [Tags]  Enable_IPMI_User_And_Verify | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 290 |     [Teardown]  Run Keywords  FFDC On Test Case Fail  AND | 
 | 291 |     ...  Delete Created User  ${random_userid} | 
| Rahul Maheshwari | 0c71f5e | 2019-02-20 03:52:55 -0600 | [diff] [blame] | 292 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 293 |     ${random_userid}  ${random_username}=  Create Random IPMI User | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 294 |     Set Test Variable  ${random_userid} | 
| Rahul Maheshwari | 0c71f5e | 2019-02-20 03:52:55 -0600 | [diff] [blame] | 295 |     Run IPMI Standard Command | 
 | 296 |     ...  user set password ${random_userid} ${valid_password} | 
 | 297 |  | 
 | 298 |     # Set admin privilege and enable IPMI messaging for newly created user. | 
 | 299 |     Set Channel Access  ${random_userid}  ipmi=on privilege=${admin_level_priv} | 
 | 300 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 301 |     # Delay added for user privilege to get set. | 
| Rahul Maheshwari | 62c8aea | 2019-09-27 05:23:12 -0500 | [diff] [blame] | 302 |     Sleep  5s | 
 | 303 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 304 |     Enable IPMI User And Verify  ${random_userid} | 
| Gene Ratzlaff | 3a3d5d5 | 2022-05-05 08:30:52 -0400 | [diff] [blame] | 305 |     Wait And Confirm New Username And Password  ${random_username}  ${valid_password} | 
| Rahul Maheshwari | 0c71f5e | 2019-02-20 03:52:55 -0600 | [diff] [blame] | 306 |  | 
 | 307 |     # Verify that enabled IPMI  user is able to run IPMI command. | 
 | 308 |     Verify IPMI Username And Password  ${random_username}  ${valid_password} | 
 | 309 |  | 
 | 310 |  | 
 | 311 | Disable IPMI User And Verify | 
 | 312 |     [Documentation]  Disable IPMI user and verify that that the user | 
 | 313 |     ...  is unable to run IPMI command. | 
 | 314 |     [Tags]  Disable_IPMI_User_And_Verify | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 315 |     [Teardown]  Run Keywords  FFDC On Test Case Fail  AND | 
 | 316 |     ...  Delete Created User  ${random_userid} | 
| Rahul Maheshwari | 0c71f5e | 2019-02-20 03:52:55 -0600 | [diff] [blame] | 317 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 318 |     ${random_userid}  ${random_username}=  Create Random IPMI User | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 319 |     Set Test Variable  ${random_userid} | 
| Rahul Maheshwari | 0c71f5e | 2019-02-20 03:52:55 -0600 | [diff] [blame] | 320 |     Run IPMI Standard Command | 
 | 321 |     ...  user set password ${random_userid} ${valid_password} | 
 | 322 |  | 
 | 323 |     # Set admin privilege and enable IPMI messaging for newly created user. | 
 | 324 |     Set Channel Access  ${random_userid}  ipmi=on privilege=${admin_level_priv} | 
 | 325 |  | 
 | 326 |     # Disable IPMI user and verify. | 
 | 327 |     Run IPMI Standard Command  user disable ${random_userid} | 
| Nagarjun B | 2649914 | 2023-02-16 15:20:14 +0530 | [diff] [blame] | 328 |     ${user_info}=  Get User Info  ${random_userid}  ${CHANNEL_NUMBER} | 
| Rahul Maheshwari | 0c71f5e | 2019-02-20 03:52:55 -0600 | [diff] [blame] | 329 |     Should Be Equal  ${user_info['enable_status']}  disabled | 
 | 330 |  | 
 | 331 |     # Verify that disabled IPMI  user is unable to run IPMI command. | 
 | 332 |     ${msg}=  Run Keyword And Expect Error  *  Verify IPMI Username And Password | 
 | 333 |     ...  ${random_username}  ${valid_password} | 
| Rahul Maheshwari | c3d1e96 | 2019-03-06 23:53:21 -0600 | [diff] [blame] | 334 |     Should Contain  ${msg}  Unable to establish IPMI | 
| Rahul Maheshwari | 0c71f5e | 2019-02-20 03:52:55 -0600 | [diff] [blame] | 335 |  | 
| Rahul Maheshwari | c19f838 | 2019-02-20 08:19:22 -0600 | [diff] [blame] | 336 |  | 
| Rahul Maheshwari | dd63c74 | 2019-02-27 23:03:54 -0600 | [diff] [blame] | 337 | Verify IPMI Root User Password Change | 
 | 338 |     [Documentation]  Change IPMI root user password and verify that | 
 | 339 |     ...  root user is able to run IPMI command. | 
 | 340 |     [Tags]  Verify_IPMI_Root_User_Password_Change | 
| Ruud A. Haring | a6622cb | 2023-11-16 12:04:59 -0500 | [diff] [blame] | 341 |     [Setup]  Skip if  len( '${OPENBMC_PASSWORD}' ) < 8 | 
 | 342 |     ...  msg= Do not run this test if len( OPENBMC_PASSWORD ) < 8 | 
 | 343 |     # Reason: if OPENBMC_PASSWORD is not at least 8 characters, | 
 | 344 |     #         it cannot be restored in the Teardown step. | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 345 |     [Teardown]  Run Keywords  FFDC On Test Case Fail  AND | 
| Ruud A. Haring | a6622cb | 2023-11-16 12:04:59 -0500 | [diff] [blame] | 346 |     ...  Run Keyword If  "${TEST STATUS}" != "SKIP" | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 347 |     ...  Wait Until Keyword Succeeds  15 sec  5 sec | 
| Ruud A. Haring | a6622cb | 2023-11-16 12:04:59 -0500 | [diff] [blame] | 348 |     ...  Restore Default Password For IPMI Root User | 
| Rahul Maheshwari | dd63c74 | 2019-02-27 23:03:54 -0600 | [diff] [blame] | 349 |  | 
 | 350 |     # Set new password for root user. | 
 | 351 |     Run IPMI Standard Command | 
 | 352 |     ...  user set password ${root_userid} ${valid_password} | 
 | 353 |  | 
| Sushma M M | 97fccae | 2020-07-27 14:55:19 -0500 | [diff] [blame] | 354 |     # Delay added for user password to get set. | 
 | 355 |     Sleep  5s | 
 | 356 |  | 
| Rahul Maheshwari | dd63c74 | 2019-02-27 23:03:54 -0600 | [diff] [blame] | 357 |     # Verify that root user is able to run IPMI command using new password. | 
| Rahul Maheshwari | 62c8aea | 2019-09-27 05:23:12 -0500 | [diff] [blame] | 358 |     Wait Until Keyword Succeeds  15 sec  5 sec  Verify IPMI Username And Password | 
 | 359 |     ...  root  ${valid_password} | 
| Rahul Maheshwari | dd63c74 | 2019-02-27 23:03:54 -0600 | [diff] [blame] | 360 |  | 
 | 361 |  | 
| ganesanb | 5e77573 | 2023-10-31 11:13:20 +0000 | [diff] [blame] | 362 | Verify Administrator And User Privilege For Different Channels | 
 | 363 |     [Documentation]  Set administrator and user privilege for different channels and verify. | 
 | 364 |     [Tags]  Verify_Administrator_And_User_Privilege_For_Different_Channels | 
| ganesanb | 0ae3620 | 2022-02-17 12:14:37 +0000 | [diff] [blame] | 365 |     [Setup]  Check Active Ethernet Channels | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 366 |     [Teardown]  Run Keywords  FFDC On Test Case Fail  AND | 
 | 367 |     ...  Delete Created User  ${random_userid} | 
| Rahul Maheshwari | 8e17562 | 2019-05-20 05:30:32 -0500 | [diff] [blame] | 368 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 369 |     ${random_userid}  ${random_username}=  Create Random IPMI User | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 370 |     Set Test Variable  ${random_userid} | 
| Rahul Maheshwari | 8e17562 | 2019-05-20 05:30:32 -0500 | [diff] [blame] | 371 |     Run IPMI Standard Command | 
 | 372 |     ...  user set password ${random_userid} ${valid_password} | 
 | 373 |  | 
 | 374 |     # Set admin privilege for newly created user with channel 1. | 
| ganesanb | 0ae3620 | 2022-02-17 12:14:37 +0000 | [diff] [blame] | 375 |     Set Channel Access  ${random_userid}  ipmi=on privilege=${admin_level_priv}  ${CHANNEL_NUMBER} | 
| Rahul Maheshwari | 8e17562 | 2019-05-20 05:30:32 -0500 | [diff] [blame] | 376 |  | 
| ganesanb | 5e77573 | 2023-10-31 11:13:20 +0000 | [diff] [blame] | 377 |     # Set user privilege for newly created user with channel 2. | 
 | 378 |     Set Channel Access  ${random_userid}  ipmi=on privilege=${user_priv}  ${secondary_channel_number} | 
| Rahul Maheshwari | 8e17562 | 2019-05-20 05:30:32 -0500 | [diff] [blame] | 379 |  | 
| Ruud A. Haring | 9e4481b | 2023-12-08 12:08:01 -0500 | [diff] [blame] | 380 |     # Delay added for user privileges to get set. | 
 | 381 |     Sleep  5s | 
 | 382 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 383 |     Enable IPMI User And Verify  ${random_userid} | 
| Rahul Maheshwari | 8e17562 | 2019-05-20 05:30:32 -0500 | [diff] [blame] | 384 |  | 
 | 385 |     # Verify that user is able to run administrator level IPMI command with channel 1. | 
| ganesanb | 0ae3620 | 2022-02-17 12:14:37 +0000 | [diff] [blame] | 386 |     Verify IPMI Command  ${random_username}  ${valid_password}  Administrator  ${CHANNEL_NUMBER} | 
| Rahul Maheshwari | 8e17562 | 2019-05-20 05:30:32 -0500 | [diff] [blame] | 387 |  | 
 | 388 |     # Verify that user is unable to run IPMI command with channel 2. | 
| George Keishing | 6e64126 | 2022-05-05 10:46:22 -0500 | [diff] [blame] | 389 |     Run IPMI Standard Command | 
 | 390 |     ...  sel info ${secondary_channel_number}  expected_rc=${1}  U=${random_username}  P=${valid_password} | 
| Rahul Maheshwari | 8e17562 | 2019-05-20 05:30:32 -0500 | [diff] [blame] | 391 |  | 
 | 392 |  | 
 | 393 | Verify Operator And User Privilege For Different Channels | 
 | 394 |     [Documentation]  Set operator and user privilege for different channels and verify. | 
 | 395 |     [Tags]  Verify_Operator_And_User_Privilege_For_Different_Channels | 
| ganesanb | 0ae3620 | 2022-02-17 12:14:37 +0000 | [diff] [blame] | 396 |     [Setup]  Check Active Ethernet Channels | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 397 |     [Teardown]  Run Keywords  FFDC On Test Case Fail  AND | 
 | 398 |     ...  Delete Created User  ${random_userid} | 
| Rahul Maheshwari | 8e17562 | 2019-05-20 05:30:32 -0500 | [diff] [blame] | 399 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 400 |     ${random_userid}  ${random_username}=  Create Random IPMI User | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 401 |     Set Test Variable  ${random_userid} | 
| Rahul Maheshwari | 8e17562 | 2019-05-20 05:30:32 -0500 | [diff] [blame] | 402 |     Run IPMI Standard Command | 
 | 403 |     ...  user set password ${random_userid} ${valid_password} | 
 | 404 |  | 
 | 405 |     # Set operator privilege for newly created user with channel 1. | 
| ganesanb | 0ae3620 | 2022-02-17 12:14:37 +0000 | [diff] [blame] | 406 |     Set Channel Access  ${random_userid}  ipmi=on privilege=${operator_priv}  ${CHANNEL_NUMBER} | 
| Rahul Maheshwari | 8e17562 | 2019-05-20 05:30:32 -0500 | [diff] [blame] | 407 |  | 
 | 408 |     # Set user privilege for newly created user with channel 2. | 
| ganesanb | 0ae3620 | 2022-02-17 12:14:37 +0000 | [diff] [blame] | 409 |     Set Channel Access  ${random_userid}  ipmi=on privilege=${user_priv}  ${secondary_channel_number} | 
| Rahul Maheshwari | 8e17562 | 2019-05-20 05:30:32 -0500 | [diff] [blame] | 410 |  | 
| Ruud A. Haring | 9e4481b | 2023-12-08 12:08:01 -0500 | [diff] [blame] | 411 |     # Delay added for user privileges to get set. | 
 | 412 |     Sleep  5s | 
 | 413 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 414 |     Enable IPMI User And Verify  ${random_userid} | 
| Rahul Maheshwari | 8e17562 | 2019-05-20 05:30:32 -0500 | [diff] [blame] | 415 |  | 
 | 416 |     # Verify that user is able to run operator level IPMI command with channel 1. | 
| ganesanb | 0ae3620 | 2022-02-17 12:14:37 +0000 | [diff] [blame] | 417 |     Verify IPMI Command  ${random_username}  ${valid_password}  Operator  ${CHANNEL_NUMBER} | 
| Rahul Maheshwari | 8e17562 | 2019-05-20 05:30:32 -0500 | [diff] [blame] | 418 |  | 
 | 419 |     # Verify that user is able to run user level IPMI command with channel 2. | 
| ganesanb | 0ae3620 | 2022-02-17 12:14:37 +0000 | [diff] [blame] | 420 |     Verify IPMI Command  ${random_username}  ${valid_password}  User  ${secondary_channel_number} | 
| Rahul Maheshwari | 8e17562 | 2019-05-20 05:30:32 -0500 | [diff] [blame] | 421 |  | 
 | 422 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 423 | Verify Setting IPMI User With Max Password Length | 
 | 424 |     [Documentation]  Verify IPMI user creation with password length of 20 characters. | 
 | 425 |     [Tags]  Verify_Setting_IPMI_User_With_Max_Password_Length | 
 | 426 |     [Template]  Set User Password And Verify | 
 | 427 |  | 
 | 428 |     # password_length  password_option  expected_status | 
 | 429 |     20                 20               ${True} | 
 | 430 |  | 
 | 431 |  | 
 | 432 | Verify Setting IPMI User With Invalid Password Length | 
 | 433 |     [Documentation]  Verify that IPMI user cannot be set with 21 character password using 16 char | 
 | 434 |     ...  or 20 char password option. | 
 | 435 |     [Tags]  Verify_Setting_IPMI_User_With_Invalid_Password_Length | 
 | 436 |     [Template]  Set User Password And Verify | 
 | 437 |  | 
 | 438 |     # password_length  password_option  expected_status | 
 | 439 |     21                 16               ${False} | 
 | 440 |     21                 20               ${False} | 
 | 441 |  | 
 | 442 |  | 
 | 443 | Verify Setting IPMI User With 16 Character Password | 
 | 444 |     [Documentation]  Verify that IPMI user can create a 16 character password using 16 char or 20 | 
 | 445 |     ...  char password option. | 
 | 446 |     [Tags]  Verify_Setting_IPMI_User_With_16_Character_Password | 
 | 447 |     [Template]  Set User Password And Verify | 
 | 448 |  | 
 | 449 |     # password_length  password_option  expected_status | 
 | 450 |     16                 16               ${True} | 
 | 451 |     16                 20               ${True} | 
 | 452 |  | 
 | 453 |  | 
 | 454 | Verify Default Selection Of 16 Character Password For IPMI User | 
 | 455 |     [Documentation]  Verify that ipmitool by default opts for the 16 character option when given a | 
 | 456 |     ...  password whose length is in between 17 and 20. | 
 | 457 |     [Tags]  Verify_Default_Selection_Of_16_Character_Password_For_IPMI_User | 
 | 458 |     [Template]  Set User Password And Verify | 
 | 459 |  | 
 | 460 |     # password_length  password_option  expected_status | 
 | 461 |     17                 16               ${True} | 
 | 462 |     20                 16               ${True} | 
 | 463 |  | 
 | 464 |  | 
| Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 465 | Verify Minimum Password Length For IPMI User | 
 | 466 |     [Documentation]  Verify minimum password length of 8 characters. | 
 | 467 |     [Tags]  Verify_Minimum_Password_Length_For_IPMI_User | 
 | 468 |     [Template]  Set User Password And Verify | 
 | 469 |  | 
 | 470 |     # password_length  password_option  expected_status | 
 | 471 |     7                  16               ${False} | 
 | 472 |     8                  16               ${True} | 
 | 473 |     7                  20               ${False} | 
 | 474 |     8                  20               ${True} | 
 | 475 |  | 
 | 476 |  | 
| Ashwini Chandrappa | 5cefabf | 2021-08-30 23:48:14 -0500 | [diff] [blame] | 477 | Verify Continuous IPMI Command Execution | 
 | 478 |     [Documentation]  Verify that continuous IPMI command execution runs fine. | 
 | 479 |     [Tags]  Verify_Continuous_IPMI_Command_Execution | 
 | 480 |  | 
 | 481 |     FOR  ${i}  IN RANGE  ${USER_LOOP_COUNT} | 
| ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 482 |         Run IPMI Standard Command  lan print ${CHANNEL_NUMBER} | 
| Ashwini Chandrappa | 5cefabf | 2021-08-30 23:48:14 -0500 | [diff] [blame] | 483 |         Run IPMI Standard Command  power status | 
 | 484 |         Run IPMI Standard Command  fru list | 
 | 485 |         Run IPMI Standard Command  sel list | 
 | 486 |     END | 
 | 487 |  | 
 | 488 |  | 
| chithrag | c0582f7 | 2021-12-08 10:34:23 -0500 | [diff] [blame] | 489 | Modify IPMI User | 
 | 490 |     [Documentation]  Verify modified IPMI user is communicating via IPMI. | 
 | 491 |     [Tags]  Modify_IPMI_User | 
 | 492 |     [Teardown]  Run Keywords  FFDC On Test Case Fail  AND | 
 | 493 |     ...  Delete Created User  ${random_userid} | 
 | 494 |  | 
 | 495 |     ${random_userid}  ${random_username}=  Create Random IPMI User | 
 | 496 |     Set Test Variable  ${random_userid} | 
 | 497 |     Run IPMI Standard Command | 
 | 498 |     ...  user set password ${random_userid} ${valid_password} | 
 | 499 |  | 
 | 500 |     # Set admin privilege and enable IPMI messaging for newly created user. | 
 | 501 |     Set Channel Access  ${random_userid}  ipmi=on privilege=${admin_level_priv} | 
 | 502 |  | 
 | 503 |     # Delay added for user privilege to get set. | 
 | 504 |     Sleep  5s | 
 | 505 |  | 
 | 506 |     Enable IPMI User And Verify  ${random_userid} | 
 | 507 |  | 
 | 508 |     # Verify that user is able to run administrator level IPMI command. | 
 | 509 |     Verify IPMI Command  ${random_username}  ${valid_password}  Administrator  ${CHANNEL_NUMBER} | 
 | 510 |  | 
 | 511 |     # Set different username for same IPMI user. | 
 | 512 |     Run IPMI Standard Command | 
 | 513 |     ...  user set name ${random_userid} ${new_username} | 
| Gene Ratzlaff | 3a3d5d5 | 2022-05-05 08:30:52 -0400 | [diff] [blame] | 514 |     Wait And Confirm New Username And Password  ${new_username}  ${valid_password} | 
| chithrag | c0582f7 | 2021-12-08 10:34:23 -0500 | [diff] [blame] | 515 |  | 
 | 516 |     # Verify that user is able to run administrator level IPMI command. | 
 | 517 |     Verify IPMI Command  ${new_username}  ${valid_password}  Administrator  ${CHANNEL_NUMBER} | 
 | 518 |  | 
 | 519 |  | 
| Rahul Maheshwari | ddfc0cb | 2019-02-07 23:43:19 -0600 | [diff] [blame] | 520 | *** Keywords *** | 
 | 521 |  | 
| Ruud A. Haring | a6622cb | 2023-11-16 12:04:59 -0500 | [diff] [blame] | 522 | Restore Default Password For IPMI Root User | 
 | 523 |     [Documentation]  Restore default password for IPMI root user | 
 | 524 |  | 
| Rahul Maheshwari | dd63c74 | 2019-02-27 23:03:54 -0600 | [diff] [blame] | 525 |     ${result}=  Run External IPMI Standard Command | 
 | 526 |     ...  user set password ${root_userid} ${OPENBMC_PASSWORD} | 
 | 527 |     ...  P=${valid_password} | 
 | 528 |     Should Contain  ${result}  Set User Password command successful | 
 | 529 |  | 
 | 530 |     # Verify that root user is able to run IPMI command using default password. | 
 | 531 |     Verify IPMI Username And Password  root  ${OPENBMC_PASSWORD} | 
 | 532 |  | 
| Rahul Maheshwari | ef0a735 | 2019-02-20 11:07:48 -0600 | [diff] [blame] | 533 |  | 
| Rahul Maheshwari | c05bf56 | 2019-03-01 04:02:53 -0600 | [diff] [blame] | 534 | Test IPMI User Privilege | 
 | 535 |     [Documentation]  Test IPMI user privilege by executing IPMI command with different privileges. | 
 | 536 |     [Arguments]  ${privilege_level}  ${user_cmd_status}  ${operator_cmd_status}  ${admin_cmd_status} | 
 | 537 |  | 
 | 538 |     # Description of argument(s): | 
 | 539 |     # privilege_level     Privilege level of IPMI user (e.g. 4, 3). | 
 | 540 |     # user_cmd_status     Expected status of IPMI command run with the "User" | 
 | 541 |     #                     privilege (i.e. "Passed" or "Failed"). | 
 | 542 |     # operator_cmd_status Expected status of IPMI command run with the "Operator" | 
 | 543 |     #                     privilege (i.e. "Passed" or "Failed"). | 
 | 544 |     # admin_cmd_status    Expected status of IPMI command run with the "Administrator" | 
 | 545 |     #                     privilege (i.e. "Passed" or "Failed"). | 
 | 546 |  | 
 | 547 |     # Create IPMI user and set valid password. | 
| Ruud A. Haring | 9e4481b | 2023-12-08 12:08:01 -0500 | [diff] [blame] | 548 |     ${random_userid}  ${random_username}=  Create Random IPMI User | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 549 |     Set Test Variable  ${random_userid} | 
| Rahul Maheshwari | c05bf56 | 2019-03-01 04:02:53 -0600 | [diff] [blame] | 550 |     Run IPMI Standard Command | 
 | 551 |     ...  user set password ${random_userid} ${valid_password} | 
 | 552 |  | 
 | 553 |     # Set privilege and enable IPMI messaging for newly created user. | 
 | 554 |     Set Channel Access  ${random_userid}  ipmi=on privilege=${privilege_level} | 
 | 555 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 556 |     # Delay added for user privilege to get set. | 
| Rahul Maheshwari | 62c8aea | 2019-09-27 05:23:12 -0500 | [diff] [blame] | 557 |     Sleep  5s | 
 | 558 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 559 |     Enable IPMI User And Verify  ${random_userid} | 
| Rahul Maheshwari | c05bf56 | 2019-03-01 04:02:53 -0600 | [diff] [blame] | 560 |  | 
| Rahul Maheshwari | 8e17562 | 2019-05-20 05:30:32 -0500 | [diff] [blame] | 561 |     Verify IPMI Command  ${random_username}  ${valid_password}  User | 
 | 562 |     ...  expected_status=${user_cmd_status} | 
 | 563 |     Verify IPMI Command  ${random_username}  ${valid_password}  Operator | 
 | 564 |     ...  expected_status=${operator_cmd_status} | 
 | 565 |     Verify IPMI Command  ${random_username}  ${valid_password}  Administrator | 
 | 566 |     ...  expected_status=${admin_cmd_status} | 
| Rahul Maheshwari | c05bf56 | 2019-03-01 04:02:53 -0600 | [diff] [blame] | 567 |  | 
 | 568 |  | 
 | 569 | Verify IPMI Command | 
 | 570 |     [Documentation]  Verify IPMI command execution with given username, | 
 | 571 |     ...  password, privilege and expected status. | 
| Rahul Maheshwari | 8e17562 | 2019-05-20 05:30:32 -0500 | [diff] [blame] | 572 |     [Arguments]  ${username}  ${password}  ${privilege}  ${channel}=${1}  ${expected_status}=Passed | 
| Rahul Maheshwari | c05bf56 | 2019-03-01 04:02:53 -0600 | [diff] [blame] | 573 |     # Description of argument(s): | 
 | 574 |     # username         The user name (e.g. "root", "robert", etc.). | 
 | 575 |     # password         The user password (e.g. "0penBmc", "0penBmc1", etc.). | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 576 |     # privilege        The session privilege for IPMI command (e.g. "User", "Operator", etc.). | 
| Rahul Maheshwari | 8e17562 | 2019-05-20 05:30:32 -0500 | [diff] [blame] | 577 |     # channel          The user channel number (e.g. "1" or "2"). | 
| Rahul Maheshwari | c05bf56 | 2019-03-01 04:02:53 -0600 | [diff] [blame] | 578 |     # expected_status  Expected status of IPMI command run with the user | 
 | 579 |     #                  of above password and privilege (i.e. "Passed" or "Failed"). | 
 | 580 |  | 
 | 581 |     ${expected_rc}=  Set Variable If  '${expected_status}' == 'Passed'  ${0}  ${1} | 
| Rahul Maheshwari | ceb282e | 2019-09-16 00:11:41 -0500 | [diff] [blame] | 582 |     Wait Until Keyword Succeeds  15 sec  5 sec  Run IPMI Standard Command | 
 | 583 |     ...  sel info ${channel}  expected_rc=${expected_rc}  U=${username}  P=${password} | 
| Rahul Maheshwari | c05bf56 | 2019-03-01 04:02:53 -0600 | [diff] [blame] | 584 |     ...  L=${privilege} | 
 | 585 |  | 
 | 586 |  | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 587 | Set User Password And Verify | 
 | 588 |     [Documentation]  Create a user and set its password with given length and option. | 
 | 589 |     [Arguments]  ${password_length}  ${password_option}  ${expected_result} | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 590 |     [Teardown]  Run Keyword  Delete Created User  ${random_userid} | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 591 |     # Description of argument(s): | 
 | 592 |     # password_length  Length of password to be generated and used (e.g. "16"). | 
 | 593 |     # password_option  Password length option to be given in IPMI command (e.g. "16", "20"). | 
 | 594 |     # expected_result  Expected result for setting the user's password (e.g. "True", "False"). | 
 | 595 |  | 
 | 596 |     Rprint Vars  password_length  password_option  expected_result | 
 | 597 |     ${random_userid}  ${random_username}=  Create Random IPMI User | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 598 |     Set Test Variable  ${random_userid} | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 599 |     ${password}=  Get From Dictionary  ${password_values}  ${password_length} | 
 | 600 |     Rprint Vars  random_userid  password | 
 | 601 |  | 
 | 602 |     # Set password for newly created user. | 
 | 603 |     ${status}=  Run Keyword And Return Status  Run IPMI Standard Command | 
 | 604 |     ...  user set password ${random_userid} ${password} ${password_option} | 
 | 605 |     Rprint Vars  status | 
 | 606 |     Valid Value  status  [${expected_result}] | 
| Sridevi Ramesh | c6e7f93 | 2025-05-07 11:26:54 -0500 | [diff] [blame] | 607 |     IF  '${expected_result}' == '${False}'  RETURN | 
| Anusha Dathatri | dd8e7d8 | 2019-12-03 07:45:30 -0600 | [diff] [blame] | 608 |  | 
 | 609 |     # Set admin privilege and enable IPMI messaging for newly created user. | 
 | 610 |     Set Channel Access  ${random_userid}  ipmi=on privilege=${admin_level_priv} | 
 | 611 |  | 
 | 612 |     # Delay added for user privilege to get set. | 
 | 613 |     Sleep  5s | 
 | 614 |  | 
 | 615 |     Enable IPMI User And Verify  ${random_userid} | 
 | 616 |  | 
 | 617 |     # For password_option 16, passwords with length between 17 and 20 will be truncated. | 
 | 618 |     # For all other cases, passwords will be retained as it is to verify. | 
 | 619 |     ${truncated_password}=  Set Variable  ${password[:${password_option}]} | 
 | 620 |     Rprint Vars  truncated_password | 
 | 621 |     ${status}=  Run Keyword And Return Status  Verify IPMI Username And Password  ${random_username} | 
 | 622 |     ...  ${truncated_password} | 
 | 623 |     Rprint Vars  status | 
 | 624 |     Valid Value  status  [${expected_result}] | 
 | 625 |  | 
 | 626 |  | 
| Rahul Maheshwari | f646baa | 2019-02-20 12:29:35 -0600 | [diff] [blame] | 627 | Test Teardown Execution | 
 | 628 |     [Documentation]  Do the test teardown execution. | 
 | 629 |  | 
 | 630 |     FFDC On Test Case Fail | 
| Tony Lee | f9379e8 | 2020-01-08 18:20:38 +0800 | [diff] [blame] | 631 |  | 
 | 632 |  | 
| ganesanb | 0ae3620 | 2022-02-17 12:14:37 +0000 | [diff] [blame] | 633 | Check Active Ethernet Channels | 
 | 634 |     [Documentation]  Check active ethernet channels and set suite variables. | 
 | 635 |  | 
 | 636 |     ${channel_number_list}=  Get Active Ethernet Channel List | 
 | 637 |     ${channel_length}=  Get Length  ${channel_number_list} | 
 | 638 |     Skip If  '${channel_length}' == '1' | 
 | 639 |     ...  msg= Skips this test case as only one channel was in active. | 
 | 640 |  | 
 | 641 |     FOR  ${channel_num}  IN  @{channel_number_list} | 
 | 642 |         ${secondary_channel_number}=  Set Variable If  ${channel_num} != ${CHANNEL_NUMBER}  ${channel_num} | 
 | 643 |     END | 
 | 644 |  | 
 | 645 |     Set Suite Variable  ${secondary_channel_number} | 
| Ashwini Chandrappa | 12be4b4 | 2022-03-15 23:02:07 -0500 | [diff] [blame] | 646 |  | 
 | 647 |  | 
 | 648 | Suite Setup Execution | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 649 |     [Documentation]  Make sure the enabled user count is below maximum, | 
 | 650 |     ...  and prepares administrative user list suite variables. | 
 | 651 |  | 
 | 652 |     Check Enabled User Count | 
| George Keishing | ca9a784 | 2022-07-07 03:44:44 -0500 | [diff] [blame] | 653 |     # Skip root user checking if user decides not to use root user as default. | 
| Sridevi Ramesh | c6e7f93 | 2025-05-07 11:26:54 -0500 | [diff] [blame] | 654 |     IF  '${IPMI_USERNAME}' == 'root'  Determine Root User Id | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 655 |  | 
 | 656 |  | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 657 | Determine Root User Id | 
 | 658 |     [Documentation]  Determines the user ID of the root user. | 
 | 659 |  | 
 | 660 |     ${resp}=  Wait Until Keyword Succeeds  15 sec  1 sec  Run IPMI Standard Command | 
| ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 661 |     ...  user list ${CHANNEL_NUMBER} | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 662 |     @{lines}=  Split To Lines  ${resp} | 
 | 663 |  | 
 | 664 |     ${root_userid}=  Set Variable  ${-1} | 
 | 665 |     ${line_count}=  Get Length  ${lines} | 
 | 666 |     FOR  ${id_index}  IN RANGE  1  ${line_count} | 
 | 667 |         ${line}=  Get From List  ${lines}  ${id_index} | 
 | 668 |         ${root_found}=  Get Lines Matching Regexp  ${line}  ${root_pattern} | 
 | 669 |         IF  '${root_found}' != '${EMPTY}' | 
 | 670 |             ${root_userid}=  Set Variable  ${id_index} | 
| Sridevi Ramesh | c6e7f93 | 2025-05-07 11:26:54 -0500 | [diff] [blame] | 671 |             BREAK | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 672 |         END | 
 | 673 |     END | 
 | 674 |     Set Suite Variable  ${root_userid} | 
 | 675 |  | 
 | 676 |     Log To Console  The root user ID is ${root_userid}. | 
| Sridevi Ramesh | c6e7f93 | 2025-05-07 11:26:54 -0500 | [diff] [blame] | 677 |     IF  ${root_userid} < ${1}  Fail  msg= Did not identify root user ID. | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 678 |  | 
 | 679 |  | 
| Gene Ratzlaff | 3a3d5d5 | 2022-05-05 08:30:52 -0400 | [diff] [blame] | 680 | Wait And Confirm New Username And Password | 
| George Keishing | 5e9fbbf | 2022-04-29 03:48:14 -0500 | [diff] [blame] | 681 |     [Documentation]  Wait in loop trying to to confirm Username And Password. | 
 | 682 |     [Arguments]  ${username}  ${password} | 
 | 683 |  | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 684 |     # Description of argument(s): | 
 | 685 |     # username         The user name (e.g. "root", "robert", etc.). | 
 | 686 |     # password         The user password (e.g. "0penBmc", "0penBmc1", etc.). | 
 | 687 |  | 
| George Keishing | 5e9fbbf | 2022-04-29 03:48:14 -0500 | [diff] [blame] | 688 |     # Give time for previous command to complete. | 
 | 689 |     Sleep  5s | 
 | 690 |  | 
 | 691 |     # Looping verify that root user is able to run IPMI command using new password. | 
 | 692 |     Wait Until Keyword Succeeds  15 sec  5 sec  Verify IPMI Username And Password | 
 | 693 |     ...  ${username}  ${password} | 
| Gene Ratzlaff | a631d69 | 2022-05-05 14:40:03 -0400 | [diff] [blame] | 694 |  | 
 | 695 |  | 
 | 696 | Get Enabled User Count | 
 | 697 |     [Documentation]  Return as integers: current number of enabled users and | 
 | 698 |     ...  Maximum number of Ids. | 
 | 699 |  | 
 | 700 |     # Isolate 'Enabled User Count' value and convert to integer | 
 | 701 |     ${resp}=  Wait Until Keyword Succeeds  15 sec  1 sec  Run IPMI Standard Command | 
 | 702 |     ...  user summary ${CHANNEL_NUMBER} | 
 | 703 |     ${user_count_line}=  Get Lines Containing String  ${resp}  Enabled User Count | 
 | 704 |     ${count}=  Fetch From Right  ${user_count_line}  \: | 
 | 705 |     ${user_count}=  Convert To Integer  ${count} | 
 | 706 |  | 
 | 707 |     # Isolate 'Maximum IDs' value and convert to integer | 
 | 708 |     ${maximum_ids}=  Get Lines Containing String  ${resp}  Maximum IDs | 
 | 709 |     ${max_ids}=  Fetch From Right  ${maximum_ids}  \: | 
 | 710 |     ${int_maximum_ids_count}=  Convert To Integer  ${max_ids} | 
 | 711 |  | 
| George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 712 |     RETURN  ${user_count}  ${int_maximum_ids_count} |