| 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 | 
| chithrag | dc5679e | 2022-03-01 11:51:41 +0000 | [diff] [blame] | 10 | Variables           ../data/ipmi_raw_cmd_table.py | 
| Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 11 |  | 
| Rahul Maheshwari | 2a17511 | 2017-08-22 05:06:49 -0500 | [diff] [blame] | 12 | Test Setup          Start SOL Console Logging | 
| George Keishing | 0ea976a | 2017-12-08 01:09:40 -0600 | [diff] [blame] | 13 | Test Teardown       Test Teardown Execution | 
| Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 14 |  | 
| Matt Fischer | 6fb70d9 | 2023-10-24 19:06:33 -0600 | [diff] [blame] | 15 | Test Tags          IPMI_SOL | 
| Rahul Maheshwari | 7eea8ed | 2018-12-18 04:51:38 -0600 | [diff] [blame] | 16 |  | 
| Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 17 | *** Variables *** | 
 | 18 |  | 
| chithrag | dc5679e | 2022-03-01 11:51:41 +0000 | [diff] [blame] | 19 | @{valid_bit_rates}    ${9.6}  ${19.2}  ${38.4}  ${57.6}  ${115.2} | 
 | 20 | @{setinprogress}      set-complete  set-in-progress  commit-write | 
 | 21 | ${invalid_bit_rate}   7.5 | 
 | 22 |  | 
 | 23 |  | 
| Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 24 | *** Test Cases *** | 
 | 25 |  | 
| Rahul Maheshwari | d71cd95 | 2017-06-20 21:30:51 -0500 | [diff] [blame] | 26 | Set SOL Enabled | 
 | 27 |     [Documentation]  Verify enabling SOL via IPMI. | 
 | 28 |     [Tags]  Set_SOL_Enabled | 
 | 29 |  | 
| ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 30 |     ${msg}=  Run Keyword  Run External IPMI Standard Command | 
| Rahul Maheshwari | d71cd95 | 2017-06-20 21:30:51 -0500 | [diff] [blame] | 31 |     ...  sol set enabled true | 
 | 32 |  | 
 | 33 |     # Verify SOL status from ipmitool sol info command. | 
 | 34 |     ${sol_info_dict}=  Get SOL Info | 
 | 35 |     ${sol_enable_status}=  Get From Dictionary | 
 | 36 |     ...  ${sol_info_dict}  Enabled | 
 | 37 |  | 
 | 38 |     Should Be Equal  '${sol_enable_status}'  'true' | 
 | 39 |  | 
 | 40 |  | 
 | 41 | Set SOL Disabled | 
 | 42 |     [Documentation]  Verify disabling SOL via IPMI. | 
 | 43 |     [Tags]  Set_SOL_Disabled | 
 | 44 |  | 
| ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 45 |     ${msg}=  Run Keyword  Run External IPMI Standard Command | 
| Rahul Maheshwari | d71cd95 | 2017-06-20 21:30:51 -0500 | [diff] [blame] | 46 |     ...  sol set enabled false | 
 | 47 |  | 
 | 48 |     # Verify SOL status from ipmitool sol info command. | 
 | 49 |     ${sol_info_dict}=  Get SOL Info | 
 | 50 |     ${sol_enable_status}=  Get From Dictionary | 
 | 51 |     ...  ${sol_info_dict}  Enabled | 
 | 52 |     Should Be Equal  '${sol_enable_status}'  'false' | 
 | 53 |  | 
 | 54 |     # Verify error while activating SOL with SOL disabled. | 
| ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 55 |     ${msg}=  Run Keyword And Expect Error  *  Run External IPMI Standard Command | 
| Rahul Maheshwari | d71cd95 | 2017-06-20 21:30:51 -0500 | [diff] [blame] | 56 |     ...  sol activate | 
 | 57 |     Should Contain  ${msg}  SOL payload disabled  ignore_case=True | 
 | 58 |  | 
 | 59 |  | 
