| 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 | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 137 | *** Keywords *** | 
 | 138 |  | 
 | 139 | Test Setup Execution | 
 | 140 |     [Documentation]  Test setup execution. | 
 | 141 |  | 
| George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 142 |     Redfish.Login | 
| Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 143 |  | 
 | 144 |     @{network_configurations}=  Get Network Configuration | 
 | 145 |     Set Test Variable  @{network_configurations} | 
 | 146 |  | 
 | 147 |     # Get BMC IP address and prefix length. | 
 | 148 |     ${ip_data}=  Get BMC IP Info | 
 | 149 |     Set Test Variable  ${ip_data} | 
 | 150 |  | 
| Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 151 |  | 
| Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 152 | Get Network Configuration | 
 | 153 |     [Documentation]  Get network configuration. | 
 | 154 |  | 
 | 155 |     # Sample output: | 
 | 156 |     #{ | 
 | 157 |     #  "@odata.context": "/redfish/v1/$metadata#EthernetInterface.EthernetInterface", | 
 | 158 |     #  "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth0", | 
 | 159 |     #  "@odata.type": "#EthernetInterface.v1_2_0.EthernetInterface", | 
 | 160 |     #  "Description": "Management Network Interface", | 
 | 161 |     #  "IPv4Addresses": [ | 
 | 162 |     #    { | 
 | 163 |     #      "Address": "169.254.xx.xx", | 
 | 164 |     #      "AddressOrigin": "IPv4LinkLocal", | 
 | 165 |     #      "Gateway": "0.0.0.0", | 
 | 166 |     #      "SubnetMask": "255.255.0.0" | 
 | 167 |     #    }, | 
 | 168 |     #    { | 
 | 169 |     #      "Address": "xx.xx.xx.xx", | 
 | 170 |     #      "AddressOrigin": "Static", | 
 | 171 |     #      "Gateway": "xx.xx.xx.1", | 
 | 172 |     #      "SubnetMask": "xx.xx.xx.xx" | 
 | 173 |     #    } | 
 | 174 |     #  ], | 
 | 175 |     #  "Id": "eth0", | 
 | 176 |     #  "MACAddress": "xx:xx:xx:xx:xx:xx", | 
 | 177 |     #  "Name": "Manager Ethernet Interface", | 
 | 178 |     #  "SpeedMbps": 0, | 
 | 179 |     #  "VLAN": { | 
 | 180 |     #    "VLANEnable": false, | 
 | 181 |     #    "VLANId": 0 | 
 | 182 |     #  } | 
 | 183 |  | 
| George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 184 |     ${resp}=  Redfish.Get  ${REDFISH_NW_ETH0_URI} | 
| Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 185 |     @{network_configurations}=  Get From Dictionary  ${resp.dict}  IPv4Addresses | 
 | 186 |     [Return]  @{network_configurations} | 
 | 187 |  | 
| George Keishing | 5d46755 | 2019-02-08 23:30:48 -0600 | [diff] [blame] | 188 |  | 
| Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 189 | Verify IP On BMC | 
 | 190 |     [Documentation]  Verify IP on BMC. | 
| Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 191 |     [Arguments]  ${ip} | 
 | 192 |  | 
| Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 193 |     # Description of argument(s): | 
 | 194 |     # ip  IP address to be verified (e.g. "10.7.7.7"). | 
| Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 195 |  | 
 | 196 |     # Get IP address details on BMC using IP command. | 
 | 197 |     @{ip_data}=  Get BMC IP Info | 
 | 198 |     Should Contain Match  ${ip_data}  ${ip}/* | 
 | 199 |     ...  msg=IP address does not exist. | 
 | 200 |  | 
| Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 201 | Add IP Address | 
 | 202 |     [Documentation]  Add IP Address To BMC. | 
 | 203 |     [Arguments]  ${ip}  ${subnet_mask}  ${gateway} | 
 | 204 |     ...  ${valid_status_codes}=${HTTP_OK} | 
 | 205 |  | 
 | 206 |     # Description of argument(s): | 
 | 207 |     # ip                  IP address to be added (e.g. "10.7.7.7"). | 
 | 208 |     # subnet_mask         Subnet mask for the IP to be added | 
 | 209 |     #                     (e.g. "255.255.0.0"). | 
 | 210 |     # gateway             Gateway for the IP to be added (e.g. "10.7.7.1"). | 
 | 211 |     # valid_status_codes  Expected return code from patch operation | 
 | 212 |     #                     (e.g. "200").  See prolog of rest_request | 
 | 213 |     #                     method in redfish_plut.py for details. | 
 | 214 |  | 
 | 215 |     ${empty_dict}=  Create Dictionary | 
 | 216 |     ${ip_data}=  Create Dictionary  Address=${ip} | 
 | 217 |     ...  AddressOrigin=Static  SubnetMask=${subnet_mask} | 
 | 218 |     ...  Gateway=${gateway} | 
 | 219 |  | 
 | 220 |     ${patch_list}=  Create List | 
 | 221 |     ${network_configurations}=  Get Network Configuration | 
 | 222 |     ${num_entries}=  Get Length  ${network_configurations} | 
 | 223 |  | 
 | 224 |     : FOR  ${INDEX}  IN RANGE  0  ${num_entries} | 
 | 225 |     \  Append To List  ${patch_list}  ${empty_dict} | 
 | 226 |  | 
| George Keishing | 98ffa86 | 2019-05-23 10:07:45 -0500 | [diff] [blame] | 227 |     # We need not check for existence of IP on BMC while adding. | 
| Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 228 |     Append To List  ${patch_list}  ${ip_data} | 
 | 229 |     ${data}=  Create Dictionary  IPv4Addresses=${patch_list} | 
 | 230 |  | 
 | 231 |     Redfish.patch  ${REDFISH_NW_ETH0_URI}  body=&{data} | 
 | 232 |     ...  valid_status_codes=[${valid_status_codes}] | 
 | 233 |  | 
 | 234 |     Return From Keyword If  '${valid_status_codes}' != '${HTTP_OK}' | 
 | 235 |  | 
 | 236 |     # Note: Network restart takes around 15-18s after patch request processing. | 
 | 237 |     Sleep  ${NETWORK_TIMEOUT}s | 
 | 238 |     Wait For Host To Ping  ${OPENBMC_HOST}  ${NETWORK_TIMEOUT} | 
 | 239 |  | 
 | 240 |     Verify IP On BMC  ${ip} | 
 | 241 |     Validate Network Config On BMC | 
 | 242 |  | 
 | 243 |  | 
 | 244 | Delete IP Address | 
 | 245 |     [Documentation]  Delete IP Address Of BMC. | 
 | 246 |     [Arguments]  ${ip}  ${valid_status_codes}=${HTTP_OK} | 
 | 247 |  | 
 | 248 |     # Description of argument(s): | 
 | 249 |     # ip                  IP address to be deleted (e.g. "10.7.7.7"). | 
 | 250 |     # valid_status_codes  Expected return code from patch operation | 
 | 251 |     #                     (e.g. "200").  See prolog of rest_request | 
 | 252 |     #                     method in redfish_plut.py for details. | 
 | 253 |  | 
 | 254 |     ${empty_dict}=  Create Dictionary | 
 | 255 |     ${patch_list}=  Create List | 
 | 256 |  | 
 | 257 |     @{network_configurations}=  Get Network Configuration | 
 | 258 |     : FOR  ${network_configuration}  IN  @{network_configurations} | 
 | 259 |     \  Run Keyword If  '${network_configuration['Address']}' == '${ip}' | 
 | 260 |        ...  Append To List  ${patch_list}  ${null} | 
 | 261 |        ...  ELSE  Append To List  ${patch_list}  ${empty_dict} | 
 | 262 |  | 
 | 263 |     ${ip_found}=  Run Keyword And Return Status  List Should Contain Value | 
 | 264 |     ...  ${patch_list}  ${null}  msg=${ip} does not exist on BMC | 
 | 265 |     Pass Execution If  ${ip_found} == ${False}  ${ip} does not exist on BMC | 
 | 266 |  | 
 | 267 |     # Run patch command only if given IP is found on BMC | 
 | 268 |     ${data}=  Create Dictionary  IPv4Addresses=${patch_list} | 
 | 269 |  | 
 | 270 |     Redfish.patch  ${REDFISH_NW_ETH0_URI}  body=&{data} | 
 | 271 |     ...  valid_status_codes=[${valid_status_codes}] | 
 | 272 |  | 
 | 273 |     # Note: Network restart takes around 15-18s after patch request processing | 
 | 274 |     Sleep  ${NETWORK_TIMEOUT}s | 
 | 275 |     Wait For Host To Ping  ${OPENBMC_HOST}  ${NETWORK_TIMEOUT} | 
 | 276 |  | 
 | 277 |     ${delete_status}=  Run Keyword And Return Status  Verify IP On BMC  ${ip} | 
 | 278 |     Run Keyword If  '${valid_status_codes}' == '${HTTP_OK}' | 
 | 279 |     ...  Should Be True  ${delete_status} == ${False} | 
 | 280 |     ...  ELSE  Should Be True  ${delete_status} == ${True} | 
 | 281 |  | 
 | 282 |     Validate Network Config On BMC | 
 | 283 |  | 
 | 284 |  | 
 | 285 | Validate Network Config On BMC | 
 | 286 |     [Documentation]  Check that network info obtained via redfish matches info | 
 | 287 |     ...              obtained via CLI. | 
 | 288 |  | 
 | 289 |     @{network_configurations}=  Get Network Configuration | 
 | 290 |     ${ip_data}=  Get BMC IP Info | 
 | 291 |     : FOR  ${network_configuration}  IN  @{network_configurations} | 
 | 292 |     \  Should Contain Match  ${ip_data}  ${network_configuration['Address']}/* | 
 | 293 |     ...  msg=IP address does not exist. | 
 | 294 |  | 
| George Keishing | 5d46755 | 2019-02-08 23:30:48 -0600 | [diff] [blame] | 295 |  | 
| Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 296 | Verify Netmask On BMC | 
 | 297 |     [Documentation]  Verify netmask on BMC. | 
| Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 298 |     [Arguments]  ${netmask} | 
 | 299 |  | 
 | 300 |     # Description of the argument(s): | 
 | 301 |     # netmask  netmask value to be verified. | 
 | 302 |  | 
| Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 303 |     ${prefix_length}=  Netmask Prefix Length  ${netmask} | 
 | 304 |  | 
 | 305 |     Should Contain Match  ${ip_data}  */${prefix_length} | 
 | 306 |     ...  msg=Prefix length does not exist. | 
| Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 307 |  | 
| Prashanth Katti | 2ec9d8b | 2019-02-12 05:20:19 -0600 | [diff] [blame] | 308 | Verify Gateway On BMC | 
 | 309 |     [Documentation]  Verify gateway on BMC. | 
 | 310 |     [Arguments]  ${gateway_ip}=0.0.0.0 | 
 | 311 |  | 
 | 312 |     # Description of argument(s): | 
 | 313 |     # gateway_ip  Gateway IP address. | 
 | 314 |  | 
 | 315 |     ${route_info}=  Get BMC Route Info | 
 | 316 |  | 
 | 317 |     # If gateway IP is empty or 0.0.0.0 it will not have route entry. | 
 | 318 |  | 
 | 319 |     Run Keyword If  '${gateway_ip}' == '0.0.0.0' | 
 | 320 |     ...      Pass Execution  Gateway IP is "0.0.0.0". | 
 | 321 |     ...  ELSE | 
 | 322 |     ...      Should Contain  ${route_info}  ${gateway_ip} | 
 | 323 |     ...      msg=Gateway IP address not matching. | 
| George Keishing | 5d46755 | 2019-02-08 23:30:48 -0600 | [diff] [blame] | 324 |  | 
| Prashanth Katti | 2c5c3bb | 2019-02-14 04:23:07 -0600 | [diff] [blame] | 325 | Verify IP And Netmask On BMC | 
 | 326 |     [Documentation]  Verify IP and netmask on BMC. | 
 | 327 |     [Arguments]  ${ip}  ${netmask} | 
 | 328 |  | 
 | 329 |     # Description of the argument(s): | 
 | 330 |     # ip       IP address to be verified. | 
 | 331 |     # netmask  netmask value to be verified. | 
 | 332 |  | 
 | 333 |     ${prefix_length}=  Netmask Prefix Length  ${netmask} | 
 | 334 |     @{ip_data}=  Get BMC IP Info | 
 | 335 |  | 
 | 336 |     ${ip_with_netmask}=  Catenate  ${ip}/${prefix_length} | 
 | 337 |     Should Contain  ${ip_data}  ${ip_with_netmask} | 
 | 338 |     ...  msg=IP and netmask pair does not exist. | 
 | 339 |  | 
| Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 340 | Configure Hostname | 
 | 341 |     [Documentation]  Configure hostname on BMC via Redfish. | 
 | 342 |     [Arguments]  ${hostname} | 
 | 343 |  | 
 | 344 |     # Description of argument(s): | 
 | 345 |     # hostname  A hostname value which is to be configured on BMC. | 
 | 346 |  | 
 | 347 |     ${data}=  Create Dictionary  HostName=${hostname} | 
 | 348 |     Redfish.patch  ${REDFISH_NW_PROTOCOL_URI}  body=&{data} | 
 | 349 |  | 
 | 350 | Validate Hostname On BMC | 
 | 351 |     [Documentation]  Verify that the hostname read via Redfish is the same as the | 
 | 352 |     ...  hostname configured on system. | 
 | 353 |     [Arguments]  ${hostname} | 
 | 354 |  | 
 | 355 |     # Description of argument(s): | 
 | 356 |     # hostname  A hostname value which is to be compared to the hostname | 
 | 357 |     #           configured on system. | 
 | 358 |  | 
 | 359 |     ${sys_hostname}=  Get BMC Hostname | 
| Prashanth Katti | 466d834 | 2019-03-21 08:58:50 -0500 | [diff] [blame] | 360 |     Should Be Equal  ${sys_hostname}  ${hostname} | 
| Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 361 |     ...  ignore_case=True  msg=Hostname does not exist. | 
 | 362 |  | 
| Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 363 | Test Teardown Execution | 
 | 364 |     [Documentation]  Test teardown execution. | 
 | 365 |  | 
 | 366 |     FFDC On Test Case Fail | 
| George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 367 |     Redfish.Logout |