Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Network interface configuration and verification |
| 3 | ... tests. |
| 4 | |
George Keishing | 5d46755 | 2019-02-08 23:30:48 -0600 | [diff] [blame] | 5 | Resource ../../lib/bmc_redfish_resource.robot |
| 6 | Resource ../../lib/bmc_network_utils.robot |
| 7 | Resource ../../lib/openbmc_ffdc.robot |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 8 | Library ../../lib/bmc_network_utils.py |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 9 | Library Collections |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 10 | |
| 11 | Test Setup Test Setup Execution |
| 12 | Test Teardown Test Teardown Execution |
| 13 | |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 14 | *** Variables *** |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 15 | ${test_hostname} openbmc |
| 16 | ${test_ipv4_addr} 10.7.7.7 |
| 17 | ${test_ipv4_invalid_addr} 0.0.1.a |
| 18 | ${test_subnet_mask} 255.255.0.0 |
| 19 | ${test_gateway} 10.7.7.1 |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 20 | ${broadcast_ip} 10.7.7.255 |
| 21 | ${loopback_ip} 127.0.0.2 |
| 22 | ${multicast_ip} 224.6.6.6 |
| 23 | ${out_of_range_ip} 10.7.7.256 |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 24 | |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 25 | *** Test Cases *** |
| 26 | |
| 27 | Get IP Address And Verify |
| 28 | [Documentation] Get IP Address And Verify. |
George Keishing | 5d46755 | 2019-02-08 23:30:48 -0600 | [diff] [blame] | 29 | [Tags] Get_IP_Address_And_Verify |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 30 | |
| 31 | : FOR ${network_configuration} IN @{network_configurations} |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 32 | \ Verify IP On BMC ${network_configuration['Address']} |
| 33 | |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 34 | Get Netmask And Verify |
| 35 | [Documentation] Get Netmask And Verify. |
George Keishing | 5d46755 | 2019-02-08 23:30:48 -0600 | [diff] [blame] | 36 | [Tags] Get_Netmask_And_Verify |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 37 | |
| 38 | : FOR ${network_configuration} IN @{network_configurations} |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 39 | \ Verify Netmask On BMC ${network_configuration['SubnetMask']} |
| 40 | |
Prashanth Katti | 2ec9d8b | 2019-02-12 05:20:19 -0600 | [diff] [blame] | 41 | Get Gateway And Verify |
| 42 | [Documentation] Get gateway and verify it's existence on the BMC. |
| 43 | [Tags] Get_Gateway_And_Verify |
| 44 | |
| 45 | : FOR ${network_configuration} IN @{network_configurations} |
| 46 | \ Verify Gateway On BMC ${network_configuration['Gateway']} |
| 47 | |
| 48 | Get MAC Address And Verify |
| 49 | [Documentation] Get MAC address and verify it's existence on the BMC. |
| 50 | [Tags] Get_MAC_Address_And_Verify |
| 51 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 52 | ${resp}= Redfish.Get ${REDFISH_NW_ETH0_URI} |
Prashanth Katti | 2ec9d8b | 2019-02-12 05:20:19 -0600 | [diff] [blame] | 53 | ${macaddr}= Get From Dictionary ${resp.dict} MACAddress |
| 54 | Validate MAC On BMC ${macaddr} |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 55 | |
Prashanth Katti | 2c5c3bb | 2019-02-14 04:23:07 -0600 | [diff] [blame] | 56 | Verify All Configured IP And Netmask |
| 57 | [Documentation] Verify all configured IP and netmask on BMC. |
| 58 | [Tags] Verify_All_Configured_IP_And_Netmask |
| 59 | |
| 60 | : FOR ${network_configuration} IN @{network_configurations} |
| 61 | \ Verify IP And Netmask On BMC ${network_configuration['Address']} |
| 62 | ... ${network_configuration['SubnetMask']} |
| 63 | |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 64 | Get Hostname And Verify |
| 65 | [Documentation] Get hostname via Redfish and verify. |
| 66 | [Tags] Get_Hostname_And_Verify |
| 67 | |
| 68 | ${hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName |
| 69 | |
| 70 | Validate Hostname On BMC ${hostname} |
| 71 | |
| 72 | Configure Hostname And Verify |
| 73 | [Documentation] Configure hostname via Redfish and verify. |
| 74 | [Tags] Configure_Hostname_And_Verify |
| 75 | |
| 76 | Configure Hostname ${test_hostname} |
| 77 | |
| 78 | Validate Hostname On BMC ${test_hostname} |
| 79 | |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 80 | Add Valid IPv4 Address And Verify |
| 81 | [Documentation] Add IPv4 Address via Redfish and verify. |
| 82 | [Tags] Add_Valid_IPv4_Addres_And_Verify |
| 83 | |
| 84 | Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway} |
| 85 | Delete IP Address ${test_ipv4_addr} |
| 86 | |
| 87 | Add Invalid IPv4 Address And Verify |
| 88 | [Documentation] Add Invalid IPv4 Address via Redfish and verify. |
| 89 | [Tags] Add_Invalid_IPv4_Addres_And_Verify |
| 90 | |
| 91 | Add IP Address ${test_ipv4_invalid_addr} ${test_subnet_mask} |
| 92 | ... ${test_gateway} valid_status_codes=${HTTP_BAD_REQUEST} |
| 93 | |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 94 | Configure Out Of Range IP |
| 95 | [Documentation] Configure out-of-range IP address. |
| 96 | [Tags] Configure_Out_Of_Range_IP |
| 97 | [Template] Add IP Address |
| 98 | |
| 99 | # ip subnet_mask gateway valid_status_codes |
| 100 | ${out_of_range_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 101 | |
| 102 | Configure Broadcast IP |
| 103 | [Documentation] Configure broadcast IP address. |
| 104 | [Tags] Configure_Broadcast_IP |
| 105 | [Template] Add IP Address |
| 106 | |
| 107 | # ip subnet_mask gateway valid_status_codes |
| 108 | ${broadcast_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 109 | |
| 110 | Configure Multicast IP |
| 111 | [Documentation] Configure multicast IP address. |
| 112 | [Tags] Configure_Multicast_IP |
| 113 | [Template] Add IP Address |
| 114 | |
| 115 | # ip subnet_mask gateway valid_status_codes |
| 116 | ${multicast_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 117 | |
| 118 | Configure Loopback IP |
| 119 | [Documentation] Configure loopback IP address. |
| 120 | [Tags] Configure_Loopback_IP |
| 121 | [Template] Add IP Address |
| 122 | |
| 123 | # ip subnet_mask gateway valid_status_codes |
| 124 | ${loopback_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 125 | |
| 126 | Add Valid IPv4 Address And Check Persistency |
| 127 | [Documentation] Add IPv4 address and check peristency. |
| 128 | [Tags] Add_Valid_IPv4_Addres_And_Check_Persistency |
| 129 | |
| 130 | Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway} |
| 131 | |
| 132 | # Reboot BMC and verify persistency. |
| 133 | OBMC Reboot (off) |
| 134 | Verify IP On BMC ${test_ipv4_addr} |
| 135 | Delete IP Address ${test_ipv4_addr} |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 136 | |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 137 | Add Fourth Octet Threshold IP And Verify |
| 138 | [Documentation] Add fourth octet threshold IP and verify. |
| 139 | [Tags] Add_Fourth_Octet_Threshold_IP_And_Verify |
| 140 | |
| 141 | Add IP Address 10.7.7.254 ${test_subnet_mask} ${test_gateway} |
| 142 | Delete IP Address 10.7.7.254 |
| 143 | |
| 144 | Add Fourth Octet Lowest IP And Verify |
| 145 | [Documentation] Add fourth octet lowest IP and verify. |
| 146 | [Tags] Add_Fourth_Octet_Lowest_IP_And_Verify |
| 147 | |
| 148 | Add IP Address 10.7.7.1 ${test_subnet_mask} ${test_gateway} |
| 149 | Delete IP Address 10.7.7.1 |
| 150 | |
| 151 | Add Third Octet Threshold IP And Verify |
| 152 | [Documentation] Add third octet threshold IP and verify. |
| 153 | [Tags] Add_Third_Octet_Threshold_IP_And_Verify |
| 154 | |
| 155 | Add IP Address 10.7.255.7 ${test_subnet_mask} ${test_gateway} |
| 156 | Delete IP Address 10.7.255.7 |
| 157 | |
| 158 | Add Third Octet Lowest IP And Verify |
| 159 | [Documentation] Add third octet lowest IP and verify. |
| 160 | [Tags] Add_Third_Octet_Lowest_IP_And_Verify |
| 161 | |
| 162 | Add IP Address 10.7.0.7 ${test_subnet_mask} ${test_gateway} |
| 163 | Delete IP Address 10.7.0.7 |
| 164 | |
| 165 | Add Second Octet Threshold IP And Verify |
| 166 | [Documentation] Add second octet threshold IP and verify. |
| 167 | [Tags] Add_Second_Octet_Threshold_IP_And_Verify |
| 168 | |
| 169 | Add IP Address 10.255.7.7 ${test_subnet_mask} ${test_gateway} |
| 170 | Delete IP Address 10.255.7.7 |
| 171 | |
| 172 | Add Second Octet Lowest IP And Verify |
| 173 | [Documentation] Add second octet lowest IP and verify. |
| 174 | [Tags] Add_Second_Octet_Lowest_IP_And_Verify |
| 175 | |
| 176 | Add IP Address 10.0.7.7 ${test_subnet_mask} ${test_gateway} |
| 177 | Delete IP Address 10.0.7.7 |
| 178 | |
| 179 | Add First Octet Threshold IP And Verify |
| 180 | [Documentation] Add first octet threshold IP and verify. |
| 181 | [Tags] Add_First_Octet_Threshold_IP_And_Verify |
| 182 | |
| 183 | Add IP Address 223.7.7.7 ${test_subnet_mask} ${test_gateway} |
| 184 | Delete IP Address 223.7.7.7 |
| 185 | |
| 186 | Add First Octet Lowest IP And Verify |
| 187 | [Documentation] Add first octet lowest IP and verify. |
| 188 | [Tags] Add_First_Octet_Lowest_IP_And_Verify |
| 189 | |
| 190 | Add IP Address 1.7.7.7 ${test_subnet_mask} ${test_gateway} |
| 191 | Delete IP Address 1.7.7.7 |
| 192 | |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 193 | *** Keywords *** |
| 194 | |
| 195 | Test Setup Execution |
| 196 | [Documentation] Test setup execution. |
| 197 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 198 | Redfish.Login |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 199 | |
| 200 | @{network_configurations}= Get Network Configuration |
| 201 | Set Test Variable @{network_configurations} |
| 202 | |
| 203 | # Get BMC IP address and prefix length. |
| 204 | ${ip_data}= Get BMC IP Info |
| 205 | Set Test Variable ${ip_data} |
| 206 | |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 207 | |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 208 | Get Network Configuration |
| 209 | [Documentation] Get network configuration. |
| 210 | |
| 211 | # Sample output: |
| 212 | #{ |
| 213 | # "@odata.context": "/redfish/v1/$metadata#EthernetInterface.EthernetInterface", |
| 214 | # "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth0", |
| 215 | # "@odata.type": "#EthernetInterface.v1_2_0.EthernetInterface", |
| 216 | # "Description": "Management Network Interface", |
| 217 | # "IPv4Addresses": [ |
| 218 | # { |
| 219 | # "Address": "169.254.xx.xx", |
| 220 | # "AddressOrigin": "IPv4LinkLocal", |
| 221 | # "Gateway": "0.0.0.0", |
| 222 | # "SubnetMask": "255.255.0.0" |
| 223 | # }, |
| 224 | # { |
| 225 | # "Address": "xx.xx.xx.xx", |
| 226 | # "AddressOrigin": "Static", |
| 227 | # "Gateway": "xx.xx.xx.1", |
| 228 | # "SubnetMask": "xx.xx.xx.xx" |
| 229 | # } |
| 230 | # ], |
| 231 | # "Id": "eth0", |
| 232 | # "MACAddress": "xx:xx:xx:xx:xx:xx", |
| 233 | # "Name": "Manager Ethernet Interface", |
| 234 | # "SpeedMbps": 0, |
| 235 | # "VLAN": { |
| 236 | # "VLANEnable": false, |
| 237 | # "VLANId": 0 |
| 238 | # } |
| 239 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 240 | ${resp}= Redfish.Get ${REDFISH_NW_ETH0_URI} |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 241 | @{network_configurations}= Get From Dictionary ${resp.dict} IPv4Addresses |
| 242 | [Return] @{network_configurations} |
| 243 | |
George Keishing | 5d46755 | 2019-02-08 23:30:48 -0600 | [diff] [blame] | 244 | |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 245 | Verify IP On BMC |
| 246 | [Documentation] Verify IP on BMC. |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 247 | [Arguments] ${ip} |
| 248 | |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 249 | # Description of argument(s): |
| 250 | # ip IP address to be verified (e.g. "10.7.7.7"). |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 251 | |
| 252 | # Get IP address details on BMC using IP command. |
| 253 | @{ip_data}= Get BMC IP Info |
| 254 | Should Contain Match ${ip_data} ${ip}/* |
| 255 | ... msg=IP address does not exist. |
| 256 | |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 257 | Add IP Address |
| 258 | [Documentation] Add IP Address To BMC. |
| 259 | [Arguments] ${ip} ${subnet_mask} ${gateway} |
| 260 | ... ${valid_status_codes}=${HTTP_OK} |
| 261 | |
| 262 | # Description of argument(s): |
| 263 | # ip IP address to be added (e.g. "10.7.7.7"). |
| 264 | # subnet_mask Subnet mask for the IP to be added |
| 265 | # (e.g. "255.255.0.0"). |
| 266 | # gateway Gateway for the IP to be added (e.g. "10.7.7.1"). |
| 267 | # valid_status_codes Expected return code from patch operation |
| 268 | # (e.g. "200"). See prolog of rest_request |
| 269 | # method in redfish_plut.py for details. |
| 270 | |
| 271 | ${empty_dict}= Create Dictionary |
| 272 | ${ip_data}= Create Dictionary Address=${ip} |
| 273 | ... AddressOrigin=Static SubnetMask=${subnet_mask} |
| 274 | ... Gateway=${gateway} |
| 275 | |
| 276 | ${patch_list}= Create List |
| 277 | ${network_configurations}= Get Network Configuration |
| 278 | ${num_entries}= Get Length ${network_configurations} |
| 279 | |
| 280 | : FOR ${INDEX} IN RANGE 0 ${num_entries} |
| 281 | \ Append To List ${patch_list} ${empty_dict} |
| 282 | |
George Keishing | 98ffa86 | 2019-05-23 10:07:45 -0500 | [diff] [blame] | 283 | # We need not check for existence of IP on BMC while adding. |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 284 | Append To List ${patch_list} ${ip_data} |
| 285 | ${data}= Create Dictionary IPv4Addresses=${patch_list} |
| 286 | |
| 287 | Redfish.patch ${REDFISH_NW_ETH0_URI} body=&{data} |
| 288 | ... valid_status_codes=[${valid_status_codes}] |
| 289 | |
| 290 | Return From Keyword If '${valid_status_codes}' != '${HTTP_OK}' |
| 291 | |
| 292 | # Note: Network restart takes around 15-18s after patch request processing. |
| 293 | Sleep ${NETWORK_TIMEOUT}s |
| 294 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 295 | |
| 296 | Verify IP On BMC ${ip} |
| 297 | Validate Network Config On BMC |
| 298 | |
| 299 | |
| 300 | Delete IP Address |
| 301 | [Documentation] Delete IP Address Of BMC. |
| 302 | [Arguments] ${ip} ${valid_status_codes}=${HTTP_OK} |
| 303 | |
| 304 | # Description of argument(s): |
| 305 | # ip IP address to be deleted (e.g. "10.7.7.7"). |
| 306 | # valid_status_codes Expected return code from patch operation |
| 307 | # (e.g. "200"). See prolog of rest_request |
| 308 | # method in redfish_plut.py for details. |
| 309 | |
| 310 | ${empty_dict}= Create Dictionary |
| 311 | ${patch_list}= Create List |
| 312 | |
| 313 | @{network_configurations}= Get Network Configuration |
| 314 | : FOR ${network_configuration} IN @{network_configurations} |
| 315 | \ Run Keyword If '${network_configuration['Address']}' == '${ip}' |
| 316 | ... Append To List ${patch_list} ${null} |
| 317 | ... ELSE Append To List ${patch_list} ${empty_dict} |
| 318 | |
| 319 | ${ip_found}= Run Keyword And Return Status List Should Contain Value |
| 320 | ... ${patch_list} ${null} msg=${ip} does not exist on BMC |
| 321 | Pass Execution If ${ip_found} == ${False} ${ip} does not exist on BMC |
| 322 | |
| 323 | # Run patch command only if given IP is found on BMC |
| 324 | ${data}= Create Dictionary IPv4Addresses=${patch_list} |
| 325 | |
| 326 | Redfish.patch ${REDFISH_NW_ETH0_URI} body=&{data} |
| 327 | ... valid_status_codes=[${valid_status_codes}] |
| 328 | |
| 329 | # Note: Network restart takes around 15-18s after patch request processing |
| 330 | Sleep ${NETWORK_TIMEOUT}s |
| 331 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 332 | |
| 333 | ${delete_status}= Run Keyword And Return Status Verify IP On BMC ${ip} |
| 334 | Run Keyword If '${valid_status_codes}' == '${HTTP_OK}' |
| 335 | ... Should Be True ${delete_status} == ${False} |
| 336 | ... ELSE Should Be True ${delete_status} == ${True} |
| 337 | |
| 338 | Validate Network Config On BMC |
| 339 | |
| 340 | |
| 341 | Validate Network Config On BMC |
| 342 | [Documentation] Check that network info obtained via redfish matches info |
| 343 | ... obtained via CLI. |
| 344 | |
| 345 | @{network_configurations}= Get Network Configuration |
| 346 | ${ip_data}= Get BMC IP Info |
| 347 | : FOR ${network_configuration} IN @{network_configurations} |
| 348 | \ Should Contain Match ${ip_data} ${network_configuration['Address']}/* |
| 349 | ... msg=IP address does not exist. |
| 350 | |
George Keishing | 5d46755 | 2019-02-08 23:30:48 -0600 | [diff] [blame] | 351 | |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 352 | Verify Netmask On BMC |
| 353 | [Documentation] Verify netmask on BMC. |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 354 | [Arguments] ${netmask} |
| 355 | |
| 356 | # Description of the argument(s): |
| 357 | # netmask netmask value to be verified. |
| 358 | |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 359 | ${prefix_length}= Netmask Prefix Length ${netmask} |
| 360 | |
| 361 | Should Contain Match ${ip_data} */${prefix_length} |
| 362 | ... msg=Prefix length does not exist. |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 363 | |
Prashanth Katti | 2ec9d8b | 2019-02-12 05:20:19 -0600 | [diff] [blame] | 364 | Verify Gateway On BMC |
| 365 | [Documentation] Verify gateway on BMC. |
| 366 | [Arguments] ${gateway_ip}=0.0.0.0 |
| 367 | |
| 368 | # Description of argument(s): |
| 369 | # gateway_ip Gateway IP address. |
| 370 | |
| 371 | ${route_info}= Get BMC Route Info |
| 372 | |
| 373 | # If gateway IP is empty or 0.0.0.0 it will not have route entry. |
| 374 | |
| 375 | Run Keyword If '${gateway_ip}' == '0.0.0.0' |
| 376 | ... Pass Execution Gateway IP is "0.0.0.0". |
| 377 | ... ELSE |
| 378 | ... Should Contain ${route_info} ${gateway_ip} |
| 379 | ... msg=Gateway IP address not matching. |
George Keishing | 5d46755 | 2019-02-08 23:30:48 -0600 | [diff] [blame] | 380 | |
Prashanth Katti | 2c5c3bb | 2019-02-14 04:23:07 -0600 | [diff] [blame] | 381 | Verify IP And Netmask On BMC |
| 382 | [Documentation] Verify IP and netmask on BMC. |
| 383 | [Arguments] ${ip} ${netmask} |
| 384 | |
| 385 | # Description of the argument(s): |
| 386 | # ip IP address to be verified. |
| 387 | # netmask netmask value to be verified. |
| 388 | |
| 389 | ${prefix_length}= Netmask Prefix Length ${netmask} |
| 390 | @{ip_data}= Get BMC IP Info |
| 391 | |
| 392 | ${ip_with_netmask}= Catenate ${ip}/${prefix_length} |
| 393 | Should Contain ${ip_data} ${ip_with_netmask} |
| 394 | ... msg=IP and netmask pair does not exist. |
| 395 | |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 396 | Configure Hostname |
| 397 | [Documentation] Configure hostname on BMC via Redfish. |
| 398 | [Arguments] ${hostname} |
| 399 | |
| 400 | # Description of argument(s): |
| 401 | # hostname A hostname value which is to be configured on BMC. |
| 402 | |
| 403 | ${data}= Create Dictionary HostName=${hostname} |
| 404 | Redfish.patch ${REDFISH_NW_PROTOCOL_URI} body=&{data} |
| 405 | |
| 406 | Validate Hostname On BMC |
| 407 | [Documentation] Verify that the hostname read via Redfish is the same as the |
| 408 | ... hostname configured on system. |
| 409 | [Arguments] ${hostname} |
| 410 | |
| 411 | # Description of argument(s): |
| 412 | # hostname A hostname value which is to be compared to the hostname |
| 413 | # configured on system. |
| 414 | |
| 415 | ${sys_hostname}= Get BMC Hostname |
Prashanth Katti | 466d834 | 2019-03-21 08:58:50 -0500 | [diff] [blame] | 416 | Should Be Equal ${sys_hostname} ${hostname} |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 417 | ... ignore_case=True msg=Hostname does not exist. |
| 418 | |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 419 | Test Teardown Execution |
| 420 | [Documentation] Test teardown execution. |
| 421 | |
| 422 | FFDC On Test Case Fail |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 423 | Redfish.Logout |