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