blob: f15dffeab2b802d69e8647601a977ec12c7602a2 [file] [log] [blame]
Prashanth Kattie79c5402017-06-08 07:40:49 -05001*** Settings ***
Prashanth Katti4cf87bd2017-06-28 08:56:02 -05002Documentation Network interface and functionalities test module on BMC.
Prashanth Kattie79c5402017-06-08 07:40:49 -05003
4Resource ../lib/rest_client.robot
5Resource ../lib/utils.robot
6Resource ../lib/bmc_network_utils.robot
7
8Force Tags Network_Test
9
10Library String
11Library SSHLibrary
12
Sweta Potthurieb6b3262017-07-18 10:01:35 -050013Test Setup Test Init Setup
Prashanth Kattie79c5402017-06-08 07:40:49 -050014
Prashanth Katti4cf87bd2017-06-28 08:56:02 -050015*** Variables ***
16
17${alpha_ip} xx.xx.xx.xx
18
19# 10.x.x.x series is a private IP address range and does not exist in
20# our network, so this is chosen to avoid IP conflict.
21
22${valid_ip} 10.6.6.6
23${valid_gateway} 10.6.6.1
Prashanth Katti90f9ff22017-08-11 06:17:12 -050024${valid_prefix_len} ${24}
Prashanth Katti4cf87bd2017-06-28 08:56:02 -050025${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 Katti40fb8ca2017-07-25 06:47:23 -050040${negative_ip} 10.-6.-6.6
Prashanth Katti4cf87bd2017-06-28 08:56:02 -050041
Prashanth Kattie79c5402017-06-08 07:40:49 -050042*** Test Cases ***
43
44Get 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
52Verify 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
60Verify Gateway Address
61 [Documentation] Get gateway address and verify.
62 [Tags] Verify_Gateway_Address
63
64 :FOR ${ipv4_uri} IN @{IPv4_URI_List}
Prashanth Katti4cf87bd2017-06-28 08:56:02 -050065 \ ${gateway_ip}= Read Attribute ${ipv4_uri} Gateway
66 \ Validate Route On BMC ${gateway_ip}
Prashanth Kattie79c5402017-06-08 07:40:49 -050067
68Verify 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 Katti4cf87bd2017-06-28 08:56:02 -050074Add New Valid IP And Verify
75 [Documentation] Add new IP address and verify.
76 [Tags] Add_New_Valid_IP_And_Verify
77
78 Configure Network Settings ${valid_ip} ${valid_prefix_len}
79 ... ${valid_gateway} valid
80
Prashanth Katti90f9ff22017-08-11 06:17:12 -050081 # Verify whether new IP object is created for the given IP via REST.
82 # Delete IP address and IP object after verification.
83 Verify IP Address Via REST And Delete ${valid_ip}
Prashanth Katti4cf87bd2017-06-28 08:56:02 -050084
85Configure 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 Katti40fb8ca2017-07-25 06:47:23 -050092 [Template] Configure Network Settings
Prashanth Katti4cf87bd2017-06-28 08:56:02 -050093
94Configure 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 Katti388bdc72017-07-19 08:54:58 -050098 [Documentation] Configure out-of-range IP address.
Prashanth Katti4cf87bd2017-06-28 08:56:02 -050099 [Tags] Configure_Out_Of_Range_IP
100
Prashanth Katti40fb8ca2017-07-25 06:47:23 -0500101 [Template] Configure Network Settings
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500102
103Configure 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 Katti40fb8ca2017-07-25 06:47:23 -0500110 [Template] Configure Network Settings
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500111
112Configure 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 Katti40fb8ca2017-07-25 06:47:23 -0500119 [Template] Configure Network Settings
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500120
121Configure 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 Katti40fb8ca2017-07-25 06:47:23 -0500128 [Template] Configure Network Settings
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500129
130Configure 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 Katti40fb8ca2017-07-25 06:47:23 -0500137 [Template] Configure Network Settings
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500138
139Configure 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 Katti40fb8ca2017-07-25 06:47:23 -0500146 [Template] Configure Network Settings
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500147
148Configure 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 Katti40fb8ca2017-07-25 06:47:23 -0500155 [Template] Configure Network Settings
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500156
157Configure 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 Katti40fb8ca2017-07-25 06:47:23 -0500164 [Template] Configure Network Settings
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500165
166Configure 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 Katti40fb8ca2017-07-25 06:47:23 -0500173 [Template] Configure Network Settings
174
175Configure 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 Katti4cf87bd2017-06-28 08:56:02 -0500183
Prashanth Katti388bdc72017-07-19 08:54:58 -0500184Add New Valid IP With Blank Gateway
185 [Documentation] Add new IP with blank gateway.
186 [Tags] Add_New_Valid_IP_With_Blank_Gateway
187
188 Configure Network Settings ${valid_ip} ${valid_prefix_len} ${EMPTY}
189 ... valid
190
Prashanth Katti90f9ff22017-08-11 06:17:12 -0500191 # Verify whether new IP object is created for the given IP via REST.
192 # Delete IP address and IP object after verification.
193 Verify IP Address Via REST And Delete ${valid_ip}
Prashanth Katti388bdc72017-07-19 08:54:58 -0500194
195Configure 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 Katti40fb8ca2017-07-25 06:47:23 -0500203 [Template] Configure Network Settings
Prashanth Katti388bdc72017-07-19 08:54:58 -0500204
205Configure 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 Katti40fb8ca2017-07-25 06:47:23 -0500212 [Template] Configure Network Settings
Prashanth Katti388bdc72017-07-19 08:54:58 -0500213
214Configure 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 Katti40fb8ca2017-07-25 06:47:23 -0500221 [Template] Configure Network Settings
Prashanth Katti388bdc72017-07-19 08:54:58 -0500222
223Configure 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 Katti40fb8ca2017-07-25 06:47:23 -0500230 [Template] Configure Network Settings
Prashanth Katti388bdc72017-07-19 08:54:58 -0500231
232Configure 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 Katti40fb8ca2017-07-25 06:47:23 -0500239 [Template] Configure Network Settings
Prashanth Katti388bdc72017-07-19 08:54:58 -0500240
241Configure 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 Katti40fb8ca2017-07-25 06:47:23 -0500248 [Template] Configure Network Settings
Prashanth Katti388bdc72017-07-19 08:54:58 -0500249
250Configure 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 Katti40fb8ca2017-07-25 06:47:23 -0500257 [Template] Configure Network Settings
Prashanth Katti388bdc72017-07-19 08:54:58 -0500258
259Configure 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 Katti40fb8ca2017-07-25 06:47:23 -0500266 [Template] Configure Network Settings
Prashanth Katti388bdc72017-07-19 08:54:58 -0500267
268Configure 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 Katti40fb8ca2017-07-25 06:47:23 -0500275 [Template] Configure Network Settings
276
277Configure 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
286Configure 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
295Configure 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
305Add Fourth Octet Threshold IP And Verify
306 [Documentation] Add fourth octet threshold IP and verify.
307 [Tags] Add_Fourth_Octet_Threshold_IP_And_Verify
308
309 Configure Network Settings 10.6.6.254 ${valid_prefix_len}
310 ... ${valid_gateway} valid
311
Prashanth Katti90f9ff22017-08-11 06:17:12 -0500312 # Verify whether new IP object is created for the given IP via REST.
313 # Delete IP address and IP object after verification.
314
315 Verify IP Address Via REST And Delete 10.6.6.254
Prashanth Katti40fb8ca2017-07-25 06:47:23 -0500316
317Add Third Octet Threshold IP And Verify
318 [Documentation] Add third octet threshold IP and verify.
319 [Tags] Add_Third_Octet_Threshold_IP_And_Verify
320
321 Configure Network Settings 10.6.255.6 ${valid_prefix_len}
322 ... ${valid_gateway} valid
323
Prashanth Katti90f9ff22017-08-11 06:17:12 -0500324 # Verify whether new IP object is created for the given IP via REST.
325 # Delete IP address and IP object after verification.
326
327 Verify IP Address Via REST And Delete 10.6.255.6
Prashanth Katti40fb8ca2017-07-25 06:47:23 -0500328
329Add Second Octet Threshold IP And Verify
330 [Documentation] Add second octet threshold IP and verify.
331 [Tags] Add_Second_Octet_Threshold_IP_And_Verify
332
333 Configure Network Settings 10.255.6.6 ${valid_prefix_len}
334 ... ${valid_gateway} valid
335
Prashanth Katti90f9ff22017-08-11 06:17:12 -0500336 # Verify whether new IP object is created for the given IP via REST.
337 # Delete IP address and IP object after verification.
338
339 Verify IP Address Via REST And Delete 10.255.6.6
Prashanth Katti40fb8ca2017-07-25 06:47:23 -0500340
341Add First Octet Threshold IP And Verify
342 [Documentation] Add first octet threshold IP and verify.
343 [Tags] Add_First_Octet_Threshold_IP_And_Verify
344
345 Configure Network Settings 223.6.6.6 ${valid_prefix_len}
346 ... ${valid_gateway} valid
347
Prashanth Katti90f9ff22017-08-11 06:17:12 -0500348 # Verify whether new IP object is created for the given IP via REST.
349 # Delete IP address and IP object after verification.
350
351 Verify IP Address Via REST And Delete 223.6.6.6
352
353Configure Lowest Prefix Length
354 [Documentation] Configure lowest prefix length.
355 [Tags] Configure_Lowest_Prefix_Length
356
357 Configure Network Settings ${valid_ip} ${0}
358 ... ${valid_gateway} valid
359
360 # Verify whether new IP object is created for the given IP via REST.
361 # Delete IP address and IP object after verification.
362 Verify IP Address Via REST And Delete ${valid_ip}
363
364Configure Threshold Prefix Length
365 [Documentation] Configure threshold prefix length.
366 [Tags] Configure_Threshold_Prefix_Length
367
368 Configure Network Settings ${valid_ip} ${32}
369 ... ${valid_gateway} valid
370
371 # Verify whether new IP object is created for the given IP via REST.
372 # Delete IP address and IP object after verification.
373 Verify IP Address Via REST And Delete ${valid_ip}
Prashanth Katti40fb8ca2017-07-25 06:47:23 -0500374
375Verify Default Gateway
376 [Documentation] Verify default gateway.
377 [Tags] Verify that the default gateway has a valid route.
378
379 ${default_gw}= Read Attribute ${XYZ_NETWORK_MANAGER}/config
380 ... DefaultGateway
381 Validate Route On BMC ${default_gw}
382
383Verify Hostname
384 [Documentation] Verify that the hostname read via REST is the same as the
385 ... hostname configured on system.
386 [Tags] Verify_Hostname
387
388 ${hostname}= Read Attribute ${XYZ_NETWORK_MANAGER}/config HostName
389 Validate Hostname On BMC ${hostname}
Prashanth Katti388bdc72017-07-19 08:54:58 -0500390
Prashanth Kattie79c5402017-06-08 07:40:49 -0500391*** Keywords ***
392
393Test Init Setup
394 [Documentation] Network setup.
395 Open Connection And Login
396
397 @{IPv4_URI_List}= Get IPv4 URI List
398 Set Test Variable @{IPv4_URI_List}
399
400 # Get BMC IP address and prefix length.
401 ${ip_data}= Get BMC IP Info
402 Set Test Variable ${ip_data}
403
404Get IPv4 URI List
405 [Documentation] Get all IPv4 URIs.
406
407 # Sample output:
408 # "data": [
409 # "/xyz/openbmc_project/network/eth0/ipv4/e9767624",
410 # "/xyz/openbmc_project/network/eth0/ipv4/31f4ce8b"
411 # ],
412
413 @{ipv4_uri_list}= Read Properties ${XYZ_NETWORK_MANAGER}/eth0/ipv4/
414 Should Not Be Empty ${ipv4_uri_list} msg=IPv4 URI list is empty.
415
416 [Return] @{ipv4_uri_list}
417
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500418Validate IP On BMC
Prashanth Kattie79c5402017-06-08 07:40:49 -0500419 [Documentation] Validate IP on BMC.
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500420 [Arguments] ${ip_address} ${ip_info}=${ip_data}
Prashanth Kattie79c5402017-06-08 07:40:49 -0500421
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500422 # Description of argument(s):
Prashanth Kattie79c5402017-06-08 07:40:49 -0500423 # ip_address IP address of the system.
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500424 # ip_info List of IP address and prefix length values.
Prashanth Kattie79c5402017-06-08 07:40:49 -0500425
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500426 Should Contain Match ${ip_info} ${ip_address}*
Prashanth Kattie79c5402017-06-08 07:40:49 -0500427 ... msg=IP address does not exist.
428
Prashanth Katti90f9ff22017-08-11 06:17:12 -0500429Verify IP Address Via REST And Delete
430 [Documentation] Verify IP address via REST and delete.
431 [Arguments] ${ip_addr}
432
433 # Description of argument(s):
434 # ip_addr IP address to be verified.
435
436 @{ip_uri_list}= Get IPv4 URI List
437 @{ip_list}= Get List Of IP Address Via REST @{ip_uri_list}
438
439 List Should Contain Value ${ip_list} ${ip_addr}
440 ... msg=IP address is not configured.
441
442 # If IP address is configured, delete it.
443 Delete IP And Object ${ip_addr} @{ip_uri_list}
444
Prashanth Kattie79c5402017-06-08 07:40:49 -0500445Validate Prefix Length On BMC
446 [Documentation] Validate prefix length on BMC.
447 [Arguments] ${prefix_length}
448
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500449 # Description of argument(s):
Prashanth Kattie79c5402017-06-08 07:40:49 -0500450 # prefix_length It indicates netmask, netmask value 255.255.255.0
451 # is equal to prefix length 24.
452 # ip_data Suite variable which has list of IP address and
453 # prefix length values.
454
455 Should Contain Match ${ip_data} */${prefix_length}
456 ... msg=Prefix length does not exist.
457
458Validate Route On BMC
459 [Documentation] Validate route.
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500460 [Arguments] ${gateway_ip}
Prashanth Kattie79c5402017-06-08 07:40:49 -0500461
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500462 # Description of argument(s):
463 # gateway_ip Gateway IP address.
Prashanth Kattie79c5402017-06-08 07:40:49 -0500464
465 ${route_info}= Get BMC Route Info
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500466 Should Contain ${route_info} ${gateway_ip}
Prashanth Kattie79c5402017-06-08 07:40:49 -0500467 ... msg=Gateway IP address not matching.
468
469Validate MAC on BMC
470 [Documentation] Validate MAC on BMC.
471 [Arguments] ${macaddr}
472
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500473 # Description of argument(s):
Prashanth Kattie79c5402017-06-08 07:40:49 -0500474 # macaddr MAC address of the BMC.
475
476 ${system_mac}= Get BMC MAC Address
477
478 Should Contain ${system_mac} ${macaddr}
479 ... ignore_case=True msg=MAC address does not exist.
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500480
481Configure Network Settings
482 [Documentation] Configure network settings.
483 [Arguments] ${ip_addr} ${prefix_len} ${gateway_ip} ${expected_result}
484
485 # Description of argument(s):
486 # ip_addr IP address of BMC.
487 # prefix_len Prefix length.
488 # gateway_ip Gateway IP address.
489 # expected_result Expected status of network setting configuration.
490
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500491 @{ip_parm_list}= Create List xyz.openbmc_project.Network.IP.Protocol.IPv4
Prashanth Katti90f9ff22017-08-11 06:17:12 -0500492 ... ${ip_addr} ${prefix_len} ${gateway_ip}
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500493
494 ${data}= Create Dictionary data=@{ip_parm_list}
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500495
Prashanth Katti90f9ff22017-08-11 06:17:12 -0500496 Run Keyword And Ignore Error OpenBMC Post Request
497 ... ${XYZ_NETWORK_MANAGER}/eth0/action/IP data=${data}
498
499 # After any modification on network interface, BMC restarts network
500 # module, wait until it is reachable.
501
502 Wait For Host To Ping ${OPENBMC_HOST} 0.3 1
503
504 # Verify whether new IP address is populated on BMC system.
505 # It should not allow to configure invalid settings.
506
507 ${ip_data}= Get BMC IP Info
508 ${status}= Run Keyword And Return Status
509 ... Validate IP On BMC ${ip_addr} ${ip_data}
510
511 Run Keyword If '${expected_result}' == 'error'
512 ... Should Be Equal ${status} ${False}
513 ... msg=Allowing the configuration of an invalid IP.
Prashanth Katti4cf87bd2017-06-28 08:56:02 -0500514 ... ELSE
Prashanth Katti90f9ff22017-08-11 06:17:12 -0500515 ... Should Be Equal ${status} ${True}
516 ... msg=Not allowing the configuration of a valid IP.
Prashanth Katti40fb8ca2017-07-25 06:47:23 -0500517
518Validate Hostname On BMC
519 [Documentation] Verify that the hostname read via REST is the same as the
520 ... hostname configured on system.
521 [Arguments] ${hostname}
522
523 # Description of argument(s):
524 # hostname A hostname value which is to be compared to the hostname
525 # configured on system.
526
527 ${sys_hostname}= Get BMC Hostname
528
529 Should Contain ${sys_hostname} ${hostname}
530 ... ignore_case=True msg=Hostname does not exist.