| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 1 | *** Settings *** | 
|  | 2 |  | 
|  | 3 | Documentation          Module to test IPMI network functionality. | 
|  | 4 | Resource               ../lib/ipmi_client.robot | 
|  | 5 | Resource               ../lib/openbmc_ffdc.robot | 
|  | 6 | Resource               ../lib/bmc_network_utils.robot | 
|  | 7 | Library                ../lib/ipmi_utils.py | 
|  | 8 | Library                ../lib/gen_robot_valid.py | 
|  | 9 | Library                ../lib/var_funcs.py | 
|  | 10 | Library                ../lib/bmc_network_utils.py | 
| Tony Lee | c03c8e2 | 2020-03-25 13:41:07 +0800 | [diff] [blame] | 11 | Variables              ../data/ipmi_raw_cmd_table.py | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 12 |  | 
|  | 13 | Suite Setup            Redfish.Login | 
|  | 14 | Test Setup             Printn | 
|  | 15 | Test Teardown          FFDC On Test Case Fail | 
|  | 16 |  | 
| Matt Fischer | 6fb70d9 | 2023-10-24 19:06:33 -0600 | [diff] [blame] | 17 | Test Tags             IPMI_Network_Verification | 
| chithrag | 4ad123a | 2022-04-12 19:26:05 +0000 | [diff] [blame] | 18 |  | 
|  | 19 | *** Variables *** | 
| George Keishing | 87dc442 | 2023-10-20 12:56:30 +0530 | [diff] [blame] | 20 |  | 
| chithrag | 4ad123a | 2022-04-12 19:26:05 +0000 | [diff] [blame] | 21 | ${set_mac_address}                      02:f4:43:24:e7:1a | 
|  | 22 | ${Invalid_mac_address}                  11:f4:43:24:e7:1a | 
|  | 23 |  | 
|  | 24 |  | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 25 | *** Test Cases *** | 
|  | 26 |  | 
|  | 27 | Retrieve IP Address Via IPMI And Verify Using Redfish | 
|  | 28 | [Documentation]  Retrieve IP address using IPMI and verify using Redfish. | 
| George Keishing | b98036a | 2022-01-31 12:39:47 -0600 | [diff] [blame] | 29 | [Tags]  Retrieve_IP_Address_Via_IPMI_And_Verify_Using_Redfish | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 30 |  | 
| ishwaryamathim | e9cecb2 | 2023-11-10 06:14:21 +0000 | [diff] [blame] | 31 | ${all_channels_list}=  Get Channel Number For All Interface | 
|  | 32 | ${valid_channels_list}=  Get Valid Channel Number  ${all_channels_list} | 
|  | 33 | ${ethernet_channels_list}=  Get Channel Number For Valid Ethernet Interface | 
|  | 34 | ...  ${valid_channels_list} | 
|  | 35 |  | 
|  | 36 | FOR  ${channel_number}  IN  @{ethernet_channels_list} | 
|  | 37 | Verify Channel Info  ${channel_number}  IPv4StaticAddresses  ${valid_channels_list} | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 38 | END | 
|  | 39 |  | 
| ishwaryamathim | e9cecb2 | 2023-11-10 06:14:21 +0000 | [diff] [blame] | 40 |  | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 41 | Retrieve Default Gateway Via IPMI And Verify | 
|  | 42 | [Documentation]  Retrieve default gateway via IPMI and verify it's existence on the BMC. | 
|  | 43 | [Tags]  Retrieve_Default_Gateway_Via_IPMI_And_Verify | 
|  | 44 |  | 
|  | 45 | ${lan_print_ipmi}=  Get LAN Print Dict | 
|  | 46 |  | 
|  | 47 | Verify Gateway On BMC  ${lan_print_ipmi['Default Gateway IP']} | 
|  | 48 |  | 
|  | 49 |  | 
|  | 50 | Retrieve MAC Address Via IPMI And Verify Using Redfish | 
|  | 51 | [Documentation]  Retrieve MAC address via IPMI and verify using Redfish. | 
|  | 52 | [Tags]  Retrieve_MAC_Address_Via_IPMI_And_Verify_Using_Redfish | 
|  | 53 |  | 
| ishwaryamathim | e9cecb2 | 2023-11-10 06:14:21 +0000 | [diff] [blame] | 54 | ${all_channels_list}=  Get Channel Number For All Interface | 
|  | 55 | ${valid_channels_list}=  Get Valid Channel Number  ${all_channels_list} | 
|  | 56 | ${ethernet_channels_list}=  Get Channel Number For Valid Ethernet Interface | 
|  | 57 | ...  ${valid_channels_list} | 
|  | 58 |  | 
|  | 59 | FOR  ${channel_number}  IN  @{ethernet_channels_list} | 
|  | 60 | Verify Channel Info  ${channel_number}  MACAddress  ${valid_channels_list} | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 61 | END | 
|  | 62 |  | 
|  | 63 |  | 
|  | 64 | Test Valid IPMI Channels Supported | 
|  | 65 | [Documentation]  Verify IPMI channels supported on a given system. | 
|  | 66 | [Tags]  Test_Valid_IPMI_Channels_Supported | 
|  | 67 |  | 
| ishwaryamathim | e9cecb2 | 2023-11-10 06:14:21 +0000 | [diff] [blame] | 68 | @{active_channel_list}=  Get Active Ethernet Channel List | 
|  | 69 | Set Suite Variable  @{active_channel_list} | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 70 |  | 
| ishwaryamathim | e9cecb2 | 2023-11-10 06:14:21 +0000 | [diff] [blame] | 71 | FOR  ${channel_number}  IN  @{active_channel_list} | 
|  | 72 | ${stdout}=  Run IPMI Standard Command | 
|  | 73 | ...  lan print ${channel_number} | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 74 | END | 
|  | 75 |  | 
|  | 76 |  | 
|  | 77 | Test Invalid IPMI Channel Response | 
|  | 78 | [Documentation]  Verify invalid IPMI channels supported response. | 
|  | 79 | [Tags]  Test_Invalid_IPMI_Channel_Response | 
|  | 80 |  | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 81 | # Example of invalid channel: | 
|  | 82 | # $ ipmitool -I lanplus -H xx.xx.xx.xx -P password lan print 3 | 
|  | 83 | # Get Channel Info command failed: Parameter out of range | 
|  | 84 | # Invalid channel: 3 | 
|  | 85 |  | 
| ishwaryamathim | 27d779d | 2023-11-10 05:42:47 +0000 | [diff] [blame] | 86 | @{inactive_channel_list}=  Get Invalid Channel Number List | 
|  | 87 | FOR  ${channel_number}  IN  @{inactive_channel_list} | 
|  | 88 | ${stdout}=  Run IPMI Standard Command | 
|  | 89 | ...  lan print ${channel_number}  fail_on_err=${0} | 
|  | 90 | Should Contain  ${stdout}  Invalid channel | 
|  | 91 | ...  msg=IPMI channel ${channel_number} is invalid but seen working. | 
|  | 92 | END | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 93 |  | 
|  | 94 |  | 
|  | 95 | Get IP Address Source And Verify Using Redfish | 
|  | 96 | [Documentation]  Get IP address source and verify it using Redfish. | 
|  | 97 | [Tags]  Get_IP_Address_Source_And_Verify_Using_Redfish | 
|  | 98 |  | 
|  | 99 | ${active_channel_config}=  Get Active Channel Config | 
|  | 100 | ${lan_config}=  Get LAN Print Dict  ${CHANNEL_NUMBER} | 
|  | 101 |  | 
|  | 102 | ${ipv4_addresses}=  Redfish.Get Attribute | 
| ganesanb | 4d43028 | 2023-04-27 14:33:23 +0000 | [diff] [blame] | 103 | ...  /redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 104 | ...  IPv4Addresses | 
|  | 105 |  | 
|  | 106 | FOR  ${ipv4_address}  IN  @{ipv4_addresses} | 
|  | 107 | ${ip_address_source}= | 
|  | 108 | ...  Set Variable if  '${ipv4_address['Address']}' == '${lan_config['IP Address']}' | 
|  | 109 | ...  ${ipv4_address['AddressOrigin']} Address | 
| Sridevi Ramesh | c6e7f93 | 2025-05-07 11:26:54 -0500 | [diff] [blame] | 110 | IF  "${ip_address_source}" != 'None'  BREAK | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 111 | END | 
|  | 112 |  | 
|  | 113 | Valid Value  lan_config['IP Address Source']  ['${ip_address_source}'] | 
|  | 114 |  | 
|  | 115 |  | 
| Tony Lee | c03c8e2 | 2020-03-25 13:41:07 +0800 | [diff] [blame] | 116 | Verify Get Set In Progress | 
|  | 117 | [Documentation]  Verify Get Set In Progress which belongs to LAN Configuration Parameters | 
|  | 118 | ...              via IPMI raw Command. | 
| Tony Lee | 5e73552 | 2020-05-13 20:23:38 +0800 | [diff] [blame] | 119 | [Tags]  Verify_Get_Set_In_Progress | 
| Tony Lee | c03c8e2 | 2020-03-25 13:41:07 +0800 | [diff] [blame] | 120 |  | 
|  | 121 | ${ipmi_output}=  Run IPMI Command | 
|  | 122 | ...  ${IPMI_RAW_CMD['LAN_Config_Params']['Get'][0]} ${CHANNEL_NUMBER} 0x00 0x00 0x00 | 
|  | 123 |  | 
|  | 124 | ${ipmi_output}=  Split String  ${ipmi_output} | 
|  | 125 | ${set_in_progress_value}=  Set Variable  ${ipmi_output[1]} | 
|  | 126 |  | 
|  | 127 | # 00b = set complete. | 
|  | 128 | # 01b = set in progress. | 
|  | 129 | Should Contain Any  ${set_in_progress_value}  00  01 | 
|  | 130 |  | 
|  | 131 |  | 
|  | 132 | Verify Cipher Suite Entry Count | 
|  | 133 | [Documentation]  Verify cipher suite entry count which belongs to LAN Configuration Parameters | 
|  | 134 | ...              via IPMI raw Command. | 
| Tony Lee | 5e73552 | 2020-05-13 20:23:38 +0800 | [diff] [blame] | 135 | [Tags]  Verify_Cipher_Suite_Entry_Count | 
| Tony Lee | c03c8e2 | 2020-03-25 13:41:07 +0800 | [diff] [blame] | 136 |  | 
|  | 137 | ${ipmi_output}=  Run IPMI Command | 
|  | 138 | ...  ${IPMI_RAW_CMD['LAN_Config_Params']['Get'][0]} ${CHANNEL_NUMBER} 0x16 0x00 0x00 | 
|  | 139 | ${cipher_suite_entry_count}=  Split String  ${ipmi_output} | 
|  | 140 |  | 
|  | 141 | # Convert minor cipher suite entry count from BCD format to integer. i.e. 01 to 1. | 
|  | 142 | ${cipher_suite_entry_count[1]}=  Convert To Integer  ${cipher_suite_entry_count[1]} | 
|  | 143 | ${cnt}=  Get length  ${valid_ciphers} | 
|  | 144 |  | 
|  | 145 | Should be Equal  ${cipher_suite_entry_count[1]}  ${cnt} | 
|  | 146 |  | 
|  | 147 |  | 
|  | 148 | Verify Authentication Type Support | 
|  | 149 | [Documentation]  Verify authentication type support which belongs to LAN Configuration Parameters | 
|  | 150 | ...              via IPMI raw Command. | 
| Tony Lee | 5e73552 | 2020-05-13 20:23:38 +0800 | [diff] [blame] | 151 | [Tags]  Verify_Authentication_Type_Support | 
| Tony Lee | c03c8e2 | 2020-03-25 13:41:07 +0800 | [diff] [blame] | 152 |  | 
|  | 153 | ${ipmi_output}=  Run IPMI Command | 
|  | 154 | ...  ${IPMI_RAW_CMD['LAN_Config_Params']['Get'][0]} ${CHANNEL_NUMBER} 0x01 0x00 0x00 | 
|  | 155 |  | 
|  | 156 | ${authentication_type_support}=  Split String  ${ipmi_output} | 
|  | 157 | # All bits: | 
|  | 158 | # 1b = supported | 
|  | 159 | # 0b = authentication type not available for use | 
|  | 160 | # [5] - OEM proprietary (per OEM identified by the IANA OEM ID in the RMCP Ping Response) | 
|  | 161 | # [4] - straight password / key | 
|  | 162 | # [3] - reserved | 
|  | 163 | # [2] - MD5 | 
|  | 164 | # [1] - MD2 | 
|  | 165 | # [0] - none | 
|  | 166 | Should Contain Any  ${authentication_type_support[1]}  00  01  02  03  04  05 | 
|  | 167 |  | 
|  | 168 |  | 
| chithrag | 4ad123a | 2022-04-12 19:26:05 +0000 | [diff] [blame] | 169 | Verify Set In Progress | 
|  | 170 | [Documentation]  Verify Set In Progress which belongs to LAN Configuration Parameters | 
|  | 171 | ...              via IPMI raw Command. | 
|  | 172 | [Tags]  Verify_Set_In_Progress | 
|  | 173 |  | 
|  | 174 | # Set the Set In Progress | 
|  | 175 | ${output_msg}=  Run Inband IPMI Raw Command | 
|  | 176 | ...  ${IPMI_RAW_CMD['LAN_Config_Params']['Set'][0]} ${CHANNEL_NUMBER} 0x00 0x01 | 
|  | 177 |  | 
|  | 178 | # Get the Set In Progress | 
|  | 179 | ${ipmi_output}=  Run Inband IPMI Raw Command | 
|  | 180 | ...  ${IPMI_RAW_CMD['LAN_Config_Params']['Get'][0]} ${CHANNEL_NUMBER} 0x00 0x00 0x00 | 
|  | 181 |  | 
|  | 182 | # Verify the response | 
|  | 183 | ${ipmi_output}=  Split String  ${ipmi_output} | 
|  | 184 | ${set_in_progress_value}=  Set Variable  ${ipmi_output[1]} | 
|  | 185 |  | 
|  | 186 | # 01b = set in progress. | 
|  | 187 | Should be Equal  ${set_in_progress_value}  01 | 
|  | 188 |  | 
|  | 189 | # set back to default. | 
|  | 190 | Run IPMI Command  ${IPMI_RAW_CMD['LAN_Config_Params']['Set'][0]} ${CHANNEL_NUMBER} 0x00 0x00 | 
|  | 191 |  | 
|  | 192 | # Get the Set In Progress. | 
|  | 193 | ${ipmi_output}=  Run Inband IPMI Raw Command | 
|  | 194 | ...  ${IPMI_RAW_CMD['LAN_Config_Params']['Get'][0]} ${CHANNEL_NUMBER} 0x00 0x00 0x00 | 
|  | 195 |  | 
|  | 196 | # Verify the response. | 
|  | 197 | ${ipmi_output}=  Split String  ${ipmi_output} | 
|  | 198 | ${set_in_progress_value}=  Set Variable  ${ipmi_output[1]} | 
|  | 199 |  | 
|  | 200 | # 00b = set complete. | 
|  | 201 | Should be Equal  ${set_in_progress_value}  00 | 
|  | 202 |  | 
|  | 203 |  | 
|  | 204 | Verify Invalid Set MAC Address Via IPMI | 
|  | 205 | [Documentation]  Verify Get and Set MAC address via IPMI. | 
|  | 206 | [Tags]  Verify_Invalid_Set_MAC_Address_Via_IPMI | 
|  | 207 |  | 
|  | 208 | # MAC to hexa string. | 
|  | 209 | ${Invalid_mac_address_hex}=  Mac Address To Hex String  ${Invalid_mac_address} | 
|  | 210 |  | 
|  | 211 | # Set MAC Address with invalid data. | 
| George Keishing | 6e64126 | 2022-05-05 10:46:22 -0500 | [diff] [blame] | 212 | ${cmd}=  Catenate  ${IPMI_RAW_CMD['LAN_Config_Params']['Set'][0]} ${CHANNEL_NUMBER} | 
| ishwaryamathim | 27d779d | 2023-11-10 05:42:47 +0000 | [diff] [blame] | 213 | ...  0x05 ${Invalid_mac_address_hex} | 
|  | 214 | ${ipmi_set_output}=  Run Inband IPMI Raw Command  ${cmd}  fail_on_err=0 | 
| chithrag | 4ad123a | 2022-04-12 19:26:05 +0000 | [diff] [blame] | 215 |  | 
|  | 216 | Should Contain  ${ipmi_set_output}  ${IPMI_RAW_CMD['LAN_Config_Params']['Set'][3]} | 
|  | 217 |  | 
|  | 218 |  | 
| George Keishing | e45d262 | 2022-05-05 07:27:30 -0500 | [diff] [blame] | 219 | Verify Get And Set MAC Address Via IPMI | 
| chithrag | 4ad123a | 2022-04-12 19:26:05 +0000 | [diff] [blame] | 220 | [Documentation]  Verify Get and Set MAC address via IPMI. | 
| George Keishing | e45d262 | 2022-05-05 07:27:30 -0500 | [diff] [blame] | 221 | [Tags]  Verify_Get_And_Set_MAC_Address_Via_IPMI | 
| chithrag | 4ad123a | 2022-04-12 19:26:05 +0000 | [diff] [blame] | 222 | [Setup]  Fetch The Default Mac Address | 
|  | 223 | [Teardown]  Set Default Mac And Verify  ${ipmi_default_mac_split} | 
|  | 224 |  | 
|  | 225 | # MAC to hexa string. | 
|  | 226 | ${mac_address_hex}=  Mac Address To Hex String  ${set_mac_address} | 
|  | 227 |  | 
|  | 228 | # Set the MAC address. | 
| George Keishing | 6e64126 | 2022-05-05 10:46:22 -0500 | [diff] [blame] | 229 | ${cmd}=  Catenate  ${IPMI_RAW_CMD['LAN_Config_Params']['Set'][0]} ${CHANNEL_NUMBER} | 
| ishwaryamathim | 27d779d | 2023-11-10 05:42:47 +0000 | [diff] [blame] | 230 | ...  0x05 ${mac_address_hex} | 
|  | 231 | ${ipmi_set_output}=  Run Inband IPMI Raw Command  ${cmd}  fail_on_err=0 | 
| chithrag | 4ad123a | 2022-04-12 19:26:05 +0000 | [diff] [blame] | 232 |  | 
|  | 233 | # Get the MAC address and verify. | 
|  | 234 | ${ipmi_output}=  Run Inband IPMI Raw Command | 
|  | 235 | ...  ${IPMI_RAW_CMD['LAN_Config_Params']['Get'][0]} ${CHANNEL_NUMBER} 0x05 0x00 0x00 | 
|  | 236 | ${ipmi_output_split}=  Split String  ${ipmi_output} | 
|  | 237 | ${get_mac}=   Evaluate  ":".join(${ipmi_output_split[1:]}) | 
|  | 238 |  | 
|  | 239 | Should be Equal  ${get_mac}  ${set_mac_address} | 
|  | 240 |  | 
|  | 241 |  | 
|  | 242 | Verify Cipher Suite Privilege | 
|  | 243 | [Documentation]  Verify cipher suite privilege which belongs to LAN Configuration Parameters | 
|  | 244 | ...              via IPMI raw Command. | 
|  | 245 | [Tags]  Verify_Cipher_Suite_Privilege | 
|  | 246 |  | 
|  | 247 | # Get the Cipher Suite privilege and verify the response. | 
|  | 248 | ${ipmi_output}=  Run Inband IPMI Raw Command | 
|  | 249 | ...  ${IPMI_RAW_CMD['LAN_Config_Params']['Get'][0]} ${CHANNEL_NUMBER} 0x18 0x00 0x00 | 
|  | 250 | ${cipher_suite_privilege}=  Split String  ${ipmi_output} | 
|  | 251 |  | 
|  | 252 | Should be Equal  '${${cipher_suite_privilege}[0]}'  '11' | 
|  | 253 | # 00b = reserved. | 
|  | 254 | Should Contain Any  '${cipher_suite_privilege[1]}'  '00'  '0' | 
|  | 255 |  | 
|  | 256 | ${cipher_suite_privilege_length}=  Get length  ${cipher_suite_privilege} | 
|  | 257 | Should be Equal  '${cipher_suite_privilege_length}'  '10' | 
|  | 258 |  | 
|  | 259 | #44b = Maximum privilege for cipher suite. | 
|  | 260 | FOR  ${channel_number}  IN RANGE  2  ${cipher_suite_privilege_length} | 
|  | 261 | Should be Equal  '${cipher_suite_privilege[${channel_number}]}'  '44' | 
|  | 262 | END | 
|  | 263 |  | 
|  | 264 |  | 
|  | 265 | Verify Set On Authentication Type | 
|  | 266 | [Documentation]  Verify Set On Authentication Type which belongs to LAN Configuration Parameters | 
|  | 267 | ...              via IPMI raw Command. | 
|  | 268 | [Tags]  Verify_Set_On_Authentication_Type | 
|  | 269 |  | 
|  | 270 | # Set Authentication Type and expect error. | 
|  | 271 | ${ipmi_output}=  Run Inband IPMI Raw Command | 
|  | 272 | ...  ${IPMI_RAW_CMD['LAN_Config_Params']['Set'][0]} ${CHANNEL_NUMBER} 0x01 0x01  fail_on_err=0 | 
|  | 273 |  | 
|  | 274 | Should Contain  ${ipmi_output}  ${IPMI_RAW_CMD['LAN_Config_Params']['Set'][2]} | 
|  | 275 |  | 
|  | 276 |  | 
|  | 277 | Verify IP Address Source Set To Address Loaded By BIOS | 
|  | 278 | [Documentation]  Verify Set IP Address Source to address loaded by BIOS or system software via IPMI. | 
|  | 279 | [Tags]  Verify_IP_Address_Source_Set_To_Address_Loaded_By_BIOS | 
|  | 280 |  | 
|  | 281 | # Set IP address source to address loaded by BIOS or system software. | 
|  | 282 | ${ipmi_output}=  Run Keyword and Expect Error  *${IPMI_RAW_CMD['LAN_Config_Params']['Set'][3]}* | 
| George Keishing | 6e64126 | 2022-05-05 10:46:22 -0500 | [diff] [blame] | 283 | ...  Run Inband IPMI Raw Command | 
|  | 284 | ...  ${IPMI_RAW_CMD['LAN_Config_Params']['Set'][0]} 0x0${CHANNEL_NUMBER} 0x04 0x03 | 
| chithrag | 4ad123a | 2022-04-12 19:26:05 +0000 | [diff] [blame] | 285 |  | 
|  | 286 |  | 
|  | 287 | Verify IP Address Source Set To Address Obtained By BMC | 
|  | 288 | [Documentation]  Verify Set IP Address Source to address obtained by, | 
|  | 289 | ...              BMC running other address assignment protocol via IPMI. | 
|  | 290 | [Tags]  Verify_IP_Address_Source_Set_To_Address_Obtained_By_BMC | 
|  | 291 |  | 
|  | 292 | # Set IP address source to address obtained by BMC running other address assignment protocol | 
|  | 293 | ${ipmi_output}=  Run Keyword and Expect Error  *${IPMI_RAW_CMD['LAN_Config_Params']['Set'][3]}* | 
| George Keishing | 6e64126 | 2022-05-05 10:46:22 -0500 | [diff] [blame] | 294 | ...  Run Inband IPMI Raw Command | 
|  | 295 | ...  ${IPMI_RAW_CMD['LAN_Config_Params']['Set'][0]} 0x0${CHANNEL_NUMBER} 0x04 0x04 | 
| chithrag | 4ad123a | 2022-04-12 19:26:05 +0000 | [diff] [blame] | 296 |  | 
|  | 297 |  | 
|  | 298 | Verify IP Address Source Set To Unspecified Address Source | 
|  | 299 | [Documentation]  Verify Set IP Address source to unspecified address source via IPMI. | 
|  | 300 | [Tags]  Verify_IP_Address_Source_Set_To_Unspecified_Address_Source | 
|  | 301 |  | 
|  | 302 | # Set IP address source to unspecified address source. | 
|  | 303 | ${ipmi_output}=  Run Keyword and Expect Error  *${IPMI_RAW_CMD['LAN_Config_Params']['Set'][3]}* | 
| George Keishing | 6e64126 | 2022-05-05 10:46:22 -0500 | [diff] [blame] | 304 | ...  Run Inband IPMI Raw Command | 
|  | 305 | ...  ${IPMI_RAW_CMD['LAN_Config_Params']['Set'][0]} 0x0${CHANNEL_NUMBER} 0x04 0x00 | 
| chithrag | 4ad123a | 2022-04-12 19:26:05 +0000 | [diff] [blame] | 306 |  | 
|  | 307 |  | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 308 | *** Keywords *** | 
|  | 309 |  | 
|  | 310 | Get Physical Network Interface Count | 
|  | 311 | [Documentation]  Return valid physical network interfaces count. | 
|  | 312 | # Example: | 
|  | 313 | # link/ether 22:3a:7f:70:92:cb brd ff:ff:ff:ff:ff:ff | 
|  | 314 | # link/ether 0e:8e:0d:6b:e9:e4 brd ff:ff:ff:ff:ff:ff | 
|  | 315 |  | 
|  | 316 | ${mac_entry_list}=  Get BMC MAC Address List | 
|  | 317 | ${mac_unique_list}=  Remove Duplicates  ${mac_entry_list} | 
|  | 318 | ${physical_interface_count}=  Get Length  ${mac_unique_list} | 
|  | 319 |  | 
| George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 320 | RETURN  ${physical_interface_count} | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 321 |  | 
|  | 322 |  | 
|  | 323 | Verify Channel Info | 
|  | 324 | [Documentation]  Verify the channel info. | 
| ishwaryamathim | e9cecb2 | 2023-11-10 06:14:21 +0000 | [diff] [blame] | 325 | [Arguments]  ${channel_number}  ${network_parameter}  ${valid_channels_list} | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 326 |  | 
| Sridevi Ramesh | c6e7f93 | 2025-05-07 11:26:54 -0500 | [diff] [blame] | 327 | IF  '${network_parameter}' == 'IPv4StaticAddresses' | 
|  | 328 | Verify IPv4 Static Address  ${channel_number}  ${valid_channels_list} | 
|  | 329 | ELSE IF  '${network_parameter}' == 'MACAddress' | 
|  | 330 | Verify MAC Address  ${channel_number}  ${valid_channels_list} | 
|  | 331 | END | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 332 |  | 
|  | 333 | Verify IPv4 Static Address | 
|  | 334 | [Documentation]  Verify the IPv4 Static Address. | 
| ishwaryamathim | e9cecb2 | 2023-11-10 06:14:21 +0000 | [diff] [blame] | 335 | [Arguments]  ${channel_number}  ${valid_channels_list} | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 336 |  | 
|  | 337 | ${lan_print_ipmi}=  Get LAN Print Dict  ${channel_number} | 
|  | 338 | ${ipv4_static_addresses}=  Redfish.Get Attribute | 
| ishwaryamathim | e9cecb2 | 2023-11-10 06:14:21 +0000 | [diff] [blame] | 339 | ...  ${REDFISH_NW_ETH_IFACE}${valid_channels_list['${channel_number}']['name']}  IPv4StaticAddresses | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 340 | ${redfish_ips}=  Nested Get  Address  ${ipv4_static_addresses} | 
|  | 341 | Rprint Vars  lan_print_ipmi  ipv4_static_addresses  redfish_ips | 
|  | 342 | Valid Value  lan_print_ipmi['IP Address']  ${redfish_ips} | 
|  | 343 |  | 
|  | 344 |  | 
|  | 345 | Verify MAC Address | 
|  | 346 | [Documentation]  Verify the MAC Address. | 
| ishwaryamathim | e9cecb2 | 2023-11-10 06:14:21 +0000 | [diff] [blame] | 347 | [Arguments]  ${channel_number}  ${valid_channels_list} | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 348 |  | 
|  | 349 | ${lan_print_ipmi}=  Get LAN Print Dict  ${channel_number} | 
|  | 350 | ${redfish_mac_address}=  Redfish.Get Attribute | 
| ishwaryamathim | e9cecb2 | 2023-11-10 06:14:21 +0000 | [diff] [blame] | 351 | ...  ${REDFISH_NW_ETH_IFACE}${valid_channels_list['${channel_number}']['name']}  MACAddress | 
| George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 352 | Rprint Vars  lan_print_ipmi  redfish_mac_address | 
|  | 353 | Valid Value  lan_print_ipmi['MAC Address']  ['${redfish_mac_address}'] | 
| chithrag | 4ad123a | 2022-04-12 19:26:05 +0000 | [diff] [blame] | 354 |  | 
|  | 355 |  | 
|  | 356 | Fetch The Default Mac Address | 
|  | 357 | [Documentation]  Fetch The Default MAC Address. | 
|  | 358 |  | 
|  | 359 | # Get Default MAC Address. | 
|  | 360 | ${ipmi_get_default_mac}=  Run Inband IPMI Raw Command | 
|  | 361 | ...  ${IPMI_RAW_CMD['LAN_Config_Params']['Get'][0]} ${CHANNEL_NUMBER} 0x05 0x00 0x00 | 
|  | 362 | Set Test Variable  ${ipmi_get_default_mac} | 
|  | 363 |  | 
|  | 364 | # After splitting, list will have each byte of MAC address. | 
|  | 365 | ${ipmi_default_mac_split}=  Split String  ${ipmi_get_default_mac} | 
|  | 366 | Set Test Variable  ${ipmi_default_mac_split} | 
|  | 367 |  | 
|  | 368 |  | 
|  | 369 | Set Default Mac And Verify | 
|  | 370 | [Documentation]  Set Default Mac And Verify. | 
|  | 371 | [Arguments]  ${default_mac}=${ipmi_default_mac_split} | 
|  | 372 |  | 
|  | 373 | ${set_default_mac}=   Evaluate  ":".join(${default_mac[1:]}) | 
|  | 374 | ${default_mac_address_hex}=  Mac Address To Hex String  ${set_default_mac} | 
|  | 375 |  | 
|  | 376 | # Set the Default MAC address. | 
| George Keishing | 6e64126 | 2022-05-05 10:46:22 -0500 | [diff] [blame] | 377 | ${cmd}=  Catenate  ${IPMI_RAW_CMD['LAN_Config_Params']['Set'][0]} ${CHANNEL_NUMBER} | 
| ishwaryamathim | 27d779d | 2023-11-10 05:42:47 +0000 | [diff] [blame] | 378 | ...  0x05 ${default_mac_address_hex} | 
|  | 379 | ${ipmi_set_output}=  Run Inband IPMI Raw Command  ${cmd}  fail_on_err=0 | 
| chithrag | 4ad123a | 2022-04-12 19:26:05 +0000 | [diff] [blame] | 380 |  | 
|  | 381 | # check whether the default MAC is set. | 
|  | 382 | ${ipmi_get_mac}=  Run Inband IPMI Raw Command | 
|  | 383 | ...  ${IPMI_RAW_CMD['LAN_Config_Params']['Get'][0]} ${CHANNEL_NUMBER} 0x05 0x00 0x00 | 
|  | 384 |  | 
|  | 385 | ${ipmi_out}=  Split String  ${ipmi_get_mac} | 
|  | 386 | Should be Equal  ${default_mac}  ${ipmi_out} |