Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This suite tests IPMI SOL in OpenBMC. |
| 3 | |
Rahul Maheshwari | 1cd7e43 | 2019-03-06 10:27:21 -0600 | [diff] [blame] | 4 | Resource ../lib/ipmi_client.robot |
| 5 | Resource ../lib/openbmc_ffdc.robot |
George Keishing | 42e1ac6 | 2019-03-07 13:18:39 -0600 | [diff] [blame] | 6 | Resource ../lib/state_manager.robot |
George Keishing | 60b5e61 | 2019-07-05 12:11:51 -0500 | [diff] [blame] | 7 | Resource ../lib/boot_utils.robot |
| 8 | Resource ../lib/bmc_redfish_resource.robot |
Rahul Maheshwari | 1cd7e43 | 2019-03-06 10:27:21 -0600 | [diff] [blame] | 9 | Library ../lib/ipmi_utils.py |
Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 10 | |
Rahul Maheshwari | 2a17511 | 2017-08-22 05:06:49 -0500 | [diff] [blame] | 11 | Test Setup Start SOL Console Logging |
George Keishing | 0ea976a | 2017-12-08 01:09:40 -0600 | [diff] [blame] | 12 | Test Teardown Test Teardown Execution |
Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 13 | |
Rahul Maheshwari | 7eea8ed | 2018-12-18 04:51:38 -0600 | [diff] [blame] | 14 | Force Tags SOL_Test |
| 15 | |
| 16 | |
Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 17 | *** Variables *** |
| 18 | |
| 19 | *** Test Cases *** |
| 20 | |
Rahul Maheshwari | d71cd95 | 2017-06-20 21:30:51 -0500 | [diff] [blame] | 21 | Set SOL Enabled |
| 22 | [Documentation] Verify enabling SOL via IPMI. |
| 23 | [Tags] Set_SOL_Enabled |
| 24 | |
| 25 | ${msg}= Run Keyword Run IPMI Standard Command |
| 26 | ... sol set enabled true |
| 27 | |
| 28 | # Verify SOL status from ipmitool sol info command. |
| 29 | ${sol_info_dict}= Get SOL Info |
| 30 | ${sol_enable_status}= Get From Dictionary |
| 31 | ... ${sol_info_dict} Enabled |
| 32 | |
| 33 | Should Be Equal '${sol_enable_status}' 'true' |
| 34 | |
| 35 | |
| 36 | Set SOL Disabled |
| 37 | [Documentation] Verify disabling SOL via IPMI. |
| 38 | [Tags] Set_SOL_Disabled |
| 39 | |
| 40 | ${msg}= Run Keyword Run IPMI Standard Command |
| 41 | ... sol set enabled false |
| 42 | |
| 43 | # Verify SOL status from ipmitool sol info command. |
| 44 | ${sol_info_dict}= Get SOL Info |
| 45 | ${sol_enable_status}= Get From Dictionary |
| 46 | ... ${sol_info_dict} Enabled |
| 47 | Should Be Equal '${sol_enable_status}' 'false' |
| 48 | |
| 49 | # Verify error while activating SOL with SOL disabled. |
| 50 | ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command |
| 51 | ... sol activate |
| 52 | Should Contain ${msg} SOL payload disabled ignore_case=True |
| 53 | |
| 54 | |
Rahul Maheshwari | 6fe52b9 | 2017-06-16 03:35:26 -0500 | [diff] [blame] | 55 | Set Valid SOL Privilege Level |
| 56 | [Documentation] Verify valid SOL's privilege level via IPMI. |
| 57 | [Tags] Set_Valid_SOL_Privilege_Level |
| 58 | |
| 59 | ${privilege_level_list}= Create List user operator admin oem |
Sushil Singh | ab209cd | 2020-07-01 09:01:14 -0500 | [diff] [blame^] | 60 | |
| 61 | FOR ${item} IN @{privilege_level_list} |
| 62 | Set SOL Setting privilege-level ${item} |
| 63 | ${output}= Get SOL Setting Privilege Level |
| 64 | Should Contain ${output} ${item} ignore_case=True |
| 65 | END |
Rahul Maheshwari | 6fe52b9 | 2017-06-16 03:35:26 -0500 | [diff] [blame] | 66 | |
| 67 | |
| 68 | Set Invalid SOL Privilege Level |
| 69 | [Documentation] Verify invalid SOL's retry count via IPMI. |
| 70 | [Tags] Set_Invalid_SOL_Privilege_Level |
| 71 | |
| 72 | ${value}= Generate Random String ${8} |
| 73 | ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command |
| 74 | ... sol set privilege-level ${value} |
| 75 | Should Contain ${msg} Invalid value ignore_case=True |
| 76 | |
| 77 | |
Rahul Maheshwari | a88de44 | 2017-06-16 01:05:16 -0500 | [diff] [blame] | 78 | Set Invalid SOL Retry Count |
| 79 | [Documentation] Verify invalid SOL's retry count via IPMI. |
| 80 | [Tags] Set_Invalid_SOL_Retry_Count |
| 81 | |
Gunnar Mills | 28e403b | 2017-10-25 16:16:38 -0500 | [diff] [blame] | 82 | # Any integer above 7 is invalid for SOL retry count. |
Rahul Maheshwari | a88de44 | 2017-06-16 01:05:16 -0500 | [diff] [blame] | 83 | ${value}= Evaluate random.randint(8, 10000) modules=random |
| 84 | |
| 85 | ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command |
| 86 | ... sol set retry-count ${value} |
| 87 | Should Contain ${msg} Invalid value ignore_case=True |
| 88 | |
| 89 | |
| 90 | Set Invalid SOL Retry Interval |
| 91 | [Documentation] Verify invalid SOL's retry interval via IPMI. |
| 92 | [Tags] Set_Invalid_SOL_Retry_Interval |
| 93 | |
Gunnar Mills | 28e403b | 2017-10-25 16:16:38 -0500 | [diff] [blame] | 94 | # Any integer above 255 is invalid for SOL retry interval. |
Rahul Maheshwari | a88de44 | 2017-06-16 01:05:16 -0500 | [diff] [blame] | 95 | ${value}= Evaluate random.randint(256, 10000) modules=random |
| 96 | |
| 97 | ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command |
| 98 | ... sol set retry-interval ${value} |
| 99 | Should Contain ${msg} Invalid value ignore_case=True |
| 100 | |
| 101 | |
| 102 | Set Invalid SOL Character Accumulate Level |
| 103 | [Documentation] Verify invalid SOL's character accumulate level via IPMI. |
| 104 | [Tags] Set_Invalid_SOL_Character_Accumulate_Level |
| 105 | |
| 106 | # Any integer above 255 is invalid for SOL character accumulate level. |
| 107 | ${value}= Evaluate random.randint(256, 10000) modules=random |
| 108 | |
| 109 | ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command |
| 110 | ... sol set character-accumulate-level ${value} |
| 111 | Should Contain ${msg} Invalid value ignore_case=True |
| 112 | |
| 113 | |
| 114 | Set Invalid SOL Character Send Threshold |
| 115 | [Documentation] Verify invalid SOL's character send threshold via IPMI. |
| 116 | [Tags] Set_Invalid_SOL_Character_Send_Threshold |
| 117 | |
Gunnar Mills | 28e403b | 2017-10-25 16:16:38 -0500 | [diff] [blame] | 118 | # Any integer above 255 is invalid for SOL character send threshold. |
Rahul Maheshwari | a88de44 | 2017-06-16 01:05:16 -0500 | [diff] [blame] | 119 | ${value}= Evaluate random.randint(256, 10000) modules=random |
| 120 | |
| 121 | ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command |
| 122 | ... sol set character-send-threshold ${value} |
| 123 | Should Contain ${msg} Invalid value ignore_case=True |
| 124 | |
| 125 | |
George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 126 | Verify SOL During Boot |
| 127 | [Documentation] Verify SOL during boot. |
| 128 | [Tags] Verify_SOL_During_Boot |
| 129 | |
George Keishing | e053d34 | 2019-10-25 07:16:20 -0500 | [diff] [blame] | 130 | Redfish Hard Power Off |
George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 131 | Activate SOL Via IPMI |
George Keishing | e053d34 | 2019-10-25 07:16:20 -0500 | [diff] [blame] | 132 | Initiate Host Boot Via External IPMI wait=${0} |
George Keishing | de9804a | 2017-09-28 04:03:11 -0500 | [diff] [blame] | 133 | |
George Keishing | e053d34 | 2019-10-25 07:16:20 -0500 | [diff] [blame] | 134 | Wait Until Keyword Succeeds 3 mins 15 secs |
| 135 | ... Check IPMI SOL Output Content Welcome to Hostboot |
| 136 | |
| 137 | Wait Until Keyword Succeeds 3 mins 15 secs |
| 138 | ... Check IPMI SOL Output Content ISTEP |
| 139 | |
| 140 | Redfish Hard Power Off |
George Keishing | 5632f3c | 2018-11-01 00:39:10 -0500 | [diff] [blame] | 141 | |
| 142 | |
George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 143 | Verify Deactivate Non Existing SOL |
| 144 | [Documentation] Verify deactivate non existing SOL session. |
| 145 | [Tags] Verify_Deactivate_Non_Existing_SOL |
| 146 | |
| 147 | ${resp}= Deactivate SOL Via IPMI |
| 148 | Should Contain ${resp} SOL payload already de-activated |
| 149 | ... case_insensitive=True |
| 150 | |
| 151 | |
| 152 | Set Valid SOL Retry Count |
George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 153 | [Documentation] Verify valid SOL's retry count via IPMI. |
| 154 | [Tags] Set_Valid_SOL_Retry_Count |
George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 155 | [Template] Verify SOL Setting |
| 156 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 157 | # Setting name Min valid value Max valid value |
| 158 | retry-count 0 7 |
| 159 | |
George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 160 | |
| 161 | Set Valid SOL Retry Interval |
George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 162 | [Documentation] Verify valid SOL's retry interval via IPMI. |
| 163 | [Tags] Set_Valid_SOL_Retry_Interval |
George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 164 | [Template] Verify SOL Setting |
| 165 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 166 | # Setting name Min valid value Max valid value |
| 167 | retry-interval 0 255 |
| 168 | |
George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 169 | |
| 170 | Set Valid SOL Character Accumulate Level |
George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 171 | [Documentation] Verify valid SOL's character accumulate level via IPMI. |
| 172 | [Tags] Set_Valid_SOL_Character_Accumulate_Level |
George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 173 | [Template] Verify SOL Setting |
| 174 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 175 | # Setting name Min valid value Max valid value |
| 176 | character-accumulate-level 1 255 |
| 177 | |
George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 178 | |
| 179 | Set Valid SOL Character Send Threshold |
George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 180 | [Documentation] Verify valid SOL's character send threshold via IPMI. |
| 181 | [Tags] Set_Valid_SOL_Character_Send_Threshold |
George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 182 | [Template] Verify SOL Setting |
| 183 | |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 184 | # Setting name Min valid value Max valid value |
| 185 | character-send-threshold 0 255 |
| 186 | |
Anusha Dathatri | c3a0bb7 | 2020-02-12 07:52:40 -0600 | [diff] [blame] | 187 | |
| 188 | Verify Continuous Activation And Deactivation Of SOL |
| 189 | [Documentation] Continuously on and off SOL. |
| 190 | [Tags] Verify_Continuous_Activation_And_Deactivation_Of_SOL |
| 191 | |
| 192 | ${iteration_count}= Evaluate random.randint(5,10) modules=random |
| 193 | FOR ${iter} IN RANGE ${iteration_count} |
| 194 | Activate SOL Via IPMI |
| 195 | Deactivate SOL Via IPMI |
| 196 | END |
| 197 | |
| 198 | |
Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 199 | *** Keywords *** |
| 200 | |
Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 201 | Check IPMI SOL Output Content |
| 202 | [Documentation] Check if SOL has given content. |
| 203 | [Arguments] ${data} ${file_path}=/tmp/sol_${OPENBMC_HOST} |
| 204 | # Description of argument(s): |
| 205 | # data Content which need to be checked(e.g. Petitboot, ISTEP). |
| 206 | # file_path The file path on the local machine to check SOL content. |
| 207 | # By default it check SOL content from /tmp/sol_<BMC_IP>. |
| 208 | |
George Keishing | 6f88c5e | 2019-07-03 13:54:12 -0500 | [diff] [blame] | 209 | ${output}= OperatingSystem.Get File ${file_path} encoding_errors=ignore |
Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 210 | Should Contain ${output} ${data} case_insensitive=True |
Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 211 | |
| 212 | |
| 213 | Verify SOL Setting |
| 214 | [Documentation] Verify SOL Setting via IPMI. |
| 215 | [Arguments] ${setting_name} ${min_value} ${max_value} |
| 216 | # Description of Arguments: |
| 217 | # setting_name Setting to verify (e.g. "retry-count"). |
| 218 | # min_value min valid value for given setting. |
| 219 | # max_value max valid value for given setting. |
| 220 | |
| 221 | ${value}= |
| 222 | ... Evaluate random.randint(${min_value}, ${max_value}) modules=random |
| 223 | |
| 224 | # Character accumulate level setting is set in multiples of 5. |
| 225 | # Retry interval setting is set in multiples of 10. |
| 226 | # Reference IPMI specification v2.0 |
| 227 | |
| 228 | ${expected_value}= Run Keyword If |
| 229 | ... '${setting_name}' == 'character-accumulate-level' Evaluate ${value}*5 |
| 230 | ... ELSE IF '${setting_name}' == 'retry-interval' Evaluate ${value}*10 |
| 231 | ... ELSE Set Variable ${value} |
| 232 | |
| 233 | Set SOL Setting ${setting_name} '${value}' |
| 234 | |
| 235 | # Replace "-" with space " " in setting name. |
| 236 | # E.g. "retry-count" to "retry count" |
| 237 | ${setting_name}= Evaluate $setting_name.replace('-',' ') |
| 238 | |
| 239 | ${sol_info_dict}= Get SOL Info |
| 240 | |
| 241 | # Get exact SOL setting name from sol info output. |
| 242 | ${list}= Get Matches ${sol_info_dict} ${setting_name}* |
| 243 | ... case_insensitive=${True} |
| 244 | ${setting_name_from_dict}= Get From List ${list} 0 |
| 245 | |
| 246 | # Get SOL setting value from above setting name. |
| 247 | ${setting_value}= Get From Dictionary |
| 248 | ... ${sol_info_dict} ${setting_name_from_dict} |
| 249 | |
| 250 | Should Be Equal '${setting_value}' '${expected_value}' |
| 251 | |
George Keishing | e053d34 | 2019-10-25 07:16:20 -0500 | [diff] [blame] | 252 | Redfish Hard Power Off |
| 253 | |
Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 254 | Initiate Host Boot Via External IPMI wait=${0} |
| 255 | |
| 256 | Activate SOL Via IPMI |
George Keishing | e053d34 | 2019-10-25 07:16:20 -0500 | [diff] [blame] | 257 | Wait Until Keyword Succeeds 3 mins 15 secs |
George Keishing | d6ddf49 | 2018-10-24 09:53:12 -0500 | [diff] [blame] | 258 | ... Check IPMI SOL Output Content Welcome to Hostboot |
George Keishing | 0ea976a | 2017-12-08 01:09:40 -0600 | [diff] [blame] | 259 | |
George Keishing | e053d34 | 2019-10-25 07:16:20 -0500 | [diff] [blame] | 260 | Wait Until Keyword Succeeds 3 mins 15 secs |
George Keishing | 0ea976a | 2017-12-08 01:09:40 -0600 | [diff] [blame] | 261 | ... Check IPMI SOL Output Content ISTEP |
Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 262 | |
George Keishing | e053d34 | 2019-10-25 07:16:20 -0500 | [diff] [blame] | 263 | |
Rahul Maheshwari | 9e0b4d6 | 2017-06-21 06:42:46 -0500 | [diff] [blame] | 264 | Get SOL Setting |
| 265 | [Documentation] Returns status for given SOL setting. |
| 266 | [Arguments] ${setting} |
| 267 | # Description of argument(s): |
| 268 | # setting SOL setting which needs to be read(e.g. "Retry Count"). |
| 269 | |
| 270 | ${sol_info_dict}= Get SOL Info |
| 271 | ${setting_status}= Get From Dictionary ${sol_info_dict} ${setting} |
| 272 | |
| 273 | [Return] ${setting_status} |
| 274 | |
Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 275 | |
| 276 | Restore Default SOL Configuration |
| 277 | [Documentation] Restore default SOL configuration. |
| 278 | |
Rahul Maheshwari | d71cd95 | 2017-06-20 21:30:51 -0500 | [diff] [blame] | 279 | Set SOL Setting enabled true |
Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 280 | Set SOL Setting retry-count 7 |
| 281 | Set SOL Setting retry-interval 10 |
| 282 | Set SOL Setting character-accumulate-level 20 |
| 283 | Set SOL Setting character-send-threshold 1 |
Rahul Maheshwari | 6fe52b9 | 2017-06-16 03:35:26 -0500 | [diff] [blame] | 284 | Set SOL Setting privilege-level user |
Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 285 | |
Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 286 | |
George Keishing | 0ea976a | 2017-12-08 01:09:40 -0600 | [diff] [blame] | 287 | Test Teardown Execution |
Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 288 | [Documentation] Do the post test teardown. |
| 289 | |
George Keishing | e053d34 | 2019-10-25 07:16:20 -0500 | [diff] [blame] | 290 | Wait Until Keyword Succeeds 15 sec 5 sec Restore Default SOL Configuration |
Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 291 | Deactivate SOL Via IPMI |
Rahul Maheshwari | 2a17511 | 2017-08-22 05:06:49 -0500 | [diff] [blame] | 292 | ${sol_log}= Stop SOL Console Logging |
| 293 | Log ${sol_log} |
Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 294 | FFDC On Test Case Fail |