Rahul Maheshwari | fdd5ff6 | 2017-08-01 04:15:03 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This suite is for testing general IPMI functions. |
| 3 | |
| 4 | Resource ../../lib/ipmi_client.robot |
| 5 | Resource ../../lib/openbmc_ffdc.robot |
George Keishing | 0825a11 | 2018-03-30 10:48:07 -0500 | [diff] [blame] | 6 | Resource ../../lib/boot_utils.robot |
George Keishing | 78ce8dc | 2018-03-30 11:49:06 -0500 | [diff] [blame] | 7 | Resource ../../lib/utils.robot |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 8 | Resource ../../lib/bmc_network_utils.robot |
George Keishing | d627380 | 2018-09-07 07:06:53 -0500 | [diff] [blame] | 9 | Resource ../../lib/logging_utils.robot |
George Keishing | 78ce8dc | 2018-03-30 11:49:06 -0500 | [diff] [blame] | 10 | Library ../../lib/ipmi_utils.py |
George Keishing | 0825a11 | 2018-03-30 10:48:07 -0500 | [diff] [blame] | 11 | Variables ../../data/ipmi_raw_cmd_table.py |
Rahul Maheshwari | df6f05d | 2018-09-04 03:48:37 -0500 | [diff] [blame] | 12 | Library ../../lib/gen_misc.py |
Rahul Maheshwari | fdd5ff6 | 2017-08-01 04:15:03 -0500 | [diff] [blame] | 13 | |
| 14 | Test Teardown FFDC On Test Case Fail |
| 15 | |
| 16 | *** Variables *** |
| 17 | |
Sweta Potthuri | 5c6c72e | 2018-01-23 05:48:35 -0600 | [diff] [blame] | 18 | ${new_mc_id}= HOST |
Rahul Maheshwari | 901dcde | 2018-02-06 03:14:31 -0600 | [diff] [blame] | 19 | ${allowed_temp_diff}= ${1} |
Rahul Maheshwari | 615da15 | 2018-02-13 23:53:36 -0600 | [diff] [blame] | 20 | ${allowed_power_diff}= ${10} |
Sweta Potthuri | 5c6c72e | 2018-01-23 05:48:35 -0600 | [diff] [blame] | 21 | |
Rahul Maheshwari | fdd5ff6 | 2017-08-01 04:15:03 -0500 | [diff] [blame] | 22 | *** Test Cases *** |
| 23 | |
George Keishing | d627380 | 2018-09-07 07:06:53 -0500 | [diff] [blame] | 24 | Verify IPMI SEL Version |
| 25 | [Documentation] Verify IPMI SEL's version info. |
| 26 | [Tags] Verify_IPMI_SEL_Version |
| 27 | |
| 28 | ${version_info}= Get IPMI SEL Setting Version |
| 29 | ${setting_status}= Fetch From Left ${version_info} ( |
| 30 | ${setting_status}= Evaluate $setting_status.replace(' ','') |
| 31 | |
| 32 | Should Be True ${setting_status} >= 1.5 |
| 33 | Should Contain ${version_info} v2 compliant case_insensitive=True |
| 34 | |
| 35 | |
George Keishing | 9acd228 | 2018-09-07 07:21:41 -0500 | [diff] [blame] | 36 | Verify Empty SEL |
| 37 | [Documentation] Verify empty SEL list. |
| 38 | [Tags] Verify_Empty_SEL |
| 39 | |
Rahul Maheshwari | 9ef8507 | 2018-12-06 05:10:44 -0600 | [diff] [blame] | 40 | Run IPMI Standard Command sel clear |
George Keishing | 9acd228 | 2018-09-07 07:21:41 -0500 | [diff] [blame] | 41 | |
| 42 | ${resp}= Run IPMI Standard Command sel list |
| 43 | Should Contain ${resp} SEL has no entries case_insensitive=True |
| 44 | |
| 45 | |
George Keishing | 39967eb | 2018-04-30 11:36:23 -0500 | [diff] [blame] | 46 | Verify Supported Cipher List |
| 47 | [Documentation] Execute all supported cipher levels and verify. |
| 48 | [Tags] Verify_Supported_Cipher_List |
| 49 | |
| 50 | :FOR ${cipher_level} IN @{valid_cipher_list} |
Rahul Maheshwari | 19faedf | 2018-08-29 00:42:09 -0500 | [diff] [blame] | 51 | \ ${status}= Execute IPMI Command With Cipher ${cipher_level} |
George Keishing | f402765 | 2019-01-10 23:58:29 -0600 | [diff] [blame] | 52 | \ Should Be Equal ${status} ${True} |
Rahul Maheshwari | 19faedf | 2018-08-29 00:42:09 -0500 | [diff] [blame] | 53 | |
| 54 | |
| 55 | Verify Unsupported Cipher List |
| 56 | [Documentation] Execute all unsupported cipher levels and verify error. |
| 57 | [Tags] Verify_Unsupported_Cipher_List |
| 58 | |
| 59 | :FOR ${cipher_level} IN @{unsupported_cipher_list} |
| 60 | \ ${status}= Execute IPMI Command With Cipher ${cipher_level} |
George Keishing | f402765 | 2019-01-10 23:58:29 -0600 | [diff] [blame] | 61 | \ Should Be Equal ${status} ${False} |
Rahul Maheshwari | 19faedf | 2018-08-29 00:42:09 -0500 | [diff] [blame] | 62 | |
George Keishing | 39967eb | 2018-04-30 11:36:23 -0500 | [diff] [blame] | 63 | |
Rahul Maheshwari | 2837a81 | 2018-09-03 01:00:33 -0500 | [diff] [blame] | 64 | Verify Supported Cipher List Via Lan Print |
| 65 | [Documentation] Verify supported cipher list via IPMI lan print command. |
| 66 | [Tags] Verify_Supported_Cipher_List_Via_Lan_Print |
| 67 | |
Rahul Maheshwari | 2837a81 | 2018-09-03 01:00:33 -0500 | [diff] [blame] | 68 | ${network_info_dict}= Get Lan Print Dict |
| 69 | # Example 'RMCP+ Cipher Suites' entry: 3,17 |
| 70 | ${cipher_list}= Evaluate |
| 71 | ... map(int, $network_info_dict['RMCP+ Cipher Suites'].split(',')) |
| 72 | Lists Should Be Equal ${cipher_list} ${valid_cipher_list} |
| 73 | |
| 74 | |
Rahul Maheshwari | 98cfd26 | 2018-09-05 05:38:30 -0500 | [diff] [blame] | 75 | Verify Supported Cipher Via Getciphers |
| 76 | [Documentation] Verify supported chiper list via IPMI getciphers command. |
| 77 | [Tags] Verify_Supported_Cipher_Via_Getciphers |
| 78 | |
| 79 | ${output}= Run IPMI Standard Command channel getciphers ipmi |
| 80 | # Example of getciphers command output: |
| 81 | # ID IANA Auth Alg Integrity Alg Confidentiality Alg |
| 82 | # 3 N/A hmac_sha1 hmac_sha1_96 aes_cbc_128 |
| 83 | # 17 N/A hmac_sha256 sha256_128 aes_cbc_128 |
| 84 | |
| 85 | ${report}= Outbuf To Report ${output} |
| 86 | # Make list from the 'id' column in the report. |
| 87 | ${cipher_list}= Evaluate [int(x['id']) for x in $report] |
| 88 | Lists Should Be Equal ${cipher_list} ${valid_cipher_list} |
| 89 | |
| 90 | |
Rahul Maheshwari | df6f05d | 2018-09-04 03:48:37 -0500 | [diff] [blame] | 91 | Verify Disabling And Enabling IPMI Via Host |
| 92 | [Documentation] Verify disabling and enabling IPMI via host. |
| 93 | [Tags] Verify_Disabling_And_Enabling_IPMI_Via_Host |
Rahul Maheshwari | c215715 | 2018-10-03 07:31:06 -0500 | [diff] [blame] | 94 | [Teardown] Run Keywords FFDC On Test Case Fail |
| 95 | ... AND Run Inband IPMI Standard Command lan set 1 access on |
Rahul Maheshwari | df6f05d | 2018-09-04 03:48:37 -0500 | [diff] [blame] | 96 | |
| 97 | # Disable IPMI and verify |
| 98 | Run Inband IPMI Standard Command lan set 1 access off |
| 99 | Run Keyword and Expect Error *Unable to establish IPMI* |
| 100 | ... Run External IPMI Standard Command lan print |
| 101 | |
| 102 | # Enable IPMI and verify |
| 103 | Run Inband IPMI Standard Command lan set 1 access on |
| 104 | ${lan_print_output}= Run External IPMI Standard Command lan print |
| 105 | |
| 106 | ${openbmc_host_name} ${openbmc_ip} ${openbmc_short_name}= |
| 107 | ... Get Host Name IP host=${OPENBMC_HOST} short_name=1 |
| 108 | Should Contain ${lan_print_output} ${openbmc_ip} |
| 109 | |
| 110 | |
Rahul Maheshwari | 7e7d088 | 2018-10-08 06:21:34 -0500 | [diff] [blame] | 111 | Verify Disabling IPMI Via OOB IPMI |
| 112 | [Documentation] Verify disabling IPMI via out of band IPMI. |
| 113 | [Tags] Verify_Disabling_IPMI_Via_OOB_IPMI |
| 114 | [Teardown] Run Inband IPMI Standard Command lan set 1 access on |
| 115 | |
| 116 | # Disable IPMI via OOB IPMI and verify |
| 117 | Run Keyword and Expect Error *IPMI response is NULL* |
| 118 | ... Run IPMI Standard Command lan set 1 access off |
| 119 | Run Keyword and Expect Error *Unable to establish IPMI* |
| 120 | ... Run External IPMI Standard Command lan print |
| 121 | |
| 122 | # Enable IPMI via Host and verify |
| 123 | Run Inband IPMI Standard Command lan set 1 access on |
| 124 | ${lan_print_output}= Run External IPMI Standard Command lan print |
| 125 | |
| 126 | ${openbmc_host_name} ${openbmc_ip} ${openbmc_short_name}= |
| 127 | ... Get Host Name IP host=${OPENBMC_HOST} short_name=1 |
| 128 | Should Contain ${lan_print_output} ${openbmc_ip} |
| 129 | |
| 130 | |
Rahul Maheshwari | c215715 | 2018-10-03 07:31:06 -0500 | [diff] [blame] | 131 | Verify IPMI Disable Persistency After BMC Reboot |
| 132 | [Documentation] Verify IPMI disable persistency after BMC reboot. |
| 133 | [Tags] Verify_IPMI_Disable_Persistency_After_BMC_Reboot |
| 134 | [Teardown] Run Keywords FFDC On Test Case Fail |
| 135 | ... AND Run Inband IPMI Standard Command lan set 1 access on |
| 136 | |
| 137 | # Disable IPMI and reboot BMC. |
| 138 | Run Inband IPMI Standard Command lan set 1 access off |
| 139 | OBMC Reboot (run) |
| 140 | |
| 141 | # Verify that IPMI remains disabled after reboot. |
| 142 | Run Keyword and Expect Error *Unable to establish IPMI* |
| 143 | ... Run External IPMI Standard Command lan print |
| 144 | |
| 145 | |
Rahul Maheshwari | fdd5ff6 | 2017-08-01 04:15:03 -0500 | [diff] [blame] | 146 | Set Asset Tag With Valid String Length |
| 147 | [Documentation] Set asset tag with valid string length and verify. |
| 148 | [Tags] Set_Asset_Tag_With_Valid_String_Length |
| 149 | |
| 150 | # Allowed MAX characters length for asset tag name is 63. |
| 151 | ${random_string}= Generate Random String 63 |
| 152 | Run Keyword Run IPMI Standard Command dcmi set_asset_tag ${random_string} |
| 153 | |
| 154 | ${asset_tag}= Run Keyword Run IPMI Standard Command dcmi asset_tag |
| 155 | Should Contain ${asset_tag} ${random_string} |
| 156 | |
| 157 | |
| 158 | Set Asset Tag With Invalid String Length |
| 159 | [Documentation] Verify error while setting invalid asset tag via IPMI. |
| 160 | [Tags] Set_Asset_Tag_With_Invalid_String_Length |
| 161 | |
| 162 | # Any string more than 63 character is invalid for asset tag. |
| 163 | ${random_string}= Generate Random String 64 |
| 164 | |
| 165 | ${resp}= Run Keyword And Expect Error * Run IPMI Standard Command |
| 166 | ... dcmi set_asset_tag ${random_string} |
| 167 | Should Contain ${resp} Parameter out of range ignore_case=True |
| 168 | |
| 169 | |
| 170 | Set Asset Tag With Valid String Length Via REST |
| 171 | [Documentation] Set valid asset tag via REST and verify. |
| 172 | [Tags] Set_Asset_Tag_With_Valid_String_Length_Via_REST |
| 173 | |
| 174 | ${random_string}= Generate Random String 63 |
| 175 | ${args}= Create Dictionary data=${random_string} |
| 176 | Write Attribute /xyz/openbmc_project/inventory/system AssetTag |
| 177 | ... data=${args} |
| 178 | |
| 179 | ${asset_tag}= Read Attribute /xyz/openbmc_project/inventory/system |
| 180 | ... AssetTag |
| 181 | Should Be Equal As Strings ${asset_tag} ${random_string} |
| 182 | |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 183 | |
Sweta Potthuri | 5c6c72e | 2018-01-23 05:48:35 -0600 | [diff] [blame] | 184 | Verify Get And Set Management Controller ID String |
| 185 | [Documentation] Verify get and set management controller ID string. |
| 186 | [Tags] Verify_Get_And_Set_Management_Controller_ID_String |
| 187 | |
| 188 | # Get the value of the managemment controller ID string. |
| 189 | # Example: |
| 190 | # Get Management Controller Identifier String: witherspoon |
| 191 | |
| 192 | ${cmd_output}= Run IPMI Standard Command dcmi get_mc_id_string |
| 193 | |
| 194 | # Extract management controller ID from cmd_output. |
| 195 | ${initial_mc_id}= Fetch From Right ${cmd_output} :${SPACE} |
| 196 | |
| 197 | # Set the management controller ID string to other value. |
| 198 | # Example: |
| 199 | # Set Management Controller Identifier String Command: HOST |
| 200 | |
| 201 | Set Management Controller ID String ${new_mc_id} |
| 202 | |
| 203 | # Get the management controller ID and verify. |
| 204 | Get Management Controller ID String And Verify ${new_mc_id} |
| 205 | |
| 206 | # Set the value back to the initial value and verify. |
| 207 | Set Management Controller ID String ${initial_mc_id} |
| 208 | |
| 209 | # Get the management controller ID and verify. |
| 210 | Get Management Controller ID String And Verify ${initial_mc_id} |
Rahul Maheshwari | fdd5ff6 | 2017-08-01 04:15:03 -0500 | [diff] [blame] | 211 | |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 212 | |
Rahul Maheshwari | 0eb33f0 | 2018-04-10 02:31:54 -0500 | [diff] [blame] | 213 | Test Management Controller ID String Status via IPMI |
| 214 | [Documentation] Test management controller ID string status via IPMI. |
| 215 | [Tags] Test_Management_Controller_ID_String_Status_via_IPMI |
| 216 | |
| 217 | # Disable management controller ID string status via IPMI and verify. |
| 218 | Run IPMI Standard Command dcmi set_conf_param dhcp_config 0x00 |
| 219 | Verify Management Controller ID String Status disable |
| 220 | |
| 221 | # Enable management controller ID string status via IPMI and verify. |
| 222 | Run IPMI Standard Command dcmi set_conf_param dhcp_config 0x01 |
| 223 | Verify Management Controller ID String Status enable |
| 224 | |
| 225 | |
| 226 | Test Management Controller ID String Status via Raw IPMI |
| 227 | [Documentation] Test management controller ID string status via IPMI. |
| 228 | [Tags] Test_Management_Controller_ID_String_Status_via_Raw_IPMI |
| 229 | |
| 230 | # Disable management controller ID string status via raw IPMI and verify. |
| 231 | Run IPMI Standard Command raw ${IPMI_RAW_CMD['conf_param']['Disabled'][0]} |
| 232 | Verify Management Controller ID String Status disable |
| 233 | |
| 234 | # Enable management controller ID string status via raw IPMI and verify. |
| 235 | Run IPMI Standard Command raw ${IPMI_RAW_CMD['conf_param']['Enabled'][0]} |
| 236 | Verify Management Controller ID String Status enable |
| 237 | |
| 238 | |
Sweta Potthuri | 0cc6050 | 2018-01-24 00:36:17 -0600 | [diff] [blame] | 239 | Verify Chassis Identify via IPMI |
| 240 | [Documentation] Verify "chassis identify" using IPMI command. |
| 241 | [Tags] Verify_Chassis_Identify_via_IPMI |
| 242 | |
| 243 | # Set to default "chassis identify" and verify that LED blinks for 15s. |
| 244 | Run IPMI Standard Command chassis identify |
| 245 | Verify Identify LED State Blink |
| 246 | |
| 247 | Sleep 15s |
| 248 | Verify Identify LED State Off |
| 249 | |
| 250 | # Set "chassis identify" to 10s and verify that the LED blinks for 10s. |
| 251 | Run IPMI Standard Command chassis identify 10 |
| 252 | Verify Identify LED State Blink |
| 253 | |
| 254 | Sleep 10s |
| 255 | Verify Identify LED State Off |
| 256 | |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 257 | |
Sweta Potthuri | 0cc6050 | 2018-01-24 00:36:17 -0600 | [diff] [blame] | 258 | Verify Chassis Identify Off And Force Identify On via IPMI |
| 259 | [Documentation] Verify "chassis identify" off |
| 260 | ... and "force identify on" via IPMI. |
| 261 | [Tags] Verify_Chassis_Identify_Off_And_Force_Identify_On_via_IPMI |
| 262 | |
| 263 | # Set the LED to "Force Identify On". |
| 264 | Run IPMI Standard Command chassis identify force |
| 265 | Verify Identify LED State Blink |
| 266 | |
| 267 | # Set "chassis identify" to 0 and verify that the LED turns off. |
| 268 | Run IPMI Standard Command chassis identify 0 |
| 269 | Verify Identify LED State Off |
| 270 | |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 271 | |
Sweta Potthuri | 7d3af3c | 2018-01-29 03:07:07 -0600 | [diff] [blame] | 272 | Test Watchdog Reset Via IPMI And Verify Using REST |
| 273 | [Documentation] Test watchdog reset via IPMI and verify using REST. |
| 274 | [Tags] Test_Watchdog_Reset_Via_IPMI_And_Verify_Using_REST |
| 275 | |
| 276 | Initiate Host Boot |
| 277 | |
| 278 | Set Watchdog Enabled Using REST ${1} |
| 279 | |
| 280 | Watchdog Object Should Exist |
| 281 | |
| 282 | # Resetting the watchdog via IPMI. |
| 283 | Run IPMI Standard Command mc watchdog reset |
| 284 | |
| 285 | # Verify the watchdog is reset using REST after an interval of 1000ms. |
| 286 | Sleep 1000ms |
| 287 | ${watchdog_time_left}= |
| 288 | ... Read Attribute ${HOST_WATCHDOG_URI} TimeRemaining |
| 289 | Should Be True |
| 290 | ... ${watchdog_time_left}<${1200000} and ${watchdog_time_left}>${2000} |
| 291 | ... msg=Watchdog timer didn't reset. |
| 292 | |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 293 | |
Sweta Potthuri | 7d3af3c | 2018-01-29 03:07:07 -0600 | [diff] [blame] | 294 | Test Watchdog Off Via IPMI And Verify Using REST |
| 295 | [Documentation] Test watchdog off via IPMI and verify using REST. |
| 296 | [Tags] Test_Watchdog_Off_Via_IPMI_And_Verify_Using_REST |
| 297 | |
| 298 | Initiate Host Boot |
| 299 | |
| 300 | Set Watchdog Enabled Using REST ${1} |
| 301 | |
| 302 | Watchdog Object Should Exist |
| 303 | |
| 304 | # Turn off the watchdog via IPMI. |
| 305 | Run IPMI Standard Command mc watchdog off |
| 306 | |
| 307 | # Verify the watchdog is off using REST |
| 308 | ${watchdog_state}= Read Attribute ${HOST_WATCHDOG_URI} Enabled |
| 309 | Should Be Equal ${watchdog_state} ${0} |
| 310 | ... msg=msg=Verification failed for watchdog off check. |
Rahul Maheshwari | 901dcde | 2018-02-06 03:14:31 -0600 | [diff] [blame] | 311 | |
| 312 | |
| 313 | Test Ambient Temperature Via IPMI |
| 314 | [Documentation] Test ambient temperature via IPMI and verify using REST. |
| 315 | [Tags] Test_Ambient_Temperature_Via_IPMI |
| 316 | |
| 317 | # Entity ID Entity Instance Temp. Readings |
| 318 | # Inlet air temperature(40h) 1 +19 C |
| 319 | # CPU temperature sensors(41h) 5 +51 C |
| 320 | # CPU temperature sensors(41h) 6 +50 C |
| 321 | # CPU temperature sensors(41h) 7 +50 C |
| 322 | # CPU temperature sensors(41h) 8 +50 C |
| 323 | # CPU temperature sensors(41h) 9 +50 C |
| 324 | # CPU temperature sensors(41h) 10 +48 C |
| 325 | # CPU temperature sensors(41h) 11 +49 C |
| 326 | # CPU temperature sensors(41h) 12 +47 C |
| 327 | # CPU temperature sensors(41h) 8 +50 C |
| 328 | # CPU temperature sensors(41h) 16 +51 C |
| 329 | # CPU temperature sensors(41h) 24 +50 C |
| 330 | # CPU temperature sensors(41h) 32 +43 C |
| 331 | # CPU temperature sensors(41h) 40 +43 C |
| 332 | # Baseboard temperature sensors(42h) 1 +35 C |
| 333 | |
| 334 | ${temp_reading}= Run IPMI Standard Command dcmi get_temp_reading -N 10 |
George Keishing | 77f1ad2 | 2018-07-23 12:39:28 -0500 | [diff] [blame] | 335 | Should Contain ${temp_reading} Inlet air temperature |
| 336 | ... msg="Unable to get inlet temperature via DCMI". |
Rahul Maheshwari | 901dcde | 2018-02-06 03:14:31 -0600 | [diff] [blame] | 337 | ${ambient_temp_line}= |
| 338 | ... Get Lines Containing String ${temp_reading} |
| 339 | ... Inlet air temperature case-insensitive |
| 340 | |
| 341 | ${ambient_temp_ipmi}= Fetch From Right ${ambient_temp_line} + |
| 342 | ${ambient_temp_ipmi}= Remove String ${ambient_temp_ipmi} ${SPACE}C |
| 343 | |
| 344 | ${ambient_temp_rest}= Read Attribute |
| 345 | ... ${SENSORS_URI}temperature/ambient Value |
| 346 | |
| 347 | # Example of ambient temperature via REST |
| 348 | # "CriticalAlarmHigh": 0, |
| 349 | # "CriticalAlarmLow": 0, |
| 350 | # "CriticalHigh": 35000, |
| 351 | # "CriticalLow": 0, |
| 352 | # "Scale": -3, |
| 353 | # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", |
| 354 | # "Value": 21775, |
| 355 | # "WarningAlarmHigh": 0, |
| 356 | # "WarningAlarmLow": 0, |
| 357 | # "WarningHigh": 25000, |
| 358 | # "WarningLow": 0 |
| 359 | |
| 360 | # Get temperature value based on scale i.e. Value * (10 power Scale Value) |
| 361 | # e.g. from above case 21775 * (10 power -3) = 21775/1000 |
| 362 | |
| 363 | ${ambient_temp_rest}= Evaluate ${ambient_temp_rest}/1000 |
| 364 | ${ipmi_rest_temp_diff}= |
| 365 | ... Evaluate abs(${ambient_temp_rest} - ${ambient_temp_ipmi}) |
| 366 | |
| 367 | Should Be True ${ipmi_rest_temp_diff} <= ${allowed_temp_diff} |
| 368 | ... msg=Ambient temperature above allowed threshold ${allowed_temp_diff}. |
| 369 | |
| 370 | |
Rahul Maheshwari | 4355663 | 2018-02-05 23:42:52 -0600 | [diff] [blame] | 371 | Verify Get DCMI Capabilities |
| 372 | [Documentation] Verify get DCMI capabilities command output. |
| 373 | [Tags] Verify_Get_DCMI_Capabilities |
| 374 | |
| 375 | ${cmd_output}= Run IPMI Standard Command dcmi discover |
| 376 | |
| 377 | @{supported_capabilities}= Create List |
| 378 | # Supported DCMI capabilities: |
| 379 | ... Mandatory platform capabilties |
| 380 | ... Optional platform capabilties |
| 381 | ... Power management available |
| 382 | ... Managebility access capabilties |
| 383 | ... In-band KCS channel available |
| 384 | # Mandatory platform attributes: |
| 385 | ... 200 SEL entries |
| 386 | ... SEL automatic rollover is enabled |
| 387 | # Optional Platform Attributes: |
| 388 | ... Slave address of device: 0h (8bits)(Satellite/External controller) |
| 389 | ... Channel number is 0h (Primary BMC) |
| 390 | ... Device revision is 0 |
| 391 | # Manageability Access Attributes: |
| 392 | ... Primary LAN channel number: 1 is available |
| 393 | ... Secondary LAN channel is not available for OOB |
| 394 | ... No serial channel is available |
| 395 | |
| 396 | :FOR ${capability} IN @{supported_capabilities} |
| 397 | \ Should Contain ${cmd_output} ${capability} ignore_case=True |
| 398 | ... msg=Supported DCMI capabilities not present. |
| 399 | |
| 400 | |
Sweta Potthuri | 78dd1e1 | 2018-02-21 00:03:33 -0600 | [diff] [blame] | 401 | Test Power Reading Via IPMI With Host Off |
| 402 | [Documentation] Test power reading via IPMI with host off state and |
| 403 | ... verify using REST. |
| 404 | [Tags] Test_Power_Reading_Via_IPMI_With_Host_Off |
Rahul Maheshwari | 615da15 | 2018-02-13 23:53:36 -0600 | [diff] [blame] | 405 | |
Sweta Potthuri | 78dd1e1 | 2018-02-21 00:03:33 -0600 | [diff] [blame] | 406 | REST Power Off stack_mode=skip quiet=1 |
Rahul Maheshwari | 615da15 | 2018-02-13 23:53:36 -0600 | [diff] [blame] | 407 | |
George Keishing | 04bf06c | 2018-10-05 08:28:50 -0500 | [diff] [blame] | 408 | Wait Until Keyword Succeeds 1 min 30 sec Verify Power Reading |
George Keishing | e78f1fd | 2018-09-04 13:34:59 -0500 | [diff] [blame] | 409 | |
| 410 | |
| 411 | Test Power Reading Via IPMI With Host Booted |
| 412 | [Documentation] Test power reading via IPMI with host booted state and |
| 413 | ... verify using REST. |
| 414 | [Tags] Test_Power_Reading_Via_IPMI_With_Host_Booted |
| 415 | |
| 416 | REST Power On stack_mode=skip quiet=1 |
| 417 | |
| 418 | # For a good power reading take a 3 samples for 15 seconds interval and |
| 419 | # average it out. |
| 420 | |
George Keishing | 04bf06c | 2018-10-05 08:28:50 -0500 | [diff] [blame] | 421 | Wait Until Keyword Succeeds 2 min 30 sec Verify Power Reading |
Rahul Maheshwari | 615da15 | 2018-02-13 23:53:36 -0600 | [diff] [blame] | 422 | |
| 423 | |
Rahul Maheshwari | abe13af | 2018-02-15 22:42:08 -0600 | [diff] [blame] | 424 | Test Power Reading Via IPMI Raw Command |
| 425 | [Documentation] Test power reading via IPMI raw command and verify |
| 426 | ... using REST. |
| 427 | [Tags] Test_Power_Reading_Via_IPMI_Raw_Command |
| 428 | |
| 429 | # Response data structure of power reading command output via IPMI. |
| 430 | # 1 Completion Code. Refer to section 8, DCMI Completion Codes. |
| 431 | # 2 Group Extension Identification = DCh |
| 432 | # 3:4 Current Power in watts |
| 433 | |
George Keishing | e78f1fd | 2018-09-04 13:34:59 -0500 | [diff] [blame] | 434 | REST Power On stack_mode=skip quiet=1 |
Rahul Maheshwari | abe13af | 2018-02-15 22:42:08 -0600 | [diff] [blame] | 435 | |
George Keishing | 04bf06c | 2018-10-05 08:28:50 -0500 | [diff] [blame] | 436 | Wait Until Keyword Succeeds 2 min 30 sec Verify Power Reading Via Raw Command |
Rahul Maheshwari | abe13af | 2018-02-15 22:42:08 -0600 | [diff] [blame] | 437 | |
| 438 | |
Rahul Maheshwari | 91a18ef | 2018-02-15 04:54:59 -0600 | [diff] [blame] | 439 | Test Baseboard Temperature Via IPMI |
| 440 | [Documentation] Test baseboard temperature via IPMI and verify using REST. |
| 441 | [Tags] Test_Baseboard_Temperature_Via_IPMI |
| 442 | |
| 443 | # Example of IPMI dcmi get_temp_reading output: |
| 444 | # Entity ID Entity Instance Temp. Readings |
| 445 | # Inlet air temperature(40h) 1 +19 C |
| 446 | # CPU temperature sensors(41h) 5 +51 C |
| 447 | # CPU temperature sensors(41h) 6 +50 C |
| 448 | # CPU temperature sensors(41h) 7 +50 C |
| 449 | # CPU temperature sensors(41h) 8 +50 C |
| 450 | # CPU temperature sensors(41h) 9 +50 C |
| 451 | # CPU temperature sensors(41h) 10 +48 C |
| 452 | # CPU temperature sensors(41h) 11 +49 C |
| 453 | # CPU temperature sensors(41h) 12 +47 C |
| 454 | # CPU temperature sensors(41h) 8 +50 C |
| 455 | # CPU temperature sensors(41h) 16 +51 C |
| 456 | # CPU temperature sensors(41h) 24 +50 C |
| 457 | # CPU temperature sensors(41h) 32 +43 C |
| 458 | # CPU temperature sensors(41h) 40 +43 C |
| 459 | # Baseboard temperature sensors(42h) 1 +35 C |
| 460 | |
| 461 | ${temp_reading}= Run IPMI Standard Command dcmi get_temp_reading -N 10 |
George Keishing | 77f1ad2 | 2018-07-23 12:39:28 -0500 | [diff] [blame] | 462 | Should Contain ${temp_reading} Baseboard temperature sensors |
| 463 | ... msg="Unable to get baseboard temperature via DCMI". |
Rahul Maheshwari | 91a18ef | 2018-02-15 04:54:59 -0600 | [diff] [blame] | 464 | ${baseboard_temp_line}= |
| 465 | ... Get Lines Containing String ${temp_reading} |
| 466 | ... Baseboard temperature case-insensitive=True |
| 467 | |
| 468 | ${baseboard_temp_ipmi}= Fetch From Right ${baseboard_temp_line} + |
| 469 | ${baseboard_temp_ipmi}= Remove String ${baseboard_temp_ipmi} ${SPACE}C |
| 470 | |
| 471 | ${baseboard_temp_rest}= Read Attribute |
| 472 | ... /xyz/openbmc_project/sensors/temperature/pcie Value |
| 473 | ${baseboard_temp_rest}= Evaluate ${baseboard_temp_rest}/1000 |
| 474 | |
| 475 | Should Be True |
| 476 | ... ${baseboard_temp_rest} - ${baseboard_temp_ipmi} <= ${allowed_temp_diff} |
| 477 | ... msg=Baseboard temperature above allowed threshold ${allowed_temp_diff}. |
| 478 | |
| 479 | |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 480 | Retrieve Default Gateway Via IPMI And Verify Using REST |
| 481 | [Documentation] Retrieve default gateway from LAN print using IPMI. |
| 482 | [Tags] Retrieve_Default_Gateway_Via_IPMI_And_Verify_Using_REST |
| 483 | |
| 484 | # Fetch "Default Gateway" from IPMI LAN print. |
| 485 | ${default_gateway_ipmi}= Fetch Details From LAN Print Default Gateway IP |
| 486 | |
| 487 | # Verify "Default Gateway" using REST. |
Steven Sombar | a8800da | 2018-12-18 16:19:05 -0600 | [diff] [blame] | 488 | Read Attribute ${NETWORK_MANAGER}config DefaultGateway |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 489 | ... expected_value=${default_gateway_ipmi} |
| 490 | |
| 491 | |
| 492 | Retrieve MAC Address Via IPMI And Verify Using REST |
| 493 | [Documentation] Retrieve MAC Address from LAN print using IPMI. |
| 494 | [Tags] Retrieve_MAC_Address_Via_IPMI_And_Verify_Using_REST |
| 495 | |
| 496 | # Fetch "MAC Address" from IPMI LAN print. |
| 497 | ${mac_address_ipmi}= Fetch Details From LAN Print MAC Address |
| 498 | |
| 499 | # Verify "MAC Address" using REST. |
| 500 | ${mac_address_rest}= Get BMC MAC Address |
| 501 | Should Be Equal ${mac_address_ipmi} ${mac_address_rest} |
| 502 | ... msg=Verification of MAC address from lan print using IPMI failed. |
| 503 | |
| 504 | |
| 505 | Retrieve Network Mode Via IPMI And Verify Using REST |
| 506 | [Documentation] Retrieve network mode from LAN print using IPMI. |
| 507 | [Tags] Retrieve_Network_Mode_Via_IPMI_And_Verify_Using_REST |
| 508 | |
| 509 | # Fetch "Mode" from IPMI LAN print. |
| 510 | ${network_mode_ipmi}= Fetch Details From LAN Print Source |
| 511 | |
| 512 | # Verify "Mode" using REST. |
| 513 | ${network_mode_rest}= Read Attribute |
Steven Sombar | a8800da | 2018-12-18 16:19:05 -0600 | [diff] [blame] | 514 | ... ${NETWORK_MANAGER}eth0 DHCPEnabled |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 515 | Run Keyword If '${network_mode_ipmi}' == 'Static Address' |
| 516 | ... Should Be Equal ${network_mode_rest} ${0} |
| 517 | ... msg=Verification of network setting failed. |
| 518 | ... ELSE IF '${network_mode_ipmi}' == 'DHCP' |
| 519 | ... Should Be Equal ${network_mode_rest} ${1} |
| 520 | ... msg=Verification of network setting failed. |
| 521 | |
| 522 | |
| 523 | Retrieve IP Address Via IPMI And Verify With BMC Details |
| 524 | [Documentation] Retrieve IP address from LAN print using IPMI. |
| 525 | [Tags] Retrieve_IP_Address_Via_IPMI_And_Verify_With_BMC_Details |
| 526 | |
| 527 | # Fetch "IP Address" from IPMI LAN print. |
| 528 | ${ip_addr_ipmi}= Fetch Details From LAN Print IP Address |
| 529 | |
| 530 | # Verify the IP address retrieved via IPMI with BMC IPs. |
| 531 | ${ip_address_rest}= Get BMC IP Info |
| 532 | Validate IP On BMC ${ip_addr_ipmi} ${ip_address_rest} |
| 533 | |
| 534 | |
Rahul Maheshwari | fe8639b | 2018-02-05 22:42:24 -0600 | [diff] [blame] | 535 | Verify Get Device ID |
| 536 | [Documentation] Verify get device ID command output. |
| 537 | [Tags] Verify_Get_Device_ID |
| 538 | |
| 539 | # Example of get device ID command output: |
| 540 | # Device ID : 0 |
| 541 | # Device Revision : 0 |
| 542 | # Firmware Revision : 2.01 |
| 543 | # IPMI Version : 2.0 |
| 544 | # Manufacturer ID : 42817 |
| 545 | # Manufacturer Name : Unknown (0xA741) |
| 546 | # Product ID : 16975 (0x424f) |
| 547 | # Product Name : Unknown (0x424F) |
| 548 | # Device Available : yes |
| 549 | # Provides Device SDRs : yes |
| 550 | # Additional Device Support : |
| 551 | # Sensor Device |
| 552 | # SEL Device |
| 553 | # FRU Inventory Device |
| 554 | # Chassis Device |
| 555 | # Aux Firmware Rev Info : |
George Keishing | 3511a3f | 2018-04-19 10:38:30 -0500 | [diff] [blame] | 556 | # 0x04 |
| 557 | # 0x38 |
Rahul Maheshwari | fe8639b | 2018-02-05 22:42:24 -0600 | [diff] [blame] | 558 | # 0x00 |
George Keishing | 3511a3f | 2018-04-19 10:38:30 -0500 | [diff] [blame] | 559 | # 0x03 |
Rahul Maheshwari | fe8639b | 2018-02-05 22:42:24 -0600 | [diff] [blame] | 560 | |
| 561 | ${mc_info}= Get MC Info |
| 562 | |
| 563 | Should Be Equal ${mc_info['device_id']} 0 |
| 564 | Should Be Equal ${mc_info['device_revision']} 0 |
| 565 | |
Rahul Maheshwari | bb9e257 | 2018-04-02 05:24:37 -0500 | [diff] [blame] | 566 | # Get firmware revision from mc info command output i.e. 2.01 |
| 567 | ${ipmi_fw_major_version} ${ipmi_fw_minor_version}= |
| 568 | ... Split String ${mc_info['firmware_revision']} . |
| 569 | # Convert minor firmware version from BCD format to integer. i.e. 01 to 1 |
| 570 | ${ipmi_fw_minor_version}= Convert To Integer ${ipmi_fw_minor_version} |
Rahul Maheshwari | fe8639b | 2018-02-05 22:42:24 -0600 | [diff] [blame] | 571 | |
George Keishing | e0a8128 | 2018-06-08 10:02:30 -0500 | [diff] [blame] | 572 | # Get BMC version from BMC CLI i.e. 2.2 from "v2.2-253-g00050f1" |
George Keishing | 3511a3f | 2018-04-19 10:38:30 -0500 | [diff] [blame] | 573 | ${bmc_version_full}= Get BMC Version |
Rahul Maheshwari | bb9e257 | 2018-04-02 05:24:37 -0500 | [diff] [blame] | 574 | ${bmc_version}= |
George Keishing | 3511a3f | 2018-04-19 10:38:30 -0500 | [diff] [blame] | 575 | ... Remove String Using Regexp ${bmc_version_full} ^[^0-9]+ [^0-9\.].* |
Rahul Maheshwari | bb9e257 | 2018-04-02 05:24:37 -0500 | [diff] [blame] | 576 | |
| 577 | # Get major and minor version from BMC version i.e. 2 and 1 from 2.1 |
George Keishing | c95e998 | 2019-01-14 09:27:45 -0600 | [diff] [blame] | 578 | @{major_minor_version}= Split String ${bmc_version} . |
Rahul Maheshwari | bb9e257 | 2018-04-02 05:24:37 -0500 | [diff] [blame] | 579 | |
George Keishing | c95e998 | 2019-01-14 09:27:45 -0600 | [diff] [blame] | 580 | Should Be Equal As Strings ${ipmi_fw_major_version} ${major_minor_version[0]} |
Rahul Maheshwari | bb9e257 | 2018-04-02 05:24:37 -0500 | [diff] [blame] | 581 | ... msg=Major version mis-match. |
George Keishing | c95e998 | 2019-01-14 09:27:45 -0600 | [diff] [blame] | 582 | Should Be Equal As Strings ${ipmi_fw_minor_version} ${major_minor_version[1]} |
Rahul Maheshwari | bb9e257 | 2018-04-02 05:24:37 -0500 | [diff] [blame] | 583 | ... msg=Minor version mis-match. |
| 584 | |
Rahul Maheshwari | fe8639b | 2018-02-05 22:42:24 -0600 | [diff] [blame] | 585 | Should Be Equal ${mc_info['ipmi_version']} 2.0 |
| 586 | |
Gunnar Mills | 917ba1a | 2018-04-08 16:42:12 -0500 | [diff] [blame] | 587 | # TODO: Verify Manufacturer and Product IDs directly from json file. |
Rahul Maheshwari | fe8639b | 2018-02-05 22:42:24 -0600 | [diff] [blame] | 588 | # Reference : openbmc/openbmc-test-automation#1244 |
| 589 | Should Be Equal ${mc_info['manufacturer_id']} 42817 |
| 590 | Should Be Equal ${mc_info['product_id']} 16975 (0x424f) |
| 591 | |
| 592 | Should Be Equal ${mc_info['device_available']} yes |
| 593 | Should Be Equal ${mc_info['provides_device_sdrs']} yes |
| 594 | Should Contain ${mc_info['additional_device_support']} Sensor Device |
| 595 | Should Contain ${mc_info['additional_device_support']} SEL Device |
| 596 | Should Contain |
| 597 | ... ${mc_info['additional_device_support']} FRU Inventory Device |
| 598 | Should Contain ${mc_info['additional_device_support']} Chassis Device |
George Keishing | b746d3f | 2018-04-19 10:53:10 -0500 | [diff] [blame] | 599 | |
George Keishing | 3511a3f | 2018-04-19 10:38:30 -0500 | [diff] [blame] | 600 | # Auxiliary revision data verification. |
| 601 | ${aux_version}= Get Aux Version ${bmc_version_full} |
| 602 | |
| 603 | # From aux_firmware_rev_info field ['0x04', '0x38', '0x00', '0x03'] |
| 604 | ${bmc_aux_version}= Catenate |
| 605 | ... SEPARATOR= |
| 606 | ... ${mc_info['aux_firmware_rev_info'][0][2:]} |
| 607 | ... ${mc_info['aux_firmware_rev_info'][1][2:]} |
| 608 | ... ${mc_info['aux_firmware_rev_info'][2][2:]} |
| 609 | ... ${mc_info['aux_firmware_rev_info'][3][2:]} |
| 610 | |
| 611 | Should Be Equal As Integers |
| 612 | ... ${bmc_aux_version} ${aux_version} |
| 613 | ... msg=BMC aux version ${bmc_aux_version} does not match expected value of ${aux_version}. |
Rahul Maheshwari | fe8639b | 2018-02-05 22:42:24 -0600 | [diff] [blame] | 614 | |
| 615 | |
Rahul Maheshwari | dc6a32c | 2018-03-15 05:21:55 -0500 | [diff] [blame] | 616 | Verify SDR Info |
| 617 | [Documentation] Verify sdr info command output. |
| 618 | [Tags] Verify_SDR_Info |
| 619 | |
| 620 | # Example of SDR info command output: |
| 621 | # SDR Version : 0x51 |
| 622 | # Record Count : 216 |
| 623 | # Free Space : unspecified |
| 624 | # Most recent Addition : |
| 625 | # Most recent Erase : |
| 626 | # SDR overflow : no |
| 627 | # SDR Repository Update Support : unspecified |
| 628 | # Delete SDR supported : no |
| 629 | # Partial Add SDR supported : no |
| 630 | # Reserve SDR repository supported : no |
| 631 | # SDR Repository Alloc info supported : no |
| 632 | |
| 633 | ${sdr_info}= Get SDR Info |
| 634 | Should Be Equal ${sdr_info['sdr_version']} 0x51 |
| 635 | |
| 636 | # Get sensor count from "sdr elist all" command output. |
| 637 | ${sensor_count}= Get Sensor Count |
| 638 | Should Be Equal As Strings |
| 639 | ... ${sdr_info['record_count']} ${sensor_count} |
| 640 | |
| 641 | Should Be Equal ${sdr_info['free_space']} unspecified |
| 642 | Should Be Equal ${sdr_info['most_recent_addition']} ${EMPTY} |
| 643 | Should Be Equal ${sdr_info['most_recent_erase']} ${EMPTY} |
| 644 | Should Be Equal ${sdr_info['sdr_overflow']} no |
| 645 | Should Be Equal ${sdr_info['sdr_repository_update_support']} unspecified |
| 646 | Should Be Equal ${sdr_info['delete_sdr_supported']} no |
| 647 | Should Be Equal ${sdr_info['partial_add_sdr_supported']} no |
| 648 | Should Be Equal ${sdr_info['reserve_sdr_repository_supported']} no |
| 649 | Should Be Equal ${sdr_info['sdr_repository_alloc_info_supported']} no |
| 650 | |
| 651 | |
George Keishing | 02651f0 | 2018-04-11 02:07:16 -0500 | [diff] [blame] | 652 | Test Valid IPMI Channels Supported |
| 653 | [Documentation] Verify IPMI channels supported on a given system. |
| 654 | [Tags] Test_Valid_IPMI_Channels_Supported |
| 655 | |
| 656 | ${channel_count}= Get Physical Network Interface Count |
| 657 | |
| 658 | # Note: IPMI network channel logically starts from 1. |
| 659 | :FOR ${channel_number} IN RANGE 1 ${channel_count} |
Rahul Maheshwari | 20f3bf7 | 2018-12-18 04:24:20 -0600 | [diff] [blame] | 660 | \ Run IPMI Standard Command lan print ${channel_number} |
George Keishing | 02651f0 | 2018-04-11 02:07:16 -0500 | [diff] [blame] | 661 | |
| 662 | |
| 663 | Test Invalid IPMI Channel Response |
| 664 | [Documentation] Verify invalid IPMI channels supported response. |
| 665 | [Tags] Test_Invalid_IPMI_Channel_Response |
| 666 | |
| 667 | ${channel_count}= Get Physical Network Interface Count |
| 668 | |
| 669 | # To target invalid channel, increment count. |
| 670 | ${channel_number}= Evaluate ${channel_count} + 1 |
| 671 | |
| 672 | # Example of invalid channel: |
George Keishing | 72d0ac8 | 2018-09-20 09:33:01 -0500 | [diff] [blame] | 673 | # $ ipmitool -I lanplus -H xx.xx.xx.xx -P password lan print 3 |
George Keishing | 02651f0 | 2018-04-11 02:07:16 -0500 | [diff] [blame] | 674 | # Get Channel Info command failed: Parameter out of range |
| 675 | # Invalid channel: 3 |
| 676 | |
| 677 | ${stdout}= Run External IPMI Standard Command |
| 678 | ... lan print ${channel_number} fail_on_err=${0} |
| 679 | Should Contain ${stdout} Invalid channel |
| 680 | ... msg=IPMI channel ${channel_number} is invalid but seen working. |
| 681 | |
| 682 | |
Rahul Maheshwari | fdd5ff6 | 2017-08-01 04:15:03 -0500 | [diff] [blame] | 683 | *** Keywords *** |
Sweta Potthuri | 5c6c72e | 2018-01-23 05:48:35 -0600 | [diff] [blame] | 684 | |
Rahul Maheshwari | dc6a32c | 2018-03-15 05:21:55 -0500 | [diff] [blame] | 685 | Get Sensor Count |
| 686 | [Documentation] Get sensors count using "sdr elist all" command. |
| 687 | |
| 688 | # Example of "sdr elist all" command output: |
| 689 | # BootProgress | 03h | ok | 34.2 | |
| 690 | # OperatingSystemS | 05h | ok | 35.1 | |
| 691 | # AttemptsLeft | 07h | ok | 34.1 | |
| 692 | # occ0 | 08h | ok | 210.1 | Device Disabled |
| 693 | # occ1 | 09h | ok | 210.2 | Device Disabled |
| 694 | # p0_core0_temp | 11h | ns | 3.1 | Disabled |
| 695 | # cpu0_core0 | 12h | ok | 208.1 | Presence detected |
| 696 | # p0_core1_temp | 14h | ns | 3.2 | Disabled |
| 697 | # cpu0_core1 | 15h | ok | 208.2 | Presence detected |
| 698 | # p0_core2_temp | 17h | ns | 3.3 | Disabled |
| 699 | # .. |
| 700 | # .. |
| 701 | # .. |
| 702 | # .. |
| 703 | # .. |
| 704 | # .. |
| 705 | # fan3 | 00h | ns | 29.4 | Logical FRU @35h |
| 706 | # bmc | 00h | ns | 6.1 | Logical FRU @3Ch |
| 707 | # ethernet | 00h | ns | 1.1 | Logical FRU @46h |
| 708 | |
| 709 | ${output}= Run IPMI Standard Command sdr elist all |
| 710 | ${sensor_list}= Split String ${output} \n |
| 711 | ${sensor_count}= Get Length ${sensor_list} |
| 712 | [Return] ${sensor_count} |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 713 | |
Sweta Potthuri | 5c6c72e | 2018-01-23 05:48:35 -0600 | [diff] [blame] | 714 | Set Management Controller ID String |
| 715 | [Documentation] Set the management controller ID string. |
| 716 | [Arguments] ${string} |
| 717 | |
| 718 | # Description of argument(s): |
| 719 | # string Management Controller ID String to be set |
| 720 | |
| 721 | ${set_mc_id_string}= Run IPMI Standard Command |
| 722 | ... dcmi set_mc_id_string ${string} |
| 723 | |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 724 | |
Sweta Potthuri | 5c6c72e | 2018-01-23 05:48:35 -0600 | [diff] [blame] | 725 | Get Management Controller ID String And Verify |
George Keishing | cb3b9b6 | 2018-09-14 12:11:19 -0500 | [diff] [blame] | 726 | [Documentation] Get the management controller ID string. |
Sweta Potthuri | 5c6c72e | 2018-01-23 05:48:35 -0600 | [diff] [blame] | 727 | [Arguments] ${string} |
| 728 | |
| 729 | # Description of argument(s): |
| 730 | # string Management Controller ID string |
| 731 | |
| 732 | ${get_mc_id}= Run IPMI Standard Command dcmi get_mc_id_string |
| 733 | Should Contain ${get_mc_id} ${string} |
| 734 | ... msg=Command failed: get_mc_id. |
Sweta Potthuri | 0cc6050 | 2018-01-24 00:36:17 -0600 | [diff] [blame] | 735 | |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 736 | |
Sweta Potthuri | 7d3af3c | 2018-01-29 03:07:07 -0600 | [diff] [blame] | 737 | Set Watchdog Enabled Using REST |
| 738 | [Documentation] Set watchdog Enabled field using REST. |
| 739 | [Arguments] ${value} |
| 740 | |
| 741 | # Description of argument(s): |
| 742 | # value Integer value (eg. "0-Disabled", "1-Enabled"). |
| 743 | |
| 744 | ${value_dict}= Create Dictionary data=${value} |
Steven Sombar | aaaab22 | 2018-12-19 13:16:23 -0600 | [diff] [blame] | 745 | ${resp}= OpenBMC Put Request ${HOST_WATCHDOG_URI}attr/Enabled |
Sweta Potthuri | 7d3af3c | 2018-01-29 03:07:07 -0600 | [diff] [blame] | 746 | ... data=${value_dict} |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 747 | |
| 748 | |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 749 | Fetch Details From LAN Print |
| 750 | [Documentation] Fetch details from LAN print. |
| 751 | [Arguments] ${field_name} |
| 752 | |
| 753 | # Description of argument(s): |
| 754 | # ${field_name} Field name to be fetched from LAN print |
| 755 | # (e.g. "MAC Address", "Source"). |
| 756 | |
Rahul Maheshwari | d8037d3 | 2018-12-17 00:59:57 -0600 | [diff] [blame] | 757 | ${stdout}= Run IPMI Standard Command lan print |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 758 | ${fetch_value}= Get Lines Containing String ${stdout} ${field_name} |
| 759 | ${value_fetch}= Fetch From Right ${fetch_value} :${SPACE} |
| 760 | [Return] ${value_fetch} |
| 761 | |
Sweta Potthuri | 78dd1e1 | 2018-02-21 00:03:33 -0600 | [diff] [blame] | 762 | |
| 763 | Verify Power Reading |
| 764 | [Documentation] Get dcmi power reading via IPMI. |
| 765 | |
| 766 | # Example of power reading command output via IPMI. |
| 767 | # Instantaneous power reading: 235 Watts |
| 768 | # Minimum during sampling period: 235 Watts |
| 769 | # Maximum during sampling period: 235 Watts |
| 770 | # Average power reading over sample period: 235 Watts |
| 771 | # IPMI timestamp: Thu Jan 1 00:00:00 1970 |
| 772 | # Sampling period: 00000000 Seconds. |
| 773 | # Power reading state is: deactivated |
| 774 | |
| 775 | ${power_reading}= Get IPMI Power Reading |
| 776 | |
| 777 | ${host_state}= Get Host State |
| 778 | Run Keyword If '${host_state}' == 'Off' |
George Keishing | 5131487 | 2018-03-31 13:24:35 -0500 | [diff] [blame] | 779 | ... Should Be Equal ${power_reading['instantaneous_power_reading']} 0 |
| 780 | ... msg=Power reading not zero when power is off. |
Sweta Potthuri | 78dd1e1 | 2018-02-21 00:03:33 -0600 | [diff] [blame] | 781 | |
George Keishing | 5131487 | 2018-03-31 13:24:35 -0500 | [diff] [blame] | 782 | Run Keyword If '${power_reading['instantaneous_power_reading']}' != '0' |
Sweta Potthuri | 78dd1e1 | 2018-02-21 00:03:33 -0600 | [diff] [blame] | 783 | ... Verify Power Reading Using REST ${power_reading['instantaneous_power_reading']} |
| 784 | |
| 785 | |
George Keishing | e78f1fd | 2018-09-04 13:34:59 -0500 | [diff] [blame] | 786 | Verify Power Reading Via Raw Command |
| 787 | [Documentation] Get dcmi power reading via IPMI raw command. |
| 788 | |
| 789 | ${ipmi_raw_output}= Run IPMI Standard Command |
| 790 | ... raw ${IPMI_RAW_CMD['power_reading']['Get'][0]} |
| 791 | |
| 792 | @{raw_output_list}= Split String ${ipmi_raw_output} ${SPACE} |
| 793 | |
| 794 | # On successful execution of raw IPMI power reading command, completion |
| 795 | # code does not come in output. So current power value will start from 2 |
| 796 | # byte instead of 3. |
| 797 | |
| 798 | ${power_reading_ipmi_raw_3_item}= Get From List ${raw_output_list} 2 |
| 799 | ${power_reading_ipmi_raw_3_item}= |
| 800 | ... Convert To Integer 0x${power_reading_ipmi_raw_3_item} |
| 801 | |
| 802 | ${power_reading_rest}= Read Attribute |
| 803 | ... ${SENSORS_URI}power/total_power Value |
| 804 | |
| 805 | # Example of power reading via REST |
| 806 | # "CriticalAlarmHigh": 0, |
| 807 | # "CriticalAlarmLow": 0, |
| 808 | # "CriticalHigh": 3100000000, |
| 809 | # "CriticalLow": 0, |
| 810 | # "Scale": -6, |
| 811 | # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Watts", |
| 812 | # "Value": 228000000, |
| 813 | # "WarningAlarmHigh": 0, |
| 814 | # "WarningAlarmLow": 0, |
| 815 | # "WarningHigh": 3050000000, |
| 816 | # "WarningLow": 0 |
| 817 | |
| 818 | # Get power value based on scale i.e. Value * (10 power Scale Value) |
| 819 | # e.g. from above case 228000000 * (10 power -6) = 228000000/1000000 |
| 820 | |
| 821 | ${power_reading_rest}= Evaluate ${power_reading_rest}/1000000 |
| 822 | ${ipmi_rest_power_diff}= |
| 823 | ... Evaluate abs(${power_reading_rest} - ${power_reading_ipmi_raw_3_item}) |
| 824 | |
| 825 | Should Be True ${ipmi_rest_power_diff} <= ${allowed_power_diff} |
| 826 | ... msg=Power Reading above allowed threshold ${allowed_power_diff}. |
| 827 | |
| 828 | |
Rahul Maheshwari | 0eb33f0 | 2018-04-10 02:31:54 -0500 | [diff] [blame] | 829 | Verify Management Controller ID String Status |
| 830 | [Documentation] Verify management controller ID string status via IPMI. |
| 831 | [Arguments] ${status} |
| 832 | |
| 833 | # Example of dcmi get_conf_param command output: |
| 834 | # DHCP Discovery method : |
| 835 | # Management Controller ID String is disabled |
| 836 | # Vendor class identifier DCMI IANA and Vendor class-specific Informationa are disabled |
| 837 | # Initial timeout interval : 4 seconds |
| 838 | # Server contact timeout interval : 120 seconds |
| 839 | # Server contact retry interval : 64 seconds |
| 840 | |
| 841 | ${resp}= Run IPMI Standard Command dcmi get_conf_param |
| 842 | ${resp}= Get Lines Containing String ${resp} |
| 843 | ... Management Controller ID String case_insensitive=True |
| 844 | Should Contain ${resp} ${status} |
| 845 | ... msg=Management controller ID string is not ${status} |
| 846 | |
| 847 | |
Sweta Potthuri | 78dd1e1 | 2018-02-21 00:03:33 -0600 | [diff] [blame] | 848 | Verify Power Reading Using REST |
| 849 | [Documentation] Verify power reading using REST. |
| 850 | [Arguments] ${power_reading} |
| 851 | |
Gunnar Mills | 948e2e2 | 2018-03-23 12:54:27 -0500 | [diff] [blame] | 852 | # Description of argument(s): |
Sweta Potthuri | 78dd1e1 | 2018-02-21 00:03:33 -0600 | [diff] [blame] | 853 | # power_reading IPMI Power reading |
| 854 | |
| 855 | ${power_reading_rest}= Read Attribute |
| 856 | ... ${SENSORS_URI}power/total_power Value |
| 857 | |
| 858 | # Example of power reading via REST |
| 859 | # "CriticalAlarmHigh": 0, |
| 860 | # "CriticalAlarmLow": 0, |
| 861 | # "CriticalHigh": 3100000000, |
| 862 | # "CriticalLow": 0, |
| 863 | # "Scale": -6, |
| 864 | # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Watts", |
| 865 | # "Value": 228000000, |
| 866 | # "WarningAlarmHigh": 0, |
| 867 | # "WarningAlarmLow": 0, |
| 868 | # "WarningHigh": 3050000000, |
| 869 | # "WarningLow": 0 |
| 870 | |
| 871 | # Get power value based on scale i.e. Value * (10 power Scale Value) |
| 872 | # e.g. from above case 228000000 * (10 power -6) = 228000000/1000000 |
| 873 | ${power_reading_rest}= Evaluate ${power_reading_rest}/1000000 |
| 874 | ${ipmi_rest_power_diff}= |
| 875 | ... Evaluate abs(${power_reading_rest} - ${power_reading}) |
| 876 | |
| 877 | Should Be True ${ipmi_rest_power_diff} <= ${allowed_power_diff} |
| 878 | ... msg=Power reading above allowed threshold ${allowed_power_diff}. |
George Keishing | 02651f0 | 2018-04-11 02:07:16 -0500 | [diff] [blame] | 879 | |
| 880 | |
| 881 | Get Physical Network Interface Count |
| 882 | [Documentation] Return valid physical network interfaces count. |
| 883 | |
| 884 | # Example: |
| 885 | # link/ether 22:3a:7f:70:92:cb brd ff:ff:ff:ff:ff:ff |
| 886 | # link/ether 0e:8e:0d:6b:e9:e4 brd ff:ff:ff:ff:ff:ff |
| 887 | |
| 888 | ${mac_entry_list}= Get BMC MAC Address List |
| 889 | ${mac_unique_list}= Remove Duplicates ${mac_entry_list} |
| 890 | ${physical_interface_count}= Get Length ${mac_unique_list} |
| 891 | |
| 892 | [Return] ${physical_interface_count} |
George Keishing | 39967eb | 2018-04-30 11:36:23 -0500 | [diff] [blame] | 893 | |
| 894 | |
| 895 | Execute IPMI Command With Cipher |
| 896 | [Documentation] Execute IPMI command with a given cipher level value. |
| 897 | [Arguments] ${cipher_level} |
| 898 | |
| 899 | # Description of argument(s): |
| 900 | # cipher_level IPMI chipher level value |
| 901 | # (e.g. "1", "2", "3", "15", "16", "17"). |
| 902 | |
George Keishing | f402765 | 2019-01-10 23:58:29 -0600 | [diff] [blame] | 903 | ${status}= Run Keyword And Return Status Build IPMI Ext Cmd ${cipher_level} |
George Keishing | 39967eb | 2018-04-30 11:36:23 -0500 | [diff] [blame] | 904 | |
George Keishing | f402765 | 2019-01-10 23:58:29 -0600 | [diff] [blame] | 905 | [Return] ${status} |