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