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