| Rahul Maheshwari | 6fe52b9 | 2017-06-16 03:35:26 -0500 | [diff] [blame] | 60 | Set Valid SOL Privilege Level | 
 | 61 |     [Documentation]  Verify valid SOL's privilege level via IPMI. | 
 | 62 |     [Tags]  Set_Valid_SOL_Privilege_Level | 
 | 63 |  | 
 | 64 |     ${privilege_level_list}=  Create List  user  operator  admin  oem | 
| Sushil Singh | ab209cd | 2020-07-01 09:01:14 -0500 | [diff] [blame] | 65 |  | 
 | 66 |     FOR  ${item}  IN  @{privilege_level_list} | 
 | 67 |       Set SOL Setting  privilege-level  ${item} | 
 | 68 |       ${output}=  Get SOL Setting  Privilege Level | 
 | 69 |       Should Contain  ${output}  ${item}  ignore_case=True | 
 | 70 |     END | 
| Rahul Maheshwari | 6fe52b9 | 2017-06-16 03:35:26 -0500 | [diff] [blame] | 71 |  | 
 | 72 |  | 
 | 73 | Set Invalid SOL Privilege Level | 
 | 74 |     [Documentation]  Verify invalid SOL's retry count via IPMI. | 
 | 75 |     [Tags]  Set_Invalid_SOL_Privilege_Level | 
 | 76 |  | 
 | 77 |     ${value}=  Generate Random String  ${8} | 
| ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 78 |     ${msg}=  Run Keyword And Expect Error  *  Run External IPMI Standard Command | 
| Rahul Maheshwari | 6fe52b9 | 2017-06-16 03:35:26 -0500 | [diff] [blame] | 79 |     ...  sol set privilege-level ${value} | 
 | 80 |     Should Contain  ${msg}  Invalid value  ignore_case=True | 
 | 81 |  | 
 | 82 |  | 
| Rahul Maheshwari | a88de44 | 2017-06-16 01:05:16 -0500 | [diff] [blame] | 83 | Set Invalid SOL Retry Count | 
 | 84 |     [Documentation]  Verify invalid SOL's retry count via IPMI. | 
 | 85 |     [Tags]  Set_Invalid_SOL_Retry_Count | 
 | 86 |  | 
| Gunnar Mills | 28e403b | 2017-10-25 16:16:38 -0500 | [diff] [blame] | 87 |     # Any integer above 7 is invalid for SOL retry count. | 
| Rahul Maheshwari | a88de44 | 2017-06-16 01:05:16 -0500 | [diff] [blame] | 88 |     ${value}=  Evaluate  random.randint(8, 10000)  modules=random | 
 | 89 |  | 
| ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 90 |     ${msg}=  Run Keyword And Expect Error  *  Run External IPMI Standard Command | 
| Rahul Maheshwari | a88de44 | 2017-06-16 01:05:16 -0500 | [diff] [blame] | 91 |     ...  sol set retry-count ${value} | 
 | 92 |     Should Contain  ${msg}  Invalid value  ignore_case=True | 
 | 93 |  | 
 | 94 |  | 
 | 95 | Set Invalid SOL Retry Interval | 
 | 96 |     [Documentation]  Verify invalid SOL's retry interval via IPMI. | 
 | 97 |     [Tags]  Set_Invalid_SOL_Retry_Interval | 
 | 98 |  | 
| Gunnar Mills | 28e403b | 2017-10-25 16:16:38 -0500 | [diff] [blame] | 99 |     # Any integer above 255 is invalid for SOL retry interval. | 
| Rahul Maheshwari | a88de44 | 2017-06-16 01:05:16 -0500 | [diff] [blame] | 100 |     ${value}=  Evaluate  random.randint(256, 10000)  modules=random | 
 | 101 |  | 
| ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 102 |     ${msg}=  Run Keyword And Expect Error  *  Run External IPMI Standard Command | 
| Rahul Maheshwari | a88de44 | 2017-06-16 01:05:16 -0500 | [diff] [blame] | 103 |     ...  sol set retry-interval ${value} | 
 | 104 |     Should Contain  ${msg}  Invalid value  ignore_case=True | 
 | 105 |  | 
 | 106 |  | 
 | 107 | Set Invalid SOL Character Accumulate Level | 
 | 108 |     [Documentation]  Verify invalid SOL's character accumulate level via IPMI. | 
 | 109 |     [Tags]  Set_Invalid_SOL_Character_Accumulate_Level | 
 | 110 |  | 
 | 111 |     # Any integer above 255 is invalid for SOL character accumulate level. | 
 | 112 |     ${value}=  Evaluate  random.randint(256, 10000)  modules=random | 
 | 113 |  | 
| ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 114 |     ${msg}=  Run Keyword And Expect Error  *  Run External IPMI Standard Command | 
| Rahul Maheshwari | a88de44 | 2017-06-16 01:05:16 -0500 | [diff] [blame] | 115 |     ...  sol set character-accumulate-level ${value} | 
 | 116 |     Should Contain  ${msg}  Invalid value  ignore_case=True | 
 | 117 |  | 
 | 118 |  | 
 | 119 | Set Invalid SOL Character Send Threshold | 
 | 120 |     [Documentation]  Verify invalid SOL's character send threshold via IPMI. | 
 | 121 |     [Tags]  Set_Invalid_SOL_Character_Send_Threshold | 
 | 122 |  | 
| Gunnar Mills | 28e403b | 2017-10-25 16:16:38 -0500 | [diff] [blame] | 123 |     # Any integer above 255 is invalid for SOL character send threshold. | 
| Rahul Maheshwari | a88de44 | 2017-06-16 01:05:16 -0500 | [diff] [blame] | 124 |     ${value}=  Evaluate  random.randint(256, 10000)  modules=random | 
 | 125 |  | 
| ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 126 |     ${msg}=  Run Keyword And Expect Error  *  Run External IPMI Standard Command | 
| Rahul Maheshwari | a88de44 | 2017-06-16 01:05:16 -0500 | [diff] [blame] | 127 |     ...  sol set character-send-threshold ${value} | 
 | 128 |     Should Contain  ${msg}  Invalid value  ignore_case=True | 
 | 129 |  | 
 | 130 |  | 
| George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 131 | Verify SOL During Boot | 
| chithrag | 0f0bd53 | 2022-04-05 09:49:53 +0000 | [diff] [blame] | 132 |     [Documentation]  Verify SOL activate console output during boot. | 
| George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 133 |     [Tags]  Verify_SOL_During_Boot | 
 | 134 |  | 
| George Keishing | 2620672 | 2021-11-17 01:29:53 -0600 | [diff] [blame] | 135 |     IPMI Power Off  stack_mode=skip | 
| George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 136 |     Activate SOL Via IPMI | 
| George Keishing | e053d34 | 2019-10-25 07:16:20 -0500 | [diff] [blame] | 137 |     Initiate Host Boot Via External IPMI  wait=${0} | 
| George Keishing | de9804a | 2017-09-28 04:03:11 -0500 | [diff] [blame] | 138 |  | 
| chithrag | 0f0bd53 | 2022-04-05 09:49:53 +0000 | [diff] [blame] | 139 |     Should Not Be Empty  ${SOL_BIOS_OUTPUT} | 
 | 140 |     Should Not Be Empty  ${SOL_LOGIN_OUTPUT} | 
| George Keishing | e053d34 | 2019-10-25 07:16:20 -0500 | [diff] [blame] | 141 |  | 
| chithrag | 0f0bd53 | 2022-04-05 09:49:53 +0000 | [diff] [blame] | 142 |     # Content takes maximum of 10 minutes to display in SOL console | 
 | 143 |     # SOL_BIOS_OUTPUT - BIOS SOL console output | 
 | 144 |     ${status}=  Run Keyword And Return Status  Wait Until Keyword Succeeds  10 mins  15 secs | 
 | 145 |     ...  Check IPMI SOL Output Content  ${SOL_BIOS_OUTPUT} | 
