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