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