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 | |
| 13 | Test Setup Test Init Setup |
| 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 |
| 24 | ${valid_prefix_len} 24 |
| 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 | |
| 81 | # Verify whether new IP address is populated on BMC system. |
| 82 | ${ip_info}= Get BMC IP Info |
| 83 | Validate IP On BMC ${valid_ip} ${ip_info} |
| 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 | |
| 191 | # Verify whether new IP address is populated on BMC system. |
| 192 | ${ip_info}= Get BMC IP Info |
| 193 | Validate IP On BMC ${valid_ip} ${ip_info} |
| 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 | |
| 312 | # Verify whether new IP address is populated on BMC system. |
| 313 | ${ip_info}= Get BMC IP Info |
| 314 | Validate IP On BMC 10.6.6.254 ${ip_info} |
| 315 | |
| 316 | Add Third Octet Threshold IP And Verify |
| 317 | [Documentation] Add third octet threshold IP and verify. |
| 318 | [Tags] Add_Third_Octet_Threshold_IP_And_Verify |
| 319 | |
| 320 | Configure Network Settings 10.6.255.6 ${valid_prefix_len} |
| 321 | ... ${valid_gateway} valid |
| 322 | |
| 323 | # Verify whether new IP address is populated on BMC system. |
| 324 | ${ip_info}= Get BMC IP Info |
| 325 | Validate IP On BMC 10.6.255.6 ${ip_info} |
| 326 | |
| 327 | Add Second Octet Threshold IP And Verify |
| 328 | [Documentation] Add second octet threshold IP and verify. |
| 329 | [Tags] Add_Second_Octet_Threshold_IP_And_Verify |
| 330 | |
| 331 | Configure Network Settings 10.255.6.6 ${valid_prefix_len} |
| 332 | ... ${valid_gateway} valid |
| 333 | |
| 334 | # Verify whether new IP address is populated on BMC system. |
| 335 | ${ip_info}= Get BMC IP Info |
| 336 | Validate IP On BMC 10.255.6.6 ${ip_info} |
| 337 | |
| 338 | Add First Octet Threshold IP And Verify |
| 339 | [Documentation] Add first octet threshold IP and verify. |
| 340 | [Tags] Add_First_Octet_Threshold_IP_And_Verify |
| 341 | |
| 342 | Configure Network Settings 223.6.6.6 ${valid_prefix_len} |
| 343 | ... ${valid_gateway} valid |
| 344 | |
| 345 | # Verify whether new IP address is populated on BMC system. |
| 346 | ${ip_info}= Get BMC IP Info |
| 347 | Validate IP On BMC 223.6.6.6 ${ip_info} |
| 348 | |
| 349 | Verify Default Gateway |
| 350 | [Documentation] Verify default gateway. |
| 351 | [Tags] Verify that the default gateway has a valid route. |
| 352 | |
| 353 | ${default_gw}= Read Attribute ${XYZ_NETWORK_MANAGER}/config |
| 354 | ... DefaultGateway |
| 355 | Validate Route On BMC ${default_gw} |
| 356 | |
| 357 | Verify Hostname |
| 358 | [Documentation] Verify that the hostname read via REST is the same as the |
| 359 | ... hostname configured on system. |
| 360 | [Tags] Verify_Hostname |
| 361 | |
| 362 | ${hostname}= Read Attribute ${XYZ_NETWORK_MANAGER}/config HostName |
| 363 | Validate Hostname On BMC ${hostname} |
Prashanth Katti | 388bdc7 | 2017-07-19 08:54:58 -0500 | [diff] [blame] | 364 | |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 365 | *** Keywords *** |
| 366 | |
| 367 | Test Init Setup |
| 368 | [Documentation] Network setup. |
| 369 | Open Connection And Login |
| 370 | |
| 371 | @{IPv4_URI_List}= Get IPv4 URI List |
| 372 | Set Test Variable @{IPv4_URI_List} |
| 373 | |
| 374 | # Get BMC IP address and prefix length. |
| 375 | ${ip_data}= Get BMC IP Info |
| 376 | Set Test Variable ${ip_data} |
| 377 | |
| 378 | Get IPv4 URI List |
| 379 | [Documentation] Get all IPv4 URIs. |
| 380 | |
| 381 | # Sample output: |
| 382 | # "data": [ |
| 383 | # "/xyz/openbmc_project/network/eth0/ipv4/e9767624", |
| 384 | # "/xyz/openbmc_project/network/eth0/ipv4/31f4ce8b" |
| 385 | # ], |
| 386 | |
| 387 | @{ipv4_uri_list}= Read Properties ${XYZ_NETWORK_MANAGER}/eth0/ipv4/ |
| 388 | Should Not Be Empty ${ipv4_uri_list} msg=IPv4 URI list is empty. |
| 389 | |
| 390 | [Return] @{ipv4_uri_list} |
| 391 | |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 392 | Validate IP On BMC |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 393 | [Documentation] Validate IP on BMC. |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 394 | [Arguments] ${ip_address} ${ip_info}=${ip_data} |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 395 | |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 396 | # Description of argument(s): |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 397 | # ip_address IP address of the system. |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 398 | # ip_info List of IP address and prefix length values. |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 399 | |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 400 | Should Contain Match ${ip_info} ${ip_address}* |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 401 | ... msg=IP address does not exist. |
| 402 | |
| 403 | Validate Prefix Length On BMC |
| 404 | [Documentation] Validate prefix length on BMC. |
| 405 | [Arguments] ${prefix_length} |
| 406 | |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 407 | # Description of argument(s): |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 408 | # prefix_length It indicates netmask, netmask value 255.255.255.0 |
| 409 | # is equal to prefix length 24. |
| 410 | # ip_data Suite variable which has list of IP address and |
| 411 | # prefix length values. |
| 412 | |
| 413 | Should Contain Match ${ip_data} */${prefix_length} |
| 414 | ... msg=Prefix length does not exist. |
| 415 | |
| 416 | Validate Route On BMC |
| 417 | [Documentation] Validate route. |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 418 | [Arguments] ${gateway_ip} |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 419 | |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 420 | # Description of argument(s): |
| 421 | # gateway_ip Gateway IP address. |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 422 | |
| 423 | ${route_info}= Get BMC Route Info |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 424 | Should Contain ${route_info} ${gateway_ip} |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 425 | ... msg=Gateway IP address not matching. |
| 426 | |
| 427 | Validate MAC on BMC |
| 428 | [Documentation] Validate MAC on BMC. |
| 429 | [Arguments] ${macaddr} |
| 430 | |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 431 | # Description of argument(s): |
Prashanth Katti | e79c540 | 2017-06-08 07:40:49 -0500 | [diff] [blame] | 432 | # macaddr MAC address of the BMC. |
| 433 | |
| 434 | ${system_mac}= Get BMC MAC Address |
| 435 | |
| 436 | Should Contain ${system_mac} ${macaddr} |
| 437 | ... ignore_case=True msg=MAC address does not exist. |
Prashanth Katti | 4cf87bd | 2017-06-28 08:56:02 -0500 | [diff] [blame] | 438 | |
| 439 | Configure Network Settings |
| 440 | [Documentation] Configure network settings. |
| 441 | [Arguments] ${ip_addr} ${prefix_len} ${gateway_ip} ${expected_result} |
| 442 | |
| 443 | # Description of argument(s): |
| 444 | # ip_addr IP address of BMC. |
| 445 | # prefix_len Prefix length. |
| 446 | # gateway_ip Gateway IP address. |
| 447 | # expected_result Expected status of network setting configuration. |
| 448 | |
| 449 | ${len}= Convert To Bytes ${prefix_len} |
| 450 | |
| 451 | @{ip_parm_list}= Create List xyz.openbmc_project.Network.IP.Protocol.IPv4 |
| 452 | ... ${ip_addr} ${len} ${gateway_ip} |
| 453 | |
| 454 | ${data}= Create Dictionary data=@{ip_parm_list} |
| 455 | ${resp}= OpenBMC Post Request |
| 456 | ... ${XYZ_NETWORK_MANAGER}/eth0/action/IP data=${data} |
| 457 | ${json}= To JSON ${resp.content} |
| 458 | |
| 459 | Run Keyword If '${expected_result}' == 'error' Run Keywords |
| 460 | ... Should Not Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 461 | ... AND Should Be Equal As Strings ${json['status']} ${expected_result} |
| 462 | ... ELSE |
| 463 | ... Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
Prashanth Katti | 40fb8ca | 2017-07-25 06:47:23 -0500 | [diff] [blame] | 464 | |
| 465 | Validate Hostname On BMC |
| 466 | [Documentation] Verify that the hostname read via REST is the same as the |
| 467 | ... hostname configured on system. |
| 468 | [Arguments] ${hostname} |
| 469 | |
| 470 | # Description of argument(s): |
| 471 | # hostname A hostname value which is to be compared to the hostname |
| 472 | # configured on system. |
| 473 | |
| 474 | ${sys_hostname}= Get BMC Hostname |
| 475 | |
| 476 | Should Contain ${sys_hostname} ${hostname} |
| 477 | ... ignore_case=True msg=Hostname does not exist. |