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