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