| George Keishing | e053d34 | 2019-10-25 07:16:20 -0500 | [diff] [blame] | 146 |  | 
| George Keishing | 3a15f82 | 2025-06-17 22:17:48 +0530 | [diff] [blame] | 147 |     IF  '${status}' == 'False' | 
 | 148 |         IPMI Power Off | 
 | 149 |         FAIL  msg=BIOS not loaded. | 
 | 150 |     END | 
| chithrag | 0f0bd53 | 2022-04-05 09:49:53 +0000 | [diff] [blame] | 151 |  | 
 | 152 |     # SOL_LOGIN_OUTPUT - SOL output login prompt | 
 | 153 |     # Once host reboot completes, SOL console may take maximum of 15 minutes to get the login prompt. | 
 | 154 |     ${status}=  Run Keyword And Return Status  Wait Until Keyword Succeeds  15 mins  15 secs | 
 | 155 |     ...  Check IPMI SOL Output Content  ${SOL_LOGIN_OUTPUT} | 
 | 156 |  | 
| George Keishing | 3a15f82 | 2025-06-17 22:17:48 +0530 | [diff] [blame] | 157 |     IF  '${status}' == 'False'  IPMI Power Off | 
| George Keishing | 5632f3c | 2018-11-01 00:39:10 -0500 | [diff] [blame] | 158 |  | 
 | 159 |  | 
| George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 160 | Verify Deactivate Non Existing SOL | 
 | 161 |     [Documentation]  Verify deactivate non existing SOL session. | 
 | 162 |     [Tags]  Verify_Deactivate_Non_Existing_SOL | 
 | 163 |  | 
 | 164 |     ${resp}=  Deactivate SOL Via IPMI | 
 | 165 |     Should Contain  ${resp}  SOL payload already de-activated | 
 | 166 |     ...  case_insensitive=True | 
 | 167 |  | 
 | 168 |  | 
 | 169 | Set Valid SOL Retry Count | 
| George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 170 |     [Documentation]  Verify valid SOL's retry count via IPMI. | 
 | 171 |     [Tags]  Set_Valid_SOL_Retry_Count | 
| 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 |     retry-count       0                  7 | 
 | 176 |  | 
| George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 177 |  | 
 | 178 | Set Valid SOL Retry Interval | 
| George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 179 |     [Documentation]  Verify valid SOL's retry interval via IPMI. | 
 | 180 |     [Tags]  Set_Valid_SOL_Retry_Interval | 
| 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 |     retry-interval    0                  255 | 
 | 185 |  | 
| George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 186 |  | 
 | 187 | Set Valid SOL Character Accumulate Level | 
| George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 188 |     [Documentation]  Verify valid SOL's character accumulate level via IPMI. | 
 | 189 |     [Tags]  Set_Valid_SOL_Character_Accumulate_Level | 
| George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 190 |     [Template]  Verify SOL Setting | 
 | 191 |  | 
| George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 192 |     # Setting name              Min valid value    Max valid value | 
 | 193 |     character-accumulate-level  1                  255 | 
 | 194 |  | 
| George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 195 |  | 
 | 196 | Set Valid SOL Character Send Threshold | 
| George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 197 |     [Documentation]  Verify valid SOL's character send threshold via IPMI. | 
 | 198 |     [Tags]  Set_Valid_SOL_Character_Send_Threshold | 
| George Keishing | 1ca77aa | 2017-08-21 23:55:51 -0500 | [diff] [blame] | 199 |     [Template]  Verify SOL Setting | 
 | 200 |  | 
| George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 201 |     # Setting name              Min valid value    Max valid value | 
 | 202 |     character-send-threshold    0                  255 | 
 | 203 |  | 
