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