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