| Anusha Dathatri | c3a0bb7 | 2020-02-12 07:52:40 -0600 | [diff] [blame] | 204 |  | 
 | 205 | Verify Continuous Activation And Deactivation Of SOL | 
 | 206 |     [Documentation]  Continuously on and off SOL. | 
 | 207 |     [Tags]  Verify_Continuous_Activation_And_Deactivation_Of_SOL | 
 | 208 |  | 
 | 209 |     ${iteration_count}=  Evaluate  random.randint(5,10)  modules=random | 
 | 210 |     FOR  ${iter}  IN RANGE  ${iteration_count} | 
 | 211 |         Activate SOL Via IPMI | 
 | 212 |         Deactivate SOL Via IPMI | 
 | 213 |     END | 
 | 214 |  | 
 | 215 |  | 
| chithrag | dc5679e | 2022-03-01 11:51:41 +0000 | [diff] [blame] | 216 | Verify SOL Payload Channel | 
 | 217 |     [Documentation]  Verify SOL payload channel from SOL info. | 
 | 218 |     [Tags]  Verify_SOL_Payload_Channel | 
 | 219 |  | 
 | 220 |     # Get channel number from SOL Info and verify it is not empty. | 
 | 221 |     ${payload_channel}=  Get SOL Setting  Payload Channel | 
 | 222 |     Should Not Be Empty  ${payload_channel} | 
 | 223 |  | 
 | 224 |  | 
 | 225 | Verify SOL Payload Port | 
 | 226 |     [Documentation]  Verify SOL payload port from SOL info. | 
 | 227 |     [Tags]  Verify_SOL_Payload_Port | 
 | 228 |  | 
 | 229 |     # Get Payload Port from SOL Info and verify it equal with ipmi port. | 
 | 230 |     ${payload_port}=  Get SOL Setting  Payload Port | 
 | 231 |     Should Be Equal  ${IPMI_PORT}  ${payload_port} | 
 | 232 |  | 
 | 233 |  | 
 | 234 | Set Valid SOL Non Volatile Bit Rate | 
 | 235 |     [Documentation]  Verify ability to set valid SOL non-volatile bit rate. | 
 | 236 |     [Tags]  Set_Valid_SOL_Non_Volatile_Bit_Rate | 
 | 237 |  | 
 | 238 |     FOR  ${bit_rate}  IN  @{valid_bit_rates} | 
 | 239 |  | 
 | 240 |       # Set valid non-volatile-bit-rate from SOL Info. | 
 | 241 |       Run Keyword And Expect Error  *Parameter not supported* | 
| ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 242 |       ...  Run External IPMI Standard Command | 
| chithrag | dc5679e | 2022-03-01 11:51:41 +0000 | [diff] [blame] | 243 |       ...  sol set non-volatile-bit-rate ${bit_rate} | 
 | 244 |  | 
 | 245 |     END | 
 | 246 |  | 
 | 247 |  | 
 | 248 | Set Invalid SOL Non Volatile Bit Rate | 
 | 249 |     [Documentation]  Verify ability to set invalid SOL non-volatile bit rate. | 
 | 250 |     [Tags]  Set_Invalid_SOL_Non_Volatile_Bit_Rate | 
 | 251 |  | 
 | 252 |     # Set Invalid non-volatile-bit-rate from SOL Info. | 
 | 253 |     ${resp} =  Run Keyword and Expect Error  *${IPMI_RAW_CMD['SOL']['Set_SOL'][0]}* | 
| ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 254 |     ...  Run External IPMI Standard Command  sol set non-volatile-bit-rate ${invalid_bit_rate} | 
| chithrag | dc5679e | 2022-03-01 11:51:41 +0000 | [diff] [blame] | 255 |  | 
 | 256 |     # Compares whether valid values are displayed. | 
 | 257 |     Should Contain  ${resp}  ${IPMI_RAW_CMD['SOL']['Set_SOL'][1]}  ignore_case=True | 
 | 258 |  | 
 | 259 |  | 
 | 260 | Set Valid SOL Volatile Bit Rate | 
 | 261 |     [Documentation]  Verify ability to set valid SOL volatile bit rate. | 
 | 262 |     [Tags]  Set_Valid_SOL_Volatile_Bit_Rate | 
 | 263 |  | 
 | 264 |     FOR  ${bit_rate}  IN  @{valid_bit_rates} | 
 | 265 |  | 
 | 266 |       # Set valid volatile-bit-rate from SOL Info. | 
 | 267 |       Run Keyword and Expect Error  *Parameter not supported* | 
| ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 268 |       ...  Run External IPMI Standard Command | 
| chithrag | dc5679e | 2022-03-01 11:51:41 +0000 | [diff] [blame] | 269 |       ...  sol set volatile-bit-rate ${bit_rate} | 
 | 270 |  | 
 | 271 |     END | 
 | 272 |  | 
 | 273 |  | 
 | 274 | Set Invalid SOL Volatile Bit Rate | 
 | 275 |     [Documentation]  Verify ability to set invalid SOL volatile bit rate. | 
 | 276 |     [Tags]  Set_Invalid_SOL_Volatile_Bit_Rate | 
 | 277 |  | 
 | 278 |     # Set invalid volatile-bit-rate from SOL Info. | 
 | 279 |     ${resp} =  Run Keyword and Expect Error  *${IPMI_RAW_CMD['SOL']['Set_SOL'][0]}* | 
| ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 280 |     ...  Run External IPMI Standard Command  sol set volatile-bit-rate ${invalid_bit_rate} | 
| chithrag | dc5679e | 2022-03-01 11:51:41 +0000 | [diff] [blame] | 281 |  | 
 | 282 |     # Compares whether valid values are displayed. | 
 | 283 |     Should Contain  ${resp}  ${IPMI_RAW_CMD['SOL']['Set_SOL'][1]}  ignore_case=True | 
 | 284 |  | 
 | 285 |  | 
 | 286 | Verify SOL Set In Progress | 
 | 287 |     [Documentation]  Verify ability to set the set in-progress data for SOL. | 
 | 288 |     [Tags]  Verify_SOL_Set_In_Progress | 
 | 289 |     [Teardown]  Run Keywords  Set SOL Setting  set-in-progress  set-complete | 
 | 290 |     ...         AND  Test Teardown Execution | 
 | 291 |  | 
 | 292 |     # Set the param 0 - set-in-progress from SOL Info. | 
 | 293 |     FOR  ${prog}  IN  @{setinprogress} | 
| ishwaryamathim | 372cd86 | 2023-11-14 18:12:23 +0000 | [diff] [blame] | 294 |        Run Keyword  Run External IPMI Standard Command  sol set set-in-progress ${prog} | 
| chithrag | dc5679e | 2022-03-01 11:51:41 +0000 | [diff] [blame] | 295 |        # Get the param 0 - set-in-progress from SOL Info and verify. | 
 | 296 |        ${set_inprogress_state}=  Get SOL Setting  Set in progress | 
 | 297 |        Should Be Equal  ${prog}  ${set_inprogress_state} | 
 | 298 |     END | 
 | 299 |  | 
 | 300 |  | 
| Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 301 | *** Keywords *** | 
 | 302 |  | 
| Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 303 | Check IPMI SOL Output Content | 
 | 304 |     [Documentation]  Check if SOL has given content. | 
| George Keishing | 2620672 | 2021-11-17 01:29:53 -0600 | [diff] [blame] | 305 |     [Arguments]  ${data}  ${file_path}=${IPMI_SOL_LOG_FILE} | 
| Nagarjun B | 2fe6d9e | 2023-05-25 13:29:12 +0530 | [diff] [blame] | 306 |  | 
| Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 307 |     # Description of argument(s): | 
 | 308 |     # data       Content which need to be checked(e.g. Petitboot, ISTEP). | 
 | 309 |     # file_path  The file path on the local machine to check SOL content. | 
