Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 1 | *** Settings *** |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 2 | Documentation Network interface and functionalities test module on BMC. |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 3 | |
manasarm | 88f0006 | 2018-03-07 12:07:33 +0530 | [diff] [blame] | 4 | Resource ../lib/ipmi_client.robot |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 5 | Resource ../lib/rest_client.robot |
| 6 | Resource ../lib/utils.robot |
| 7 | Resource ../lib/bmc_network_utils.robot |
George Keishing | bf58f01 | 2018-04-12 00:21:08 -0500 | [diff] [blame] | 8 | Resource ../lib/openbmc_ffdc.robot |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 9 | |
| 10 | Force Tags Network_Test |
| 11 | |
| 12 | Library String |
| 13 | Library SSHLibrary |
| 14 | |
Steven Sombar | fac31e9 | 2017-12-15 09:40:34 -0600 | [diff] [blame] | 15 | Test Setup Test Setup Execution |
George Keishing | bf58f01 | 2018-04-12 00:21:08 -0500 | [diff] [blame] | 16 | Test Teardown Test Teardown Execution |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 17 | |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 18 | *** Variables *** |
| 19 | |
| 20 | ${alpha_ip} xx.xx.xx.xx |
| 21 | |
| 22 | # 10.x.x.x series is a private IP address range and does not exist in |
| 23 | # our network, so this is chosen to avoid IP conflict. |
| 24 | |
| 25 | ${valid_ip} 10.6.6.6 |
manasarm | 88f0006 | 2018-03-07 12:07:33 +0530 | [diff] [blame] | 26 | ${valid_ip2} 10.6.6.7 |
| 27 | @{valid_ips} ${valid_ip} ${valid_ip2} |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 28 | ${valid_gateway} 10.6.6.1 |
Prashanth Katti | 90f9ff2 | 2017-08-11 06:17:12 -0500 | [diff] [blame] | 29 | ${valid_prefix_len} ${24} |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 30 | ${broadcast_ip} 10.6.6.255 |
| 31 | ${loopback_ip} 127.0.0.1 |
| 32 | ${multicast_ip} 224.6.6.255 |
| 33 | ${out_of_range_ip} 10.6.6.256 |
| 34 | |
| 35 | # There will be 4 octets in IP address (e.g. xx.xx.xx.xx) |
| 36 | # but trying to configure xx.xx.xx |
| 37 | |
| 38 | ${less_octet_ip} 10.3.36 |
| 39 | |
| 40 | # For the address 10.6.6.6, the 10.6.6.0 portion describes the |
| 41 | # network ID and the 6 describe the host. |
| 42 | |
| 43 | ${network_id} 10.6.6.0 |
| 44 | ${hex_ip} 0xa.0xb.0xc.0xd |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 45 | ${negative_ip} 10.-6.-6.6 |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 46 | |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 47 | *** Test Cases *** |
| 48 | |
| 49 | Get BMC IPv4 Address And Verify |
| 50 | [Documentation] Get BMC IPv4 address and verify. |
| 51 | [Tags] Get_BMC_IPv4_Address_And_Verify |
| 52 | |
| 53 | :FOR ${ipv4_uri} IN @{IPv4_URI_List} |
| 54 | \ ${ipv4_addr}= Read Attribute ${ipv4_uri} Address |
| 55 | \ Validate IP on BMC ${ipv4_addr} |
| 56 | |
| 57 | Verify IPv4 Prefix Length |
| 58 | [Documentation] Get prefix length and verify. |
| 59 | [Tags] Verify_IPv4_Prefix_Length |
| 60 | |
| 61 | :FOR ${ipv4_uri} IN @{IPv4_URI_List} |
| 62 | \ ${prefix_length}= Read Attribute ${ipv4_uri} PrefixLength |
| 63 | \ Validate Prefix Length On BMC ${prefix_length} |
| 64 | |
| 65 | Verify Gateway Address |
| 66 | [Documentation] Get gateway address and verify. |
| 67 | [Tags] Verify_Gateway_Address |
| 68 | |
| 69 | :FOR ${ipv4_uri} IN @{IPv4_URI_List} |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 70 | \ ${gateway_ip}= Read Attribute ${ipv4_uri} Gateway |
| 71 | \ Validate Route On BMC ${gateway_ip} |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 72 | |
| 73 | Verify MAC Address |
| 74 | [Documentation] Get MAC address and verify. |
| 75 | [Tags] Verify_MAC_Address |
manasarm | 104cc6b | 2018-02-07 12:35:05 +0530 | [diff] [blame] | 76 | ${macaddr}= Read Attribute ${NETWORK_MANAGER}/eth0 MACAddress |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 77 | Validate MAC On BMC ${macaddr} |
| 78 | |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 79 | Add New Valid IP And Verify |
| 80 | [Documentation] Add new IP address and verify. |
| 81 | [Tags] Add_New_Valid_IP_And_Verify |
| 82 | |
| 83 | Configure Network Settings ${valid_ip} ${valid_prefix_len} |
| 84 | ... ${valid_gateway} valid |
| 85 | |
Prashanth Katti | 90f9ff2 | 2017-08-11 06:17:12 -0500 | [diff] [blame] | 86 | # Verify whether new IP object is created for the given IP via REST. |
| 87 | # Delete IP address and IP object after verification. |
| 88 | Verify IP Address Via REST And Delete ${valid_ip} |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 89 | |
| 90 | Configure Invalid IP String |
| 91 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 92 | ${alpha_ip} ${valid_prefix_len} ${valid_gateway} error |
| 93 | |
| 94 | [Documentation] Configure invalid IP address which is a string. |
| 95 | [Tags] Configure_Invalid_IP_String |
| 96 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 97 | [Template] Configure Network Settings |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 98 | |
| 99 | Configure Out Of Range IP |
| 100 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 101 | ${out_of_range_ip} ${valid_prefix_len} ${valid_gateway} error |
| 102 | |
Prashanth Katti | 388bdc7 | 2017-07-19 08:54:58 -0500 | [diff] [blame] | 103 | [Documentation] Configure out-of-range IP address. |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 104 | [Tags] Configure_Out_Of_Range_IP |
| 105 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 106 | [Template] Configure Network Settings |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 107 | |
| 108 | Configure Broadcast IP |
| 109 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 110 | ${broadcast_ip} ${valid_prefix_len} ${valid_gateway} error |
| 111 | |
| 112 | [Documentation] Configure broadcast IP address. |
| 113 | [Tags] Configure_Broadcast_IP |
| 114 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 115 | [Template] Configure Network Settings |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 116 | |
| 117 | Configure Multicast IP |
| 118 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 119 | ${multicast_ip} ${valid_prefix_len} ${valid_gateway} error |
| 120 | |
| 121 | [Documentation] Configure multicast IP address. |
| 122 | [Tags] Configure_Multicast_IP |
| 123 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 124 | [Template] Configure Network Settings |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 125 | |
| 126 | Configure Loopback IP |
| 127 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 128 | ${loopback_ip} ${valid_prefix_len} ${valid_gateway} error |
| 129 | |
| 130 | [Documentation] Configure loopback IP address. |
| 131 | [Tags] Configure_Loopback_IP |
| 132 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 133 | [Template] Configure Network Settings |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 134 | |
| 135 | Configure Network ID |
| 136 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 137 | ${network_id} ${valid_prefix_len} ${valid_gateway} error |
| 138 | |
| 139 | [Documentation] Configure network ID IP address. |
| 140 | [Tags] Configure_Network_ID |
| 141 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 142 | [Template] Configure Network Settings |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 143 | |
| 144 | Configure Less Octet IP |
| 145 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 146 | ${less_octet_ip} ${valid_prefix_len} ${valid_gateway} error |
| 147 | |
| 148 | [Documentation] Configure less octet IP address. |
| 149 | [Tags] Configure_Less_Octet_IP |
| 150 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 151 | [Template] Configure Network Settings |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 152 | |
| 153 | Configure Empty IP |
| 154 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 155 | ${EMPTY} ${valid_prefix_len} ${valid_gateway} error |
| 156 | |
| 157 | [Documentation] Configure less octet IP address. |
| 158 | [Tags] Configure_Empty_IP |
| 159 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 160 | [Template] Configure Network Settings |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 161 | |
| 162 | Configure Special Char IP |
| 163 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 164 | @@@.%%.44.11 ${valid_prefix_len} ${valid_gateway} error |
| 165 | |
Gunnar Mills | 917ba1a | 2018-04-08 16:42:12 -0500 | [diff] [blame] | 166 | [Documentation] Configure invalid IP address containing special chars. |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 167 | [Tags] Configure_Special_Char_IP |
| 168 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 169 | [Template] Configure Network Settings |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 170 | |
| 171 | Configure Hexadecimal IP |
| 172 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 173 | ${hex_ip} ${valid_prefix_len} ${valid_gateway} error |
| 174 | |
Gunnar Mills | 917ba1a | 2018-04-08 16:42:12 -0500 | [diff] [blame] | 175 | [Documentation] Configure invalid IP address containing hex value. |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 176 | [Tags] Configure_Hexadecimal_IP |
| 177 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 178 | [Template] Configure Network Settings |
| 179 | |
| 180 | Configure Negative Octet IP |
| 181 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 182 | ${negative_ip} ${valid_prefix_len} ${valid_gateway} error |
| 183 | |
| 184 | [Documentation] Configure invalid IP address containing negative octet. |
| 185 | [Tags] Configure_Negative_Octet_IP |
| 186 | |
| 187 | [Template] Configure Network Settings |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 188 | |
Prashanth Katti | 388bdc7 | 2017-07-19 08:54:58 -0500 | [diff] [blame] | 189 | Add New Valid IP With Blank Gateway |
| 190 | [Documentation] Add new IP with blank gateway. |
| 191 | [Tags] Add_New_Valid_IP_With_Blank_Gateway |
| 192 | |
| 193 | Configure Network Settings ${valid_ip} ${valid_prefix_len} ${EMPTY} |
| 194 | ... valid |
| 195 | |
Prashanth Katti | 90f9ff2 | 2017-08-11 06:17:12 -0500 | [diff] [blame] | 196 | # Verify whether new IP object is created for the given IP via REST. |
| 197 | # Delete IP address and IP object after verification. |
| 198 | Verify IP Address Via REST And Delete ${valid_ip} |
Prashanth Katti | 388bdc7 | 2017-07-19 08:54:58 -0500 | [diff] [blame] | 199 | |
| 200 | Configure Invalid Gateway String |
| 201 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 202 | ${valid_ip} ${valid_prefix_len} ${alpha_ip} error |
| 203 | |
| 204 | [Documentation] Configure invalid IP address to a gateway which is |
| 205 | ... an alpha string and expect an error. |
| 206 | [Tags] Configure_Invalid_Gateway_String |
| 207 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 208 | [Template] Configure Network Settings |
Prashanth Katti | 388bdc7 | 2017-07-19 08:54:58 -0500 | [diff] [blame] | 209 | |
| 210 | Configure Out Of Range IP For Gateway |
| 211 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 212 | ${valid_ip} ${valid_prefix_len} ${out_of_range_ip} error |
| 213 | |
| 214 | [Documentation] Configure out-of-range IP for gateway and expect an error. |
| 215 | [Tags] Configure_Out_Of_Range_IP_For_Gateway |
| 216 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 217 | [Template] Configure Network Settings |
Prashanth Katti | 388bdc7 | 2017-07-19 08:54:58 -0500 | [diff] [blame] | 218 | |
| 219 | Configure Broadcast IP For Gateway |
| 220 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 221 | ${valid_ip} ${valid_prefix_len} ${broadcast_ip} error |
| 222 | |
| 223 | [Documentation] Configure broadcast IP for gateway and expect an error. |
| 224 | [Tags] Configure_Broadcast_IP_For_Gateway |
| 225 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 226 | [Template] Configure Network Settings |
Prashanth Katti | 388bdc7 | 2017-07-19 08:54:58 -0500 | [diff] [blame] | 227 | |
| 228 | Configure Loopback IP For Gateway |
| 229 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 230 | ${valid_ip} ${valid_prefix_len} ${loopback_ip} error |
| 231 | |
| 232 | [Documentation] Configure loopback IP for gateway and expect an error. |
| 233 | [Tags] Configure_Loopback_IP_For_Gateway |
| 234 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 235 | [Template] Configure Network Settings |
Prashanth Katti | 388bdc7 | 2017-07-19 08:54:58 -0500 | [diff] [blame] | 236 | |
| 237 | Configure Multicast IP For Gateway |
| 238 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 239 | ${valid_ip} ${valid_prefix_len} ${multicast_ip} error |
| 240 | |
| 241 | [Documentation] Configure multicast IP for gateway and expect an error. |
| 242 | [Tags] Configure_Multicast_IP_For_Gateway |
| 243 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 244 | [Template] Configure Network Settings |
Prashanth Katti | 388bdc7 | 2017-07-19 08:54:58 -0500 | [diff] [blame] | 245 | |
| 246 | Configure Network ID For Gateway |
| 247 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 248 | ${valid_ip} ${valid_prefix_len} ${network_id} error |
| 249 | |
| 250 | [Documentation] Configure network ID for gateway and expect an error. |
| 251 | [Tags] Configure_Network_ID_For_Gateway |
| 252 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 253 | [Template] Configure Network Settings |
Prashanth Katti | 388bdc7 | 2017-07-19 08:54:58 -0500 | [diff] [blame] | 254 | |
| 255 | Configure Less Octet IP For Gateway |
| 256 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 257 | ${valid_ip} ${valid_prefix_len} ${less_octet_ip} error |
| 258 | |
| 259 | [Documentation] Configure less octet IP for gateway and expect an error. |
| 260 | [Tags] Configure_Less_Octet_IP_For_Gateway |
| 261 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 262 | [Template] Configure Network Settings |
Prashanth Katti | 388bdc7 | 2017-07-19 08:54:58 -0500 | [diff] [blame] | 263 | |
| 264 | Configure Special Char IP For Gateway |
| 265 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 266 | ${valid_ip} ${valid_prefix_len} @@@.%%.44.11 error |
| 267 | |
| 268 | [Documentation] Configure special char IP for gateway and expect an error. |
| 269 | [Tags] Configure_Special_Char_IP_For_Gateway |
| 270 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 271 | [Template] Configure Network Settings |
Prashanth Katti | 388bdc7 | 2017-07-19 08:54:58 -0500 | [diff] [blame] | 272 | |
| 273 | Configure Hexadecimal IP For Gateway |
| 274 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 275 | ${valid_ip} ${valid_prefix_len} ${hex_ip} error |
| 276 | |
| 277 | [Documentation] Configure hexadecimal IP for gateway and expect an error. |
| 278 | [Tags] Configure_Hexadecimal_IP_For_Gateway |
| 279 | |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 280 | [Template] Configure Network Settings |
| 281 | |
| 282 | Configure Out Of Range Prefix Length |
Prashanth Katti | a994bc3 | 2017-10-18 06:16:31 -0500 | [diff] [blame] | 283 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 284 | ${valid_ip} 33 ${valid_gateway} error |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 285 | |
| 286 | [Documentation] Configure out-of-range prefix length and expect an error. |
| 287 | [Tags] Configure_Out_Of_Range_Prefix_Length |
| 288 | |
| 289 | [Template] Configure Network Settings |
| 290 | |
| 291 | Configure Negative Value For Prefix Length |
Prashanth Katti | a994bc3 | 2017-10-18 06:16:31 -0500 | [diff] [blame] | 292 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 293 | ${valid_ip} -10 ${valid_gateway} error |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 294 | |
| 295 | [Documentation] Configure negative prefix length and expect an error. |
| 296 | [Tags] Configure_Negative_Value_For_Prefix_Length |
| 297 | |
| 298 | [Template] Configure Network Settings |
| 299 | |
| 300 | Configure Non Numeric Value For Prefix Length |
Prashanth Katti | a994bc3 | 2017-10-18 06:16:31 -0500 | [diff] [blame] | 301 | # IP Address Prefix_length Gateway_IP Expected_Result |
| 302 | ${valid_ip} xx ${valid_gateway} error |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 303 | |
| 304 | [Documentation] Configure non numeric value prefix length and expect |
| 305 | ... an error. |
| 306 | [Tags] Configure_String_Value_For_Prefix_Length |
| 307 | |
| 308 | [Template] Configure Network Settings |
| 309 | |
| 310 | Add Fourth Octet Threshold IP And Verify |
| 311 | [Documentation] Add fourth octet threshold IP and verify. |
| 312 | [Tags] Add_Fourth_Octet_Threshold_IP_And_Verify |
| 313 | |
| 314 | Configure Network Settings 10.6.6.254 ${valid_prefix_len} |
| 315 | ... ${valid_gateway} valid |
| 316 | |
Prashanth Katti | 90f9ff2 | 2017-08-11 06:17:12 -0500 | [diff] [blame] | 317 | # Verify whether new IP object is created for the given IP via REST. |
| 318 | # Delete IP address and IP object after verification. |
| 319 | |
| 320 | Verify IP Address Via REST And Delete 10.6.6.254 |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 321 | |
| 322 | Add Third Octet Threshold IP And Verify |
| 323 | [Documentation] Add third octet threshold IP and verify. |
| 324 | [Tags] Add_Third_Octet_Threshold_IP_And_Verify |
| 325 | |
| 326 | Configure Network Settings 10.6.255.6 ${valid_prefix_len} |
| 327 | ... ${valid_gateway} valid |
| 328 | |
Prashanth Katti | 90f9ff2 | 2017-08-11 06:17:12 -0500 | [diff] [blame] | 329 | # Verify whether new IP object is created for the given IP via REST. |
| 330 | # Delete IP address and IP object after verification. |
| 331 | |
| 332 | Verify IP Address Via REST And Delete 10.6.255.6 |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 333 | |
| 334 | Add Second Octet Threshold IP And Verify |
| 335 | [Documentation] Add second octet threshold IP and verify. |
| 336 | [Tags] Add_Second_Octet_Threshold_IP_And_Verify |
| 337 | |
| 338 | Configure Network Settings 10.255.6.6 ${valid_prefix_len} |
| 339 | ... ${valid_gateway} valid |
| 340 | |
Prashanth Katti | 90f9ff2 | 2017-08-11 06:17:12 -0500 | [diff] [blame] | 341 | # Verify whether new IP object is created for the given IP via REST. |
| 342 | # Delete IP address and IP object after verification. |
| 343 | |
| 344 | Verify IP Address Via REST And Delete 10.255.6.6 |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 345 | |
| 346 | Add First Octet Threshold IP And Verify |
| 347 | [Documentation] Add first octet threshold IP and verify. |
| 348 | [Tags] Add_First_Octet_Threshold_IP_And_Verify |
| 349 | |
| 350 | Configure Network Settings 223.6.6.6 ${valid_prefix_len} |
| 351 | ... ${valid_gateway} valid |
| 352 | |
Prashanth Katti | 90f9ff2 | 2017-08-11 06:17:12 -0500 | [diff] [blame] | 353 | # Verify whether new IP object is created for the given IP via REST. |
| 354 | # Delete IP address and IP object after verification. |
| 355 | |
| 356 | Verify IP Address Via REST And Delete 223.6.6.6 |
| 357 | |
| 358 | Configure Lowest Prefix Length |
| 359 | [Documentation] Configure lowest prefix length. |
| 360 | [Tags] Configure_Lowest_Prefix_Length |
| 361 | |
Prashanth Katti | 3690dc0 | 2017-11-22 07:21:24 -0600 | [diff] [blame] | 362 | Configure Network Settings ${valid_ip} ${1} |
Prashanth Katti | 90f9ff2 | 2017-08-11 06:17:12 -0500 | [diff] [blame] | 363 | ... ${valid_gateway} valid |
| 364 | |
| 365 | # Verify whether new IP object is created for the given IP via REST. |
| 366 | # Delete IP address and IP object after verification. |
| 367 | Verify IP Address Via REST And Delete ${valid_ip} |
| 368 | |
| 369 | Configure Threshold Prefix Length |
| 370 | [Documentation] Configure threshold prefix length. |
| 371 | [Tags] Configure_Threshold_Prefix_Length |
| 372 | |
| 373 | Configure Network Settings ${valid_ip} ${32} |
| 374 | ... ${valid_gateway} valid |
| 375 | |
| 376 | # Verify whether new IP object is created for the given IP via REST. |
| 377 | # Delete IP address and IP object after verification. |
| 378 | Verify IP Address Via REST And Delete ${valid_ip} |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 379 | |
| 380 | Verify Default Gateway |
| 381 | [Documentation] Verify default gateway. |
| 382 | [Tags] Verify that the default gateway has a valid route. |
| 383 | |
manasarm | 104cc6b | 2018-02-07 12:35:05 +0530 | [diff] [blame] | 384 | ${default_gw}= Read Attribute ${NETWORK_MANAGER}/config |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 385 | ... DefaultGateway |
| 386 | Validate Route On BMC ${default_gw} |
| 387 | |
| 388 | Verify Hostname |
| 389 | [Documentation] Verify that the hostname read via REST is the same as the |
| 390 | ... hostname configured on system. |
| 391 | [Tags] Verify_Hostname |
| 392 | |
manasarm | 104cc6b | 2018-02-07 12:35:05 +0530 | [diff] [blame] | 393 | ${hostname}= Read Attribute ${NETWORK_MANAGER}/config HostName |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 394 | Validate Hostname On BMC ${hostname} |
Prashanth Katti | 388bdc7 | 2017-07-19 08:54:58 -0500 | [diff] [blame] | 395 | |
manasarm | 88f0006 | 2018-03-07 12:07:33 +0530 | [diff] [blame] | 396 | Run IPMI With Multiple IPs Configured |
| 397 | [Documentation] Test out-of-band IPMI command with multiple IPs configured. |
| 398 | [Tags] Run_IPMI_With_Multiple_IPs_Configured |
| 399 | [Teardown] Clear IP Address |
| 400 | |
| 401 | # Configure two IPs and verify. |
| 402 | |
| 403 | :FOR ${loc_valid_ip} IN @{valid_ips} |
| 404 | \ Configure Network Settings ${loc_valid_ip} ${valid_prefix_len} |
| 405 | \ ... ${valid_gateway} valid |
| 406 | |
| 407 | @{ip_uri_list}= Get IPv4 URI List |
| 408 | @{ip_list}= Get List Of IP Address Via REST @{ip_uri_list} |
| 409 | |
| 410 | List Should Contain Sub List ${ip_list} ${valid_ips} |
| 411 | ... msg=IP address is not configured. |
| 412 | |
| 413 | Run External IPMI Standard Command chassis bootparam get 5 |
| 414 | |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 415 | *** Keywords *** |
| 416 | |
manasarm | 88f0006 | 2018-03-07 12:07:33 +0530 | [diff] [blame] | 417 | Clear IP Address |
| 418 | [Documentation] Delete the IPs |
George Keishing | 44bc84d | 2018-04-12 00:51:04 -0500 | [diff] [blame] | 419 | |
| 420 | # Get the current IPv4 list post delete and sleep 10s for sync. |
manasarm | 88f0006 | 2018-03-07 12:07:33 +0530 | [diff] [blame] | 421 | :FOR ${loc_valid_ip} IN @{valid_ips} |
George Keishing | 44bc84d | 2018-04-12 00:51:04 -0500 | [diff] [blame] | 422 | \ @{ip_uri_list}= Get IPv4 URI List |
manasarm | 88f0006 | 2018-03-07 12:07:33 +0530 | [diff] [blame] | 423 | \ Delete IP And Object ${loc_valid_ip} @{ip_uri_list} |
George Keishing | 44bc84d | 2018-04-12 00:51:04 -0500 | [diff] [blame] | 424 | \ Sleep 10s |
manasarm | 88f0006 | 2018-03-07 12:07:33 +0530 | [diff] [blame] | 425 | |
Steven Sombar | fac31e9 | 2017-12-15 09:40:34 -0600 | [diff] [blame] | 426 | Test Setup Execution |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 427 | [Documentation] Network setup. |
| 428 | Open Connection And Login |
| 429 | |
| 430 | @{IPv4_URI_List}= Get IPv4 URI List |
| 431 | Set Test Variable @{IPv4_URI_List} |
| 432 | |
| 433 | # Get BMC IP address and prefix length. |
| 434 | ${ip_data}= Get BMC IP Info |
| 435 | Set Test Variable ${ip_data} |
| 436 | |
| 437 | Get IPv4 URI List |
| 438 | [Documentation] Get all IPv4 URIs. |
| 439 | |
| 440 | # Sample output: |
| 441 | # "data": [ |
| 442 | # "/xyz/openbmc_project/network/eth0/ipv4/e9767624", |
| 443 | # "/xyz/openbmc_project/network/eth0/ipv4/31f4ce8b" |
| 444 | # ], |
| 445 | |
manasarm | 104cc6b | 2018-02-07 12:35:05 +0530 | [diff] [blame] | 446 | @{ipv4_uri_list}= Read Properties ${NETWORK_MANAGER}/eth0/ipv4/ |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 447 | Should Not Be Empty ${ipv4_uri_list} msg=IPv4 URI list is empty. |
| 448 | |
| 449 | [Return] @{ipv4_uri_list} |
| 450 | |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 451 | Validate IP On BMC |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 452 | [Documentation] Validate IP on BMC. |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 453 | [Arguments] ${ip_address} ${ip_info}=${ip_data} |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 454 | |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 455 | # Description of argument(s): |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 456 | # ip_address IP address of the system. |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 457 | # ip_info List of IP address and prefix length values. |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 458 | |
Prashanth Katti | e8a7453 | 2017-11-07 06:45:07 -0600 | [diff] [blame] | 459 | Should Contain Match ${ip_info} ${ip_address}/* |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 460 | ... msg=IP address does not exist. |
| 461 | |
Prashanth Katti | 90f9ff2 | 2017-08-11 06:17:12 -0500 | [diff] [blame] | 462 | Verify IP Address Via REST And Delete |
| 463 | [Documentation] Verify IP address via REST and delete. |
| 464 | [Arguments] ${ip_addr} |
| 465 | |
| 466 | # Description of argument(s): |
| 467 | # ip_addr IP address to be verified. |
| 468 | |
| 469 | @{ip_uri_list}= Get IPv4 URI List |
| 470 | @{ip_list}= Get List Of IP Address Via REST @{ip_uri_list} |
| 471 | |
| 472 | List Should Contain Value ${ip_list} ${ip_addr} |
| 473 | ... msg=IP address is not configured. |
| 474 | |
| 475 | # If IP address is configured, delete it. |
| 476 | Delete IP And Object ${ip_addr} @{ip_uri_list} |
| 477 | |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 478 | Validate Prefix Length On BMC |
| 479 | [Documentation] Validate prefix length on BMC. |
| 480 | [Arguments] ${prefix_length} |
| 481 | |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 482 | # Description of argument(s): |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 483 | # prefix_length It indicates netmask, netmask value 255.255.255.0 |
| 484 | # is equal to prefix length 24. |
| 485 | # ip_data Suite variable which has list of IP address and |
| 486 | # prefix length values. |
| 487 | |
| 488 | Should Contain Match ${ip_data} */${prefix_length} |
| 489 | ... msg=Prefix length does not exist. |
| 490 | |
| 491 | Validate Route On BMC |
| 492 | [Documentation] Validate route. |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 493 | [Arguments] ${gateway_ip} |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 494 | |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 495 | # Description of argument(s): |
| 496 | # gateway_ip Gateway IP address. |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 497 | |
| 498 | ${route_info}= Get BMC Route Info |
Prashanth Katti | e8a7453 | 2017-11-07 06:45:07 -0600 | [diff] [blame] | 499 | |
| 500 | # If gateway IP is empty or 0.0.0.0 it will not have route entry. |
| 501 | |
| 502 | Run Keyword If '${gateway_ip}' == '0.0.0.0' |
| 503 | ... Pass Execution Gatway IP is "0.0.0.0". |
| 504 | ... ELSE |
| 505 | ... Should Contain ${route_info} ${gateway_ip} |
| 506 | ... msg=Gateway IP address not matching. |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 507 | |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 508 | |
| 509 | Configure Network Settings |
| 510 | [Documentation] Configure network settings. |
| 511 | [Arguments] ${ip_addr} ${prefix_len} ${gateway_ip} ${expected_result} |
| 512 | |
| 513 | # Description of argument(s): |
| 514 | # ip_addr IP address of BMC. |
| 515 | # prefix_len Prefix length. |
| 516 | # gateway_ip Gateway IP address. |
| 517 | # expected_result Expected status of network setting configuration. |
| 518 | |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 519 | @{ip_parm_list}= Create List xyz.openbmc_project.Network.IP.Protocol.IPv4 |
Prashanth Katti | 90f9ff2 | 2017-08-11 06:17:12 -0500 | [diff] [blame] | 520 | ... ${ip_addr} ${prefix_len} ${gateway_ip} |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 521 | |
| 522 | ${data}= Create Dictionary data=@{ip_parm_list} |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 523 | |
Prashanth Katti | 90f9ff2 | 2017-08-11 06:17:12 -0500 | [diff] [blame] | 524 | Run Keyword And Ignore Error OpenBMC Post Request |
manasarm | 104cc6b | 2018-02-07 12:35:05 +0530 | [diff] [blame] | 525 | ... ${NETWORK_MANAGER}/eth0/action/IP data=${data} |
Prashanth Katti | 90f9ff2 | 2017-08-11 06:17:12 -0500 | [diff] [blame] | 526 | |
| 527 | # After any modification on network interface, BMC restarts network |
| 528 | # module, wait until it is reachable. |
| 529 | |
Prashanth Katti | 3690dc0 | 2017-11-22 07:21:24 -0600 | [diff] [blame] | 530 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_RETRY_TIME} |
| 531 | ... ${NETWORK_TIMEOUT} |
Prashanth Katti | 90f9ff2 | 2017-08-11 06:17:12 -0500 | [diff] [blame] | 532 | |
| 533 | # Verify whether new IP address is populated on BMC system. |
| 534 | # It should not allow to configure invalid settings. |
| 535 | |
| 536 | ${ip_data}= Get BMC IP Info |
| 537 | ${status}= Run Keyword And Return Status |
| 538 | ... Validate IP On BMC ${ip_addr} ${ip_data} |
| 539 | |
| 540 | Run Keyword If '${expected_result}' == 'error' |
| 541 | ... Should Be Equal ${status} ${False} |
| 542 | ... msg=Allowing the configuration of an invalid IP. |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 543 | ... ELSE |
Prashanth Katti | 90f9ff2 | 2017-08-11 06:17:12 -0500 | [diff] [blame] | 544 | ... Should Be Equal ${status} ${True} |
| 545 | ... msg=Not allowing the configuration of a valid IP. |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 546 | |
| 547 | Validate Hostname On BMC |
| 548 | [Documentation] Verify that the hostname read via REST is the same as the |
| 549 | ... hostname configured on system. |
| 550 | [Arguments] ${hostname} |
| 551 | |
| 552 | # Description of argument(s): |
| 553 | # hostname A hostname value which is to be compared to the hostname |
| 554 | # configured on system. |
| 555 | |
| 556 | ${sys_hostname}= Get BMC Hostname |
| 557 | |
| 558 | Should Contain ${sys_hostname} ${hostname} |
| 559 | ... ignore_case=True msg=Hostname does not exist. |
George Keishing | bf58f01 | 2018-04-12 00:21:08 -0500 | [diff] [blame] | 560 | |
| 561 | Test Teardown Execution |
| 562 | [Documentation] Do the post test teardown. |
| 563 | |
| 564 | FFDC On Test Case Fail |
| 565 | Close All Connections |