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 |
Prashanth Katti | b478d90 | 2020-05-08 10:05:32 -0500 | [diff] [blame] | 13 | Suite Setup Suite Setup Execution |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 14 | |
Prashanth Katti | f34fafa | 2019-06-20 05:04:40 -0500 | [diff] [blame] | 15 | Force Tags Network_Conf_Test |
| 16 | |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 17 | *** Variables *** |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 18 | ${test_hostname} openbmc |
| 19 | ${test_ipv4_addr} 10.7.7.7 |
| 20 | ${test_ipv4_invalid_addr} 0.0.1.a |
| 21 | ${test_subnet_mask} 255.255.0.0 |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 22 | ${broadcast_ip} 10.7.7.255 |
| 23 | ${loopback_ip} 127.0.0.2 |
| 24 | ${multicast_ip} 224.6.6.6 |
| 25 | ${out_of_range_ip} 10.7.7.256 |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 26 | |
Prashanth Katti | 040c8c1 | 2019-05-31 04:42:05 -0500 | [diff] [blame] | 27 | # Valid netmask is 4 bytes long and has continuos block of 1s. |
| 28 | # Maximum valid value in each octet is 255 and least value is 0. |
| 29 | # 253 is not valid, as binary value is 11111101. |
| 30 | ${invalid_netmask} 255.255.253.0 |
| 31 | ${alpha_netmask} ff.ff.ff.ff |
| 32 | # Maximum value of octet in netmask is 255. |
| 33 | ${out_of_range_netmask} 255.256.255.0 |
| 34 | ${more_byte_netmask} 255.255.255.0.0 |
| 35 | ${less_byte_netmask} 255.255.255 |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 36 | ${threshold_netmask} 255.255.255.255 |
| 37 | ${lowest_netmask} 128.0.0.0 |
| 38 | |
| 39 | # There will be 4 octets in IP address (e.g. xx.xx.xx.xx) |
| 40 | # but trying to configure xx.xx.xx |
| 41 | ${less_octet_ip} 10.3.36 |
| 42 | |
| 43 | # For the address 10.6.6.6, the 10.6.6.0 portion describes the |
| 44 | # network ID and the 6 describe the host. |
| 45 | |
| 46 | ${network_id} 10.7.7.0 |
| 47 | ${hex_ip} 0xa.0xb.0xc.0xd |
| 48 | ${negative_ip} 10.-7.-7.7 |
| 49 | ${hex_ip} 0xa.0xb.0xc.0xd |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 50 | @{static_name_servers} 10.5.5.5 |
Prashanth Katti | 3c7b643 | 2019-07-26 06:53:37 -0500 | [diff] [blame] | 51 | @{null_value} null |
Prashanth Katti | afe16b7 | 2019-08-02 00:29:45 -0500 | [diff] [blame] | 52 | @{empty_dictionary} {} |
| 53 | @{string_value} aa.bb.cc.dd |
| 54 | |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 55 | *** Test Cases *** |
| 56 | |
| 57 | Get IP Address And Verify |
| 58 | [Documentation] Get IP Address And Verify. |
George Keishing | 5d46755 | 2019-02-08 23:30:48 -0600 | [diff] [blame] | 59 | [Tags] Get_IP_Address_And_Verify |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 60 | |
| 61 | : FOR ${network_configuration} IN @{network_configurations} |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 62 | \ Verify IP On BMC ${network_configuration['Address']} |
| 63 | |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 64 | Get Netmask And Verify |
| 65 | [Documentation] Get Netmask And Verify. |
George Keishing | 5d46755 | 2019-02-08 23:30:48 -0600 | [diff] [blame] | 66 | [Tags] Get_Netmask_And_Verify |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 67 | |
| 68 | : FOR ${network_configuration} IN @{network_configurations} |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 69 | \ Verify Netmask On BMC ${network_configuration['SubnetMask']} |
| 70 | |
Prashanth Katti | 2ec9d8b | 2019-02-12 05:20:19 -0600 | [diff] [blame] | 71 | Get Gateway And Verify |
| 72 | [Documentation] Get gateway and verify it's existence on the BMC. |
| 73 | [Tags] Get_Gateway_And_Verify |
| 74 | |
| 75 | : FOR ${network_configuration} IN @{network_configurations} |
| 76 | \ Verify Gateway On BMC ${network_configuration['Gateway']} |
| 77 | |
| 78 | Get MAC Address And Verify |
| 79 | [Documentation] Get MAC address and verify it's existence on the BMC. |
| 80 | [Tags] Get_MAC_Address_And_Verify |
| 81 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 82 | ${resp}= Redfish.Get ${REDFISH_NW_ETH0_URI} |
Prashanth Katti | 2ec9d8b | 2019-02-12 05:20:19 -0600 | [diff] [blame] | 83 | ${macaddr}= Get From Dictionary ${resp.dict} MACAddress |
| 84 | Validate MAC On BMC ${macaddr} |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 85 | |
Prashanth Katti | 2c5c3bb | 2019-02-14 04:23:07 -0600 | [diff] [blame] | 86 | Verify All Configured IP And Netmask |
| 87 | [Documentation] Verify all configured IP and netmask on BMC. |
| 88 | [Tags] Verify_All_Configured_IP_And_Netmask |
| 89 | |
| 90 | : FOR ${network_configuration} IN @{network_configurations} |
| 91 | \ Verify IP And Netmask On BMC ${network_configuration['Address']} |
| 92 | ... ${network_configuration['SubnetMask']} |
| 93 | |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 94 | Get Hostname And Verify |
| 95 | [Documentation] Get hostname via Redfish and verify. |
| 96 | [Tags] Get_Hostname_And_Verify |
| 97 | |
| 98 | ${hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName |
| 99 | |
| 100 | Validate Hostname On BMC ${hostname} |
| 101 | |
| 102 | Configure Hostname And Verify |
| 103 | [Documentation] Configure hostname via Redfish and verify. |
| 104 | [Tags] Configure_Hostname_And_Verify |
| 105 | |
Prashanth Katti | adf0b4e | 2019-06-10 04:20:30 -0500 | [diff] [blame] | 106 | ${hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 107 | |
Prashanth Katti | adf0b4e | 2019-06-10 04:20:30 -0500 | [diff] [blame] | 108 | Configure Hostname ${test_hostname} |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 109 | Validate Hostname On BMC ${test_hostname} |
| 110 | |
Prashanth Katti | adf0b4e | 2019-06-10 04:20:30 -0500 | [diff] [blame] | 111 | # Revert back to initial hostname. |
| 112 | Configure Hostname ${hostname} |
| 113 | Validate Hostname On BMC ${hostname} |
| 114 | |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 115 | Add Valid IPv4 Address And Verify |
| 116 | [Documentation] Add IPv4 Address via Redfish and verify. |
| 117 | [Tags] Add_Valid_IPv4_Addres_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 118 | [Teardown] Run Keywords |
| 119 | ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 120 | |
| 121 | Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway} |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 122 | |
| 123 | Add Invalid IPv4 Address And Verify |
| 124 | [Documentation] Add Invalid IPv4 Address via Redfish and verify. |
| 125 | [Tags] Add_Invalid_IPv4_Addres_And_Verify |
| 126 | |
| 127 | Add IP Address ${test_ipv4_invalid_addr} ${test_subnet_mask} |
| 128 | ... ${test_gateway} valid_status_codes=${HTTP_BAD_REQUEST} |
| 129 | |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 130 | Configure Out Of Range IP |
| 131 | [Documentation] Configure out-of-range IP address. |
| 132 | [Tags] Configure_Out_Of_Range_IP |
| 133 | [Template] Add IP Address |
| 134 | |
| 135 | # ip subnet_mask gateway valid_status_codes |
| 136 | ${out_of_range_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 137 | |
| 138 | Configure Broadcast IP |
| 139 | [Documentation] Configure broadcast IP address. |
| 140 | [Tags] Configure_Broadcast_IP |
| 141 | [Template] Add IP Address |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 142 | [Teardown] Clear IP Settings On Fail ${broadcast_ip} |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 143 | |
| 144 | # ip subnet_mask gateway valid_status_codes |
| 145 | ${broadcast_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 146 | |
| 147 | Configure Multicast IP |
| 148 | [Documentation] Configure multicast IP address. |
| 149 | [Tags] Configure_Multicast_IP |
| 150 | [Template] Add IP Address |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 151 | [Teardown] Clear IP Settings On Fail ${multicast_ip} |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 152 | |
| 153 | # ip subnet_mask gateway valid_status_codes |
| 154 | ${multicast_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 155 | |
| 156 | Configure Loopback IP |
| 157 | [Documentation] Configure loopback IP address. |
| 158 | [Tags] Configure_Loopback_IP |
| 159 | [Template] Add IP Address |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 160 | [Teardown] Clear IP Settings On Fail ${loopback_ip} |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 161 | |
| 162 | # ip subnet_mask gateway valid_status_codes |
| 163 | ${loopback_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 164 | |
| 165 | Add Valid IPv4 Address And Check Persistency |
| 166 | [Documentation] Add IPv4 address and check peristency. |
| 167 | [Tags] Add_Valid_IPv4_Addres_And_Check_Persistency |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 168 | [Teardown] Run Keywords |
| 169 | ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 170 | |
| 171 | Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway} |
| 172 | |
| 173 | # Reboot BMC and verify persistency. |
| 174 | OBMC Reboot (off) |
George Keishing | 5c49874 | 2019-08-09 02:14:44 -0500 | [diff] [blame] | 175 | Redfish.Login |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 176 | Verify IP On BMC ${test_ipv4_addr} |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 177 | |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 178 | Add Fourth Octet Threshold IP And Verify |
| 179 | [Documentation] Add fourth octet threshold IP and verify. |
| 180 | [Tags] Add_Fourth_Octet_Threshold_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 181 | [Teardown] Run Keywords |
| 182 | ... Delete IP Address 10.7.7.254 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 183 | |
| 184 | Add IP Address 10.7.7.254 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 185 | |
| 186 | Add Fourth Octet Lowest IP And Verify |
| 187 | [Documentation] Add fourth octet lowest IP and verify. |
| 188 | [Tags] Add_Fourth_Octet_Lowest_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 189 | [Teardown] Run Keywords |
| 190 | ... Delete IP Address 10.7.7.1 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 191 | |
| 192 | Add IP Address 10.7.7.1 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 193 | |
| 194 | Add Third Octet Threshold IP And Verify |
| 195 | [Documentation] Add third octet threshold IP and verify. |
| 196 | [Tags] Add_Third_Octet_Threshold_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 197 | [Teardown] Run Keywords |
| 198 | ... Delete IP Address 10.7.255.7 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 199 | |
| 200 | Add IP Address 10.7.255.7 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 201 | |
| 202 | Add Third Octet Lowest IP And Verify |
| 203 | [Documentation] Add third octet lowest IP and verify. |
| 204 | [Tags] Add_Third_Octet_Lowest_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 205 | [Teardown] Run Keywords |
| 206 | ... Delete IP Address 10.7.0.7 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 207 | |
| 208 | Add IP Address 10.7.0.7 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 209 | |
| 210 | Add Second Octet Threshold IP And Verify |
| 211 | [Documentation] Add second octet threshold IP and verify. |
| 212 | [Tags] Add_Second_Octet_Threshold_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 213 | [Teardown] Run Keywords |
| 214 | ... Delete IP Address 10.255.7.7 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 215 | |
| 216 | Add IP Address 10.255.7.7 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 217 | |
| 218 | Add Second Octet Lowest IP And Verify |
| 219 | [Documentation] Add second octet lowest IP and verify. |
| 220 | [Tags] Add_Second_Octet_Lowest_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 221 | [Teardown] Run Keywords |
| 222 | ... Delete IP Address 10.0.7.7 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 223 | |
| 224 | Add IP Address 10.0.7.7 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 225 | |
| 226 | Add First Octet Threshold IP And Verify |
| 227 | [Documentation] Add first octet threshold IP and verify. |
| 228 | [Tags] Add_First_Octet_Threshold_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 229 | [Teardown] Run Keywords |
| 230 | ... Delete IP Address 233.7.7.7 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 231 | |
| 232 | Add IP Address 223.7.7.7 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 233 | |
| 234 | Add First Octet Lowest IP And Verify |
| 235 | [Documentation] Add first octet lowest IP and verify. |
| 236 | [Tags] Add_First_Octet_Lowest_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 237 | [Teardown] Run Keywords |
| 238 | ... Delete IP Address 1.7.7.7 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 239 | |
| 240 | Add IP Address 1.7.7.7 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 241 | |
Prashanth Katti | 040c8c1 | 2019-05-31 04:42:05 -0500 | [diff] [blame] | 242 | Configure Invalid Netmask |
| 243 | [Documentation] Verify error while setting invalid netmask. |
| 244 | [Tags] Configure_Invalid_Netmask |
| 245 | [Template] Add IP Address |
| 246 | |
| 247 | # ip subnet_mask gateway valid_status_codes |
| 248 | ${test_ipv4_addr} ${invalid_netmask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 249 | |
| 250 | Configure Out Of Range Netmask |
| 251 | [Documentation] Verify error while setting out of range netmask. |
| 252 | [Tags] Configure_Out_Of_Range_Netmask |
| 253 | [Template] Add IP Address |
| 254 | |
| 255 | # ip subnet_mask gateway valid_status_codes |
| 256 | ${test_ipv4_addr} ${out_of_range_netmask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 257 | |
| 258 | Configure Alpha Netmask |
| 259 | [Documentation] Verify error while setting alpha netmask. |
| 260 | [Tags] Configure_Alpha_Netmask |
| 261 | [Template] Add IP Address |
| 262 | |
| 263 | # ip subnet_mask gateway valid_status_codes |
| 264 | ${test_ipv4_addr} ${alpha_netmask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 265 | |
| 266 | Configure More Byte Netmask |
| 267 | [Documentation] Verify error while setting more byte netmask. |
| 268 | [Tags] Configure_More_Byte_Netmask |
| 269 | [Template] Add IP Address |
| 270 | |
| 271 | # ip subnet_mask gateway valid_status_codes |
| 272 | ${test_ipv4_addr} ${more_byte_netmask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 273 | |
| 274 | Configure Less Byte Netmask |
| 275 | [Documentation] Verify error while setting less byte netmask. |
| 276 | [Tags] Configure_Less_Byte_Netmask |
| 277 | [Template] Add IP Address |
| 278 | |
| 279 | # ip subnet_mask gateway valid_status_codes |
| 280 | ${test_ipv4_addr} ${less_byte_netmask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 281 | |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 282 | Configure Threshold Netmask And Verify |
| 283 | [Documentation] Configure threshold netmask and verify. |
| 284 | [Tags] Configure_Threshold_Netmask_And_verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 285 | [Teardown] Run Keywords |
| 286 | ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 287 | |
| 288 | Add IP Address ${test_ipv4_addr} ${threshold_netmask} ${test_gateway} |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 289 | |
| 290 | Configure Lowest Netmask And Verify |
| 291 | [Documentation] Configure lowest netmask and verify. |
| 292 | [Tags] Configure_Lowest_Netmask_And_verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 293 | [Teardown] Run Keywords |
| 294 | ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 295 | |
| 296 | Add IP Address ${test_ipv4_addr} ${lowest_netmask} ${test_gateway} |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 297 | |
| 298 | Configure Network ID |
| 299 | [Documentation] Verify error while configuring network ID. |
| 300 | [Tags] Configure_Network_ID |
| 301 | [Template] Add IP Address |
| 302 | [Teardown] Clear IP Settings On Fail ${network_id} |
| 303 | |
| 304 | # ip subnet_mask gateway valid_status_codes |
| 305 | ${network_id} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 306 | |
| 307 | Configure Less Octet IP |
| 308 | [Documentation] Verify error while Configuring less octet IP address. |
| 309 | [Tags] Configure_Less_Octet_IP |
| 310 | [Template] Add IP Address |
| 311 | |
| 312 | # ip subnet_mask gateway valid_status_codes |
| 313 | ${less_octet_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 314 | |
| 315 | Configure Empty IP |
| 316 | [Documentation] Verify error while Configuring empty IP address. |
| 317 | [Tags] Configure_Empty_IP |
| 318 | [Template] Add IP Address |
| 319 | |
| 320 | # ip subnet_mask gateway valid_status_codes |
| 321 | ${EMPTY} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 322 | |
| 323 | Configure Special Char IP |
| 324 | [Documentation] Configure invalid IP address containing special chars. |
| 325 | [Tags] Configure_Special_Char_IP |
| 326 | [Template] Add IP Address |
| 327 | |
| 328 | # ip subnet_mask gateway valid_status_codes |
| 329 | @@@.%%.44.11 ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 330 | |
| 331 | Configure Hexadecimal IP |
| 332 | [Documentation] Configure invalid IP address containing hex value. |
| 333 | [Tags] Configure_Hexadecimal_IP |
| 334 | [Template] Add IP Address |
| 335 | |
| 336 | # ip subnet_mask gateway valid_status_codes |
| 337 | ${hex_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 338 | |
| 339 | Configure Negative Octet IP |
| 340 | [Documentation] Configure invalid IP address containing negative octet. |
| 341 | [Tags] Configure_Negative_Octet_IP |
| 342 | [Template] Add IP Address |
| 343 | |
| 344 | # ip subnet_mask gateway valid_status_codes |
| 345 | ${negative_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 346 | |
Prashanth Katti | 5cad5a0 | 2019-06-20 07:27:10 -0500 | [diff] [blame] | 347 | Configure Incomplete IP For Gateway |
| 348 | [Documentation] Configure incomplete IP for gateway and expect an error. |
| 349 | [Tags] Configure_Incomplete_IP_For_Gateway |
| 350 | [Template] Add IP Address |
| 351 | |
| 352 | # ip subnet_mask gateway valid_status_codes |
| 353 | ${test_ipv4_addr} ${test_subnet_mask} ${less_octet_ip} ${HTTP_BAD_REQUEST} |
| 354 | |
| 355 | Configure Special Char IP For Gateway |
| 356 | [Documentation] Configure special char IP for gateway and expect an error. |
| 357 | [Tags] Configure_Special_Char_IP_For_Gateway |
| 358 | [Template] Add IP Address |
| 359 | |
| 360 | # ip subnet_mask gateway valid_status_codes |
| 361 | ${test_ipv4_addr} ${test_subnet_mask} @@@.%%.44.11 ${HTTP_BAD_REQUEST} |
| 362 | |
| 363 | Configure Hexadecimal IP For Gateway |
| 364 | [Documentation] Configure hexadecimal IP for gateway and expect an error. |
| 365 | [Tags] Configure_Hexadecimal_IP_For_Gateway |
| 366 | [Template] Add IP Address |
| 367 | |
| 368 | # ip subnet_mask gateway valid_status_codes |
| 369 | ${test_ipv4_addr} ${test_subnet_mask} ${hex_ip} ${HTTP_BAD_REQUEST} |
| 370 | |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 371 | Get DNS Server And Verify |
| 372 | [Documentation] Get DNS server via Redfish and verify. |
| 373 | [Tags] Get_DNS_Server_And_Verify |
| 374 | |
| 375 | Verify CLI and Redfish Nameservers |
| 376 | |
| 377 | Configure DNS Server And Verify |
| 378 | [Documentation] Configure DNS server and verify. |
| 379 | [Tags] Configure_DNS_Server_And_Verify |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 380 | [Setup] DNS Test Setup Execution |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 381 | [Teardown] Run Keywords |
| 382 | ... Configure Static Name Servers AND Test Teardown Execution |
| 383 | |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 384 | Configure Static Name Servers ${static_name_servers} |
| 385 | Verify CLI and Redfish Nameservers |
| 386 | |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 387 | Delete DNS Server And Verify |
| 388 | [Documentation] Delete DNS server and verify. |
| 389 | [Tags] Delete_DNS_Server_And_Verify |
| 390 | [Setup] DNS Test Setup Execution |
| 391 | [Teardown] Run Keywords |
| 392 | ... Configure Static Name Servers AND Test Teardown Execution |
| 393 | |
| 394 | Delete Static Name Servers |
| 395 | Verify CLI and Redfish Nameservers |
| 396 | |
| 397 | Configure DNS Server And Check Persistency |
| 398 | [Documentation] Configure DNS server and check persistency on reboot. |
| 399 | [Tags] Configure_DNS_Server_And_Check_Persistency |
| 400 | [Setup] DNS Test Setup Execution |
| 401 | [Teardown] Run Keywords |
| 402 | ... Configure Static Name Servers AND Test Teardown Execution |
| 403 | |
| 404 | Configure Static Name Servers ${static_name_servers} |
| 405 | # Reboot BMC and verify persistency. |
| 406 | OBMC Reboot (off) |
| 407 | Verify CLI and Redfish Nameservers |
| 408 | |
Prashanth Katti | 3063ffe | 2019-07-25 04:35:25 -0500 | [diff] [blame] | 409 | Configure Loopback IP For Gateway |
| 410 | [Documentation] Configure loopback IP for gateway and expect an error. |
| 411 | [Tags] Configure_Loopback_IP_For_Gateway |
| 412 | [Template] Add IP Address |
| 413 | [Teardown] Clear IP Settings On Fail ${test_ipv4_addr} |
| 414 | |
| 415 | # ip subnet_mask gateway valid_status_codes |
| 416 | ${test_ipv4_addr} ${test_subnet_mask} ${loopback_ip} ${HTTP_BAD_REQUEST} |
| 417 | |
| 418 | Configure Network ID For Gateway |
| 419 | [Documentation] Configure network ID for gateway and expect an error. |
| 420 | [Tags] Configure_Network_ID_For_Gateway |
| 421 | [Template] Add IP Address |
| 422 | [Teardown] Clear IP Settings On Fail ${test_ipv4_addr} |
| 423 | |
| 424 | # ip subnet_mask gateway valid_status_codes |
| 425 | ${test_ipv4_addr} ${test_subnet_mask} ${network_id} ${HTTP_BAD_REQUEST} |
| 426 | |
| 427 | Configure Multicast IP For Gateway |
| 428 | [Documentation] Configure multicast IP for gateway and expect an error. |
| 429 | [Tags] Configure_Multicast_IP_For_Gateway |
| 430 | [Template] Add IP Address |
| 431 | [Teardown] Clear IP Settings On Fail ${test_ipv4_addr} |
| 432 | |
| 433 | # ip subnet_mask gateway valid_status_codes |
| 434 | ${test_ipv4_addr} ${test_subnet_mask} ${multicaste_ip} ${HTTP_BAD_REQUEST} |
| 435 | |
| 436 | Configure Broadcast IP For Gateway |
| 437 | [Documentation] Configure broadcast IP for gateway and expect an error. |
| 438 | [Tags] Configure_Broadcast_IP_For_Gateway |
| 439 | [Template] Add IP Address |
| 440 | [Teardown] Clear IP Settings On Fail ${test_ipv4_addr} |
| 441 | |
| 442 | # ip subnet_mask gateway valid_status_codes |
| 443 | ${test_ipv4_addr} ${test_subnet_mask} ${broadcast_ip} ${HTTP_BAD_REQUEST} |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 444 | |
Prashanth Katti | 3c7b643 | 2019-07-26 06:53:37 -0500 | [diff] [blame] | 445 | Configure Null Value For DNS Server |
| 446 | [Documentation] Configure null value for DNS server and expect an error. |
| 447 | [Tags] Configure_Null_Value_For_DNS_Server |
| 448 | [Setup] DNS Test Setup Execution |
| 449 | [Teardown] Run Keywords |
| 450 | ... Configure Static Name Servers AND Test Teardown Execution |
| 451 | |
| 452 | Configure Static Name Servers ${null_value} ${HTTP_BAD_REQUEST} |
| 453 | |
Prashanth Katti | afe16b7 | 2019-08-02 00:29:45 -0500 | [diff] [blame] | 454 | Configure Empty Value For DNS Server |
| 455 | [Documentation] Configure empty value for DNS server and expect an error. |
| 456 | [Tags] Configure_Empty_Value_For_DNS_Server |
| 457 | [Setup] DNS Test Setup Execution |
| 458 | [Teardown] Run Keywords |
| 459 | ... Configure Static Name Servers AND Test Teardown Execution |
| 460 | |
| 461 | Configure Static Name Servers ${empty_dictionary} ${HTTP_BAD_REQUEST} |
| 462 | |
| 463 | Configure String Value For DNS Server |
| 464 | [Documentation] Configure string value for DNS server and expect an error. |
| 465 | [Tags] Configure_String_Value_For_DNS_Server |
| 466 | [Setup] DNS Test Setup Execution |
| 467 | [Teardown] Run Keywords |
| 468 | ... Configure Static Name Servers AND Test Teardown Execution |
| 469 | |
| 470 | Configure Static Name Servers ${string_value} ${HTTP_BAD_REQUEST} |
| 471 | |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 472 | |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 473 | *** Keywords *** |
| 474 | |
| 475 | Test Setup Execution |
| 476 | [Documentation] Test setup execution. |
| 477 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 478 | Redfish.Login |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 479 | |
| 480 | @{network_configurations}= Get Network Configuration |
| 481 | Set Test Variable @{network_configurations} |
| 482 | |
| 483 | # Get BMC IP address and prefix length. |
| 484 | ${ip_data}= Get BMC IP Info |
| 485 | Set Test Variable ${ip_data} |
| 486 | |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 487 | |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 488 | Verify Netmask On BMC |
| 489 | [Documentation] Verify netmask on BMC. |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 490 | [Arguments] ${netmask} |
| 491 | |
| 492 | # Description of the argument(s): |
| 493 | # netmask netmask value to be verified. |
| 494 | |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 495 | ${prefix_length}= Netmask Prefix Length ${netmask} |
| 496 | |
| 497 | Should Contain Match ${ip_data} */${prefix_length} |
| 498 | ... msg=Prefix length does not exist. |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 499 | |
Prashanth Katti | 2c5c3bb | 2019-02-14 04:23:07 -0600 | [diff] [blame] | 500 | Verify IP And Netmask On BMC |
| 501 | [Documentation] Verify IP and netmask on BMC. |
| 502 | [Arguments] ${ip} ${netmask} |
| 503 | |
| 504 | # Description of the argument(s): |
| 505 | # ip IP address to be verified. |
| 506 | # netmask netmask value to be verified. |
| 507 | |
| 508 | ${prefix_length}= Netmask Prefix Length ${netmask} |
| 509 | @{ip_data}= Get BMC IP Info |
| 510 | |
| 511 | ${ip_with_netmask}= Catenate ${ip}/${prefix_length} |
| 512 | Should Contain ${ip_data} ${ip_with_netmask} |
| 513 | ... msg=IP and netmask pair does not exist. |
| 514 | |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 515 | Validate Hostname On BMC |
| 516 | [Documentation] Verify that the hostname read via Redfish is the same as the |
| 517 | ... hostname configured on system. |
| 518 | [Arguments] ${hostname} |
| 519 | |
| 520 | # Description of argument(s): |
| 521 | # hostname A hostname value which is to be compared to the hostname |
| 522 | # configured on system. |
| 523 | |
| 524 | ${sys_hostname}= Get BMC Hostname |
Prashanth Katti | 466d834 | 2019-03-21 08:58:50 -0500 | [diff] [blame] | 525 | Should Be Equal ${sys_hostname} ${hostname} |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 526 | ... ignore_case=True msg=Hostname does not exist. |
| 527 | |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 528 | Test Teardown Execution |
| 529 | [Documentation] Test teardown execution. |
| 530 | |
| 531 | FFDC On Test Case Fail |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 532 | Redfish.Logout |
Prashanth Katti | a844251 | 2019-06-07 06:47:09 -0500 | [diff] [blame] | 533 | |
| 534 | Clear IP Settings On Fail |
| 535 | [Documentation] Clear IP settings on fail. |
| 536 | [Arguments] ${ip} |
| 537 | |
| 538 | # Description of argument(s): |
| 539 | # ip IP address to be deleted. |
| 540 | |
| 541 | Run Keyword If '${TEST STATUS}' == 'FAIL' |
| 542 | ... Delete IP Address ${ip} |
| 543 | |
| 544 | Test Teardown Execution |
Prashanth Katti | adf0b4e | 2019-06-10 04:20:30 -0500 | [diff] [blame] | 545 | |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 546 | Verify CLI and Redfish Nameservers |
| 547 | [Documentation] Verify that nameservers obtained via Redfish do not |
| 548 | ... match those found in /etc/resolv.conf. |
| 549 | |
| 550 | ${redfish_nameservers}= Redfish.Get Attribute ${REDFISH_NW_ETH0_URI} StaticNameServers |
| 551 | ${resolve_conf_nameservers}= CLI Get Nameservers |
Michael Walsh | 39c0051 | 2019-07-17 10:54:06 -0500 | [diff] [blame] | 552 | Rqprint Vars redfish_nameservers resolve_conf_nameservers |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 553 | |
| 554 | # Check that the 2 lists are equivalent. |
| 555 | ${match}= Evaluate set($redfish_nameservers) == set($resolve_conf_nameservers) |
| 556 | Should Be True ${match} |
| 557 | ... The nameservers obtained via Redfish do not match those found in /etc/resolv.conf. |
| 558 | |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 559 | |
| 560 | Configure Static Name Servers |
| 561 | [Documentation] Configure DNS server on BMC. |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 562 | [Arguments] ${static_name_servers}=${original_nameservers} |
Prashanth Katti | 3c7b643 | 2019-07-26 06:53:37 -0500 | [diff] [blame] | 563 | ... ${valid_status_codes}=${HTTP_OK} |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 564 | |
George Keishing | 9cb2e59 | 2019-07-12 09:37:33 -0500 | [diff] [blame] | 565 | # Description of the argument(s): |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 566 | # static_name_servers A list of static name server IPs to be |
| 567 | # configured on the BMC. |
| 568 | |
Prashanth Katti | 9d995fc | 2019-09-24 01:29:06 -0500 | [diff] [blame] | 569 | # Currently BMC is sending 500 response code instead of 400 for invalid scenarios. |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 570 | Redfish.Patch ${REDFISH_NW_ETH0_URI} body={'StaticNameServers': ${static_name_servers}} |
Prashanth Katti | 9d995fc | 2019-09-24 01:29:06 -0500 | [diff] [blame] | 571 | ... valid_status_codes=[${valid_status_codes}, ${HTTP_INTERNAL_SERVER_ERROR}] |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 572 | |
Prashanth Katti | f247be3 | 2019-10-07 04:40:43 -0500 | [diff] [blame] | 573 | # Patch operation takes 1 to 3 seconds to set new value. |
| 574 | Sleep 3s |
| 575 | |
Prashanth Katti | 7f9e60f | 2019-07-26 01:18:41 -0500 | [diff] [blame] | 576 | # Check if newly added DNS server is configured on BMC. |
| 577 | ${cli_nameservers}= CLI Get Nameservers |
Prashanth Katti | 3c7b643 | 2019-07-26 06:53:37 -0500 | [diff] [blame] | 578 | ${cmd_status}= Run Keyword And Return Status |
| 579 | ... List Should Contain Sub List ${cli_nameservers} ${static_name_servers} |
| 580 | |
| 581 | Run Keyword If '${valid_status_codes}' == '${HTTP_OK}' |
| 582 | ... Should Be True ${cmd_status} == ${True} |
| 583 | ... ELSE Should Be True ${cmd_status} == ${False} |
Prashanth Katti | 7f9e60f | 2019-07-26 01:18:41 -0500 | [diff] [blame] | 584 | |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 585 | Delete Static Name Servers |
| 586 | [Documentation] Delete static name servers. |
| 587 | |
| 588 | Configure Static Name Servers @{EMPTY} |
| 589 | |
| 590 | # Check if all name servers deleted on BMC. |
| 591 | ${nameservers}= CLI Get Nameservers |
| 592 | Should Be Empty ${nameservers} |
| 593 | |
| 594 | DNS Test Setup Execution |
| 595 | [Documentation] Do DNS test setup execution. |
| 596 | |
| 597 | Redfish.Login |
| 598 | |
| 599 | ${original_nameservers}= Redfish.Get Attribute ${REDFISH_NW_ETH0_URI} StaticNameServers |
| 600 | Rprint Vars original_nameservers |
| 601 | # Set suite variables to trigger restoration during teardown. |
| 602 | Set Suite Variable ${original_nameservers} |
Prashanth Katti | b478d90 | 2020-05-08 10:05:32 -0500 | [diff] [blame] | 603 | |
| 604 | Suite Setup Execution |
| 605 | [Documentation] Do suite setup execution. |
| 606 | |
| 607 | ${test_gateway}= Get BMC Default Gateway |
| 608 | Set Suite Variable ${test_gateway} |