| George Keishing | 2620672 | 2021-11-17 01:29:53 -0600 | [diff] [blame] | 310 |     #            By default it check SOL content from log/sol_<BMC_IP>. | 
| Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 311 |  | 
| George Keishing | 6f88c5e | 2019-07-03 13:54:12 -0500 | [diff] [blame] | 312 |     ${output}=  OperatingSystem.Get File  ${file_path}  encoding_errors=ignore | 
| Nagarjun B | 2fe6d9e | 2023-05-25 13:29:12 +0530 | [diff] [blame] | 313 |     Should Match Regexp  ${output}  ${data}  case_insensitive=True | 
| Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 314 |  | 
 | 315 |  | 
 | 316 | Verify SOL Setting | 
 | 317 |     [Documentation]  Verify SOL Setting via IPMI. | 
 | 318 |     [Arguments]  ${setting_name}  ${min_value}  ${max_value} | 
 | 319 |     # Description of Arguments: | 
 | 320 |     # setting_name    Setting to verify (e.g. "retry-count"). | 
 | 321 |     # min_value       min valid value for given setting. | 
 | 322 |     # max_value       max valid value for given setting. | 
 | 323 |  | 
 | 324 |     ${value}= | 
 | 325 |     ...  Evaluate  random.randint(${min_value}, ${max_value})  modules=random | 
 | 326 |  | 
 | 327 |     # Character accumulate level setting is set in multiples of 5. | 
 | 328 |     # Retry interval setting is set in multiples of 10. | 
 | 329 |     # Reference IPMI specification v2.0 | 
 | 330 |  | 
| Sridevi Ramesh | 8bd280d | 2025-09-21 07:03:43 -0500 | [diff] [blame] | 331 |     ${expected_value}=  Set Variable If | 
| Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 332 |     ...  '${setting_name}' == 'character-accumulate-level'  Evaluate  ${value}*5 | 
 | 333 |     ...  ELSE IF  '${setting_name}' == 'retry-interval'  Evaluate  ${value}*10 | 
 | 334 |     ...  ELSE  Set Variable  ${value} | 
 | 335 |  | 
 | 336 |     Set SOL Setting  ${setting_name}  '${value}' | 
 | 337 |  | 
 | 338 |     # Replace "-" with space " " in setting name. | 
 | 339 |     # E.g. "retry-count" to "retry count" | 
 | 340 |     ${setting_name}=  Evaluate  $setting_name.replace('-',' ') | 
 | 341 |  | 
 | 342 |     ${sol_info_dict}=  Get SOL Info | 
 | 343 |  | 
 | 344 |     # Get exact SOL setting name from sol info output. | 
 | 345 |     ${list}=  Get Matches  ${sol_info_dict}  ${setting_name}* | 
 | 346 |     ...  case_insensitive=${True} | 
 | 347 |     ${setting_name_from_dict}=  Get From List  ${list}  0 | 
 | 348 |  | 
 | 349 |     # Get SOL setting value from above setting name. | 
 | 350 |     ${setting_value}=  Get From Dictionary | 
 | 351 |     ...  ${sol_info_dict}  ${setting_name_from_dict} | 
 | 352 |  | 
 | 353 |     Should Be Equal  '${setting_value}'  '${expected_value}' | 
 | 354 |  | 
| George Keishing | 2620672 | 2021-11-17 01:29:53 -0600 | [diff] [blame] | 355 |     IPMI Power Off  stack_mode=skip | 
| George Keishing | e053d34 | 2019-10-25 07:16:20 -0500 | [diff] [blame] | 356 |  | 
| Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 357 |     Initiate Host Boot Via External IPMI  wait=${0} | 
 | 358 |  | 
 | 359 |     Activate SOL Via IPMI | 
| ganesanb | cbfcd72 | 2022-11-25 05:37:49 +0000 | [diff] [blame] | 360 |     # Content takes maximum of 10 minutes to display in SOL console | 
 | 361 |     # SOL_BIOS_OUTPUT - BIOS SOL console output | 
 | 362 |     ${status}=  Run Keyword And Return Status  Wait Until Keyword Succeeds  10 mins  15 secs | 
 | 363 |     ...  Check IPMI SOL Output Content  ${SOL_BIOS_OUTPUT} | 
| George Keishing | 0ea976a | 2017-12-08 01:09:40 -0600 | [diff] [blame] | 364 |  | 
| George Keishing | 3a15f82 | 2025-06-17 22:17:48 +0530 | [diff] [blame] | 365 |     IF  '${status}' == 'False' | 
 | 366 |         IPMI Power Off | 
 | 367 |         FAIL  msg=BIOS not loaded. | 
 | 368 |     END | 
| ganesanb | cbfcd72 | 2022-11-25 05:37:49 +0000 | [diff] [blame] | 369 |  | 
 | 370 |     # SOL_LOGIN_OUTPUT - SOL output login prompt | 
 | 371 |     # Once host reboot completes, SOL console may take maximum of 15 minutes to get the login prompt. | 
 | 372 |     ${status}=  Run Keyword And Return Status  Wait Until Keyword Succeeds  15 mins  15 secs | 
 | 373 |     ...  Check IPMI SOL Output Content  ${SOL_LOGIN_OUTPUT} | 
 | 374 |  | 
| George Keishing | 3a15f82 | 2025-06-17 22:17:48 +0530 | [diff] [blame] | 375 |     IF  '${status}' == 'False'  IPMI Power Off | 
| Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 376 |  | 
| George Keishing | e053d34 | 2019-10-25 07:16:20 -0500 | [diff] [blame] | 377 |  | 
| Rahul Maheshwari | 9e0b4d6 | 2017-06-21 06:42:46 -0500 | [diff] [blame] | 378 | Get SOL Setting | 
 | 379 |     [Documentation]  Returns status for given SOL setting. | 
 | 380 |     [Arguments]  ${setting} | 
 | 381 |     # Description of argument(s): | 
 | 382 |     # setting  SOL setting which needs to be read(e.g. "Retry Count"). | 
 | 383 |  | 
 | 384 |     ${sol_info_dict}=  Get SOL Info | 
 | 385 |     ${setting_status}=  Get From Dictionary  ${sol_info_dict}  ${setting} | 
 | 386 |  | 
| George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 387 |     RETURN  ${setting_status} | 
| Rahul Maheshwari | 9e0b4d6 | 2017-06-21 06:42:46 -0500 | [diff] [blame] | 388 |  | 
| Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 389 |  | 
 | 390 | Restore Default SOL Configuration | 
 | 391 |     [Documentation]  Restore default SOL configuration. | 
 | 392 |  | 
| Rahul Maheshwari | d71cd95 | 2017-06-20 21:30:51 -0500 | [diff] [blame] | 393 |     Set SOL Setting  enabled  true | 
| Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 394 |     Set SOL Setting  retry-count  7 | 
 | 395 |     Set SOL Setting  retry-interval  10 | 
 | 396 |     Set SOL Setting  character-accumulate-level  20 | 
 | 397 |     Set SOL Setting  character-send-threshold  1 | 
| Rahul Maheshwari | 6fe52b9 | 2017-06-16 03:35:26 -0500 | [diff] [blame] | 398 |     Set SOL Setting  privilege-level  user | 
| Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 399 |  | 
| Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 400 |  | 
| George Keishing | 0ea976a | 2017-12-08 01:09:40 -0600 | [diff] [blame] | 401 | Test Teardown Execution | 
| Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 402 |     [Documentation]  Do the post test teardown. | 
 | 403 |  | 
| George Keishing | e053d34 | 2019-10-25 07:16:20 -0500 | [diff] [blame] | 404 |     Wait Until Keyword Succeeds  15 sec  5 sec  Restore Default SOL Configuration | 
| Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 405 |     Deactivate SOL Via IPMI | 
| Rahul Maheshwari | 2a17511 | 2017-08-22 05:06:49 -0500 | [diff] [blame] | 406 |     ${sol_log}=  Stop SOL Console Logging | 
 | 407 |     Log   ${sol_log} | 
| Rahul Maheshwari | d629b5c | 2017-05-23 08:06:28 -0500 | [diff] [blame] | 408 |     FFDC On Test Case Fail |