blob: ac97dfffeb9792369f10418b4ce052eeda30f3cd [file] [log] [blame]
Prashanth Katti8abbb4d2021-01-29 02:17:45 -06001*** Settings ***
2Documentation Network interface IPv6 configuration and verification
3 ... tests.
4
5Resource ../../lib/bmc_redfish_resource.robot
6Resource ../../lib/openbmc_ffdc.robot
7Resource ../../lib/bmc_ipv6_utils.robot
Sweta Potthuri8ba74322025-03-19 12:29:06 -05008Resource ../../lib/external_intf/vmi_utils.robot
Prashanth Katti8abbb4d2021-01-29 02:17:45 -06009Library ../../lib/bmc_network_utils.py
10Library Collections
11
12Test Setup Test Setup Execution
13Test Teardown Test Teardown Execution
Prashanth Katti3270fd02021-06-11 08:02:22 -050014Suite Setup Suite Setup Execution
Prashanth Katti8abbb4d2021-01-29 02:17:45 -060015
Matt Fischer6fb70d92023-10-24 19:06:33 -060016Test Tags BMC_IPv6
Prashanth Katti8abbb4d2021-01-29 02:17:45 -060017
18*** Variables ***
Sweta Potthuriafe858e2025-02-25 23:52:51 -060019${test_ipv6_addr} 2001:db8:3333:4444:5555:6666:7777:8888
20${test_ipv6_invalid_addr} 2001:db8:3333:4444:5555:6666:7777:JJKK
21${test_ipv6_addr1} 2001:db8:3333:4444:5555:6666:7777:9999
Prashanth Katti8abbb4d2021-01-29 02:17:45 -060022
George Keishinge16f1582022-12-15 07:32:21 -060023# Valid prefix length is a integer ranges from 1 to 128.
Sweta Potthuriafe858e2025-02-25 23:52:51 -060024${test_prefix_length} 64
Prashanth Katti8abbb4d2021-01-29 02:17:45 -060025
26*** Test Cases ***
27
28Get IPv6 Address And Verify
29 [Documentation] Get IPv6 Address And Verify.
30 [Tags] Get_IPv6_Address_And_Verify
31
32 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
33 Verify IPv6 On BMC ${ipv6_network_configuration['Address']}
34 END
35
36
Prashanth Katti2c73abc2021-03-17 07:42:25 -050037Get PrefixLength And Verify
38 [Documentation] Get IPv6 prefix length and verify.
39 [Tags] Get_PrefixLength_And_Verify
40
41 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
42 Verify IPv6 On BMC ${ipv6_network_configuration['PrefixLength']}
43 END
44
45
46Get IPv6 Default Gateway And Verify
George Keishing96143832021-03-23 07:55:08 -050047 [Documentation] Get IPv6 default gateway and verify.
George Keishingade6ab42022-07-19 11:41:03 -050048 [Tags] Get_IPv6_Default_Gateway_And_Verify
Prashanth Katti2c73abc2021-03-17 07:42:25 -050049
50 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
51 ${ipv6_gateway}= Get From Dictionary ${resp.dict} IPv6DefaultGateway
52 Verify IPv6 Default Gateway On BMC ${ipv6_gateway}
53
54
Prashanth Kattic1d2daa2022-07-26 03:53:06 -050055Verify All Configured IPv6 And PrefixLength On BMC
56 [Documentation] Verify IPv6 address and its prefix length on BMC.
57 [Tags] Verify_All_Configured_IPv6_And_PrefixLength_On_BMC
58
59 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
George Keishingf02ca2b2023-04-05 22:11:03 +053060 Verify IPv6 And PrefixLength ${ipv6_network_configuration['Address']}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -050061 ... ${ipv6_network_configuration['PrefixLength']}
62 END
63
64
65Configure IPv6 Address And Verify
66 [Documentation] Configure IPv6 address and verify.
67 [Tags] Configure_IPv6_Address_And_Verify
Anvesh-Kumar_Rayankula3a26c662025-04-16 01:19:26 -050068 [Teardown] Run Keywords
69 ... Delete IPv6 Address ${test_ipv6_addr} AND Test Teardown Execution
Prashanth Kattic1d2daa2022-07-26 03:53:06 -050070 [Template] Configure IPv6 Address On BMC
71
72
73 # IPv6 address Prefix length
74 ${test_ipv6_addr} ${test_prefix_length}
75
76
Prashanth Katti12ed4b72023-05-16 05:24:00 -050077Delete IPv6 Address And Verify
78 [Documentation] Delete IPv6 address and verify.
79 [Tags] Delete_IPv6_Address_And_Verify
80
81 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
82
83 Delete IPv6 Address ${test_ipv6_addr}
84
85
Prashanth Katti5f7d2e42023-05-22 03:17:25 -050086
George Keishingcc288312024-10-22 10:13:12 +053087Modify IPv6 Address And Verify
Prashanth Katti5f7d2e42023-05-22 03:17:25 -050088 [Documentation] Modify IPv6 address and verify.
89 [Tags] Modify_IPv6_Address_And_Verify
kvishal88de8c42025-03-04 01:45:10 -060090 [Teardown] Run Keywords
George Keishingcfdd0992025-03-17 11:59:20 +053091 ... Delete IPv6 Address ${test_ipv6_addr1} AND Test Teardown Execution
Prashanth Katti5f7d2e42023-05-22 03:17:25 -050092
93 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
94
95 Modify IPv6 Address ${test_ipv6_addr} ${test_ipv6_addr1} ${test_prefix_length}
96
97
Sweta Potthuriafe858e2025-02-25 23:52:51 -060098Verify Persistency Of IPv6 After BMC Reboot
99 [Documentation] Verify persistency of IPv6 after BMC reboot.
100 [Tags] Verify_Persistency_Of_IPv6_After_BMC_Reboot
101 [Teardown] Run Keywords
102 ... Delete IPv6 Address ${test_ipv6_addr} AND Test Teardown Execution
103
104 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
105
106 Redfish OBMC Reboot (off) stack_mode=skip
107
108 # Verifying persistency of IPv6.
109 Verify IPv6 On BMC ${test_ipv6_addr}
110
111
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500112Enable SLAACv6 On BMC And Verify
113 [Documentation] Enable SLAACv6 on BMC and verify.
114 [Tags] Enable_SLAACv6_On_BMC_And_Verify
115
116 Set SLAACv6 Configuration State And Verify ${True}
117
118
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500119Enable DHCPv6 Property On BMC And Verify
120 [Documentation] Enable DHCPv6 property on BMC and verify.
121 [Tags] Enable_DHCPv6_Property_On_BMC_And_Verify
122
123 Set And Verify DHCPv6 Property Enabled
124
kvishal0d199a92025-05-29 02:35:18 -0500125Disable DHCPv6 Property On BMC And Verify
126 [Documentation] Disable DHCPv6 property on BMC and verify.
127 [Tags] Disable_DHCPv6_Property_On_BMC_And_Verify
128
129 Set And Verify DHCPv6 Property Disabled
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500130
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500131Configure Invalid Static IPv6 And Verify
132 [Documentation] Configure invalid static IPv6 and verify.
133 [Tags] Configure_Invalid_Static_IPv6_And_Verify
134 [Template] Configure IPv6 Address On BMC
135
136 #invalid_ipv6 prefix length valid_status_code
137 ${ipv4_hexword_addr} ${test_prefix_length} ${HTTP_BAD_REQUEST}
138
139
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600140*** Keywords ***
141
Prashanth Katti3270fd02021-06-11 08:02:22 -0500142Suite Setup Execution
143 [Documentation] Do suite setup execution.
144
145 ${active_channel_config}= Get Active Channel Config
146 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
147
148 Set Suite variable ${ethernet_interface}
149
150
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600151Test Setup Execution
152 [Documentation] Test setup execution.
153
154 Redfish.Login
155
156 @{ipv6_network_configurations}= Get IPv6 Network Configuration
157 Set Test Variable @{ipv6_network_configurations}
158
159 # Get BMC IPv6 address and prefix length.
160 ${ipv6_data}= Get BMC IPv6 Info
161 Set Test Variable ${ipv6_data}
162
163
164Test Teardown Execution
165 [Documentation] Test teardown execution.
166
167 FFDC On Test Case Fail
168 Redfish.Logout
169
170
171Get IPv6 Network Configuration
172 [Documentation] Get Ipv6 network configuration.
173 # Sample output:
174 # {
ganesanb4d430282023-04-27 14:33:23 +0000175 # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0",
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600176 # "@odata.type": "#EthernetInterface.v1_4_1.EthernetInterface",
177 # "DHCPv4": {
178 # "DHCPEnabled": false,
179 # "UseDNSServers": false,
180 # "UseDomainName": true,
181 # "UseNTPServers": false
182 # },
183 # "DHCPv6": {
184 # "OperatingMode": "Disabled",
185 # "UseDNSServers": false,
186 # "UseDomainName": true,
187 # "UseNTPServers": false
188 # },
189 # "Description": "Management Network Interface",
190 # "FQDN": "localhost",
191 # "HostName": "localhost",
192 # "IPv4Addresses": [
193 # {
194 # "Address": "xx.xx.xx.xx",
195 # "AddressOrigin": "Static",
196 # "Gateway": "xx.xx.xx.1",
197 # "SubnetMask": "xx.xx.xx.0"
198 # },
199 # {
200 # "Address": "169.254.xx.xx",
201 # "AddressOrigin": "IPv4LinkLocal",
202 # "Gateway": "0.0.0.0",
203 # "SubnetMask": "xx.xx.0.0"
204 # },
205 # ],
206 # "IPv4StaticAddresses": [
207 # {
208 # "Address": "xx.xx.xx.xx",
209 # "AddressOrigin": "Static",
210 # "Gateway": "xx.xx.xx.1",
211 # "SubnetMask": "xx.xx.0.0"
212 # }
213 # }
214 # ],
215 # "IPv6AddressPolicyTable": [],
216 # "IPv6Addresses": [
217 # {
218 # "Address": "fe80::xxxx:xxxx:xxxx:xxxx",
219 # "AddressOrigin": "LinkLocal",
220 # "AddressState": null,
221 # "PrefixLength": xx
222 # }
223 # ],
224 # "IPv6DefaultGateway": "",
225 # "IPv6StaticAddresses": [
226 # { "Address": "xxxx:xxxx:xxxx:xxxx::xxxx",
227 # "AddressOrigin": "Static",
228 # "AddressState": null,
229 # "PrefixLength": xxx
230 # }
231 # ],
232 # "Id": "eth0",
233 # "InterfaceEnabled": true,
234 # "LinkStatus": "LinkUp",
235 # "MACAddress": "xx:xx:xx:xx:xx:xx",
236 # "Name": "Manager Ethernet Interface",
237 # "NameServers": [],
238 # "SpeedMbps": 0,
239 # "StaticNameServers": [],
240 # "Status": {
241 # "Health": "OK",
242 # "HealthRollup": "OK",
243 # "State": "Enabled"
244 # },
245 # "VLANs": {
ganesanb4d430282023-04-27 14:33:23 +0000246 # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0/VLANs"
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600247
248
249 ${active_channel_config}= Get Active Channel Config
250 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${CHANNEL_NUMBER}']['name']}
251
252 @{ipv6_network_configurations}= Get From Dictionary ${resp.dict} IPv6StaticAddresses
George Keishing409df052024-01-17 22:36:14 +0530253 RETURN @{ipv6_network_configurations}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500254
255
256Verify IPv6 And PrefixLength
257 [Documentation] Verify IPv6 address and prefix length on BMC.
258 [Arguments] ${ipv6_addr} ${prefix_len}
259
260 # Description of the argument(s):
261 # ipv6_addr IPv6 address to be verified.
262 # prefix_len PrefixLength value to be verified.
263
264 # Catenate IPv6 address and its prefix length.
265 ${ipv6_with_prefix}= Catenate ${ipv6_addr}/${prefix_len}
266
267 # Get IPv6 address details on BMC using IP command.
268 @{ip_data}= Get BMC IPv6 Info
269
270 # Verify if IPv6 and prefix length is configured on BMC.
271
272 Should Contain ${ip_data} ${ipv6_with_prefix}
273 ... msg=IPv6 and prefix length pair does not exist.
274
275
276Configure IPv6 Address On BMC
277 [Documentation] Add IPv6 Address on BMC.
278 [Arguments] ${ipv6_addr} ${prefix_len} ${valid_status_codes}=${HTTP_OK}
279
280 # Description of argument(s):
281 # ipv6_addr IPv6 address to be added (e.g. "2001:EEEE:2222::2022").
282 # prefix_len Prefix length for the IPv6 to be added
283 # (e.g. "64").
284 # valid_status_codes Expected return code from patch operation
285 # (e.g. "200").
286
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500287 ${prefix_length}= Convert To Integer ${prefix_len}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500288 ${empty_dict}= Create Dictionary
289 ${ipv6_data}= Create Dictionary Address=${ipv6_addr}
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500290 ... PrefixLength=${prefix_length}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500291
292 ${patch_list}= Create List
293
294 # Get existing static IPv6 configurations on BMC.
295 ${ipv6_network_configurations}= Get IPv6 Network Configuration
296 ${num_entries}= Get Length ${ipv6_network_configurations}
297
298 FOR ${INDEX} IN RANGE 0 ${num_entries}
299 Append To List ${patch_list} ${empty_dict}
300 END
301
George Keishinge6e161e2025-05-08 10:18:30 +0530302 ${valid_status_codes}= Set Variable If '${valid_status_codes}' == '${HTTP_OK}'
303 ... ${HTTP_OK},${HTTP_NO_CONTENT}
304 ... ${valid_status_codes}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500305
306 # We need not check for existence of IPv6 on BMC while adding.
307 Append To List ${patch_list} ${ipv6_data}
308 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
309
310 ${active_channel_config}= Get Active Channel Config
311 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
312
313 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
314 ... valid_status_codes=[${valid_status_codes}]
315
316 Return From Keyword If '${valid_status_codes}' != '${HTTP_OK},${HTTP_NO_CONTENT}'
317
318 # Note: Network restart takes around 15-18s after patch request processing.
319 Sleep ${NETWORK_TIMEOUT}s
320 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
321
322 Verify IPv6 And PrefixLength ${ipv6_addr} ${prefix_len}
323
324 # Verify if existing static IPv6 addresses still exist.
325 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
326 Verify IPv6 On BMC ${ipv6_network_configuration['Address']}
327 END
328
329 Validate IPv6 Network Config On BMC
330
331
332Validate IPv6 Network Config On BMC
333 [Documentation] Check that IPv6 network info obtained via redfish matches info
334 ... obtained via CLI.
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500335 @{ipv6_network_configurations}= Get IPv6 Network Configuration
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500336 ${ipv6_data}= Get BMC IPv6 Info
337 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
338 Should Contain Match ${ipv6_data} ${ipv6_network_configuration['Address']}/*
339 ... msg=IPv6 address does not exist.
340 END
341
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500342
343Delete IPv6 Address
344 [Documentation] Delete IPv6 address of BMC.
Prashanth Kattibcb9dab2025-04-01 12:58:37 -0500345 [Arguments] ${ipv6_addr}
346 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500347
348 # Description of argument(s):
349 # ipv6_addr IPv6 address to be deleted (e.g. "2001:1234:1234:1234::1234").
350 # valid_status_codes Expected return code from patch operation
351 # (e.g. "200"). See prolog of rest_request
352 # method in redfish_plus.py for details.
353
354 ${empty_dict}= Create Dictionary
355 ${patch_list}= Create List
356
357 @{ipv6_network_configurations}= Get IPv6 Network Configuration
358 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
359 IF '${ipv6_network_configuration['Address']}' == '${ipv6_addr}'
360 Append To List ${patch_list} ${null}
361 ELSE
362 Append To List ${patch_list} ${empty_dict}
363 END
364 END
365
366 ${ip_found}= Run Keyword And Return Status List Should Contain Value
367 ... ${patch_list} ${null} msg=${ipv6_addr} does not exist on BMC
368 Pass Execution If ${ip_found} == ${False} ${ipv6_addr} does not exist on BMC
369
370 # Run patch command only if given IP is found on BMC
371 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
372
373 ${active_channel_config}= Get Active Channel Config
374 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
375
376 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
Sweta Potthuria1981612025-05-09 05:41:10 -0500377 ... valid_status_codes=${valid_status_codes}
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500378
379 # Note: Network restart takes around 15-18s after patch request processing
380 Sleep ${NETWORK_TIMEOUT}s
381 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
382
383 # IPv6 address that is deleted should not be there on BMC.
384 ${delete_status}= Run Keyword And Return Status Verify IPv6 On BMC ${ipv6_addr}
Anvesh-Kumar_Rayankula3a26c662025-04-16 01:19:26 -0500385 IF '${valid_status_codes}' == '[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]'
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500386 Should Be True '${delete_status}' == '${False}'
387 ELSE
388 Should Be True '${delete_status}' == '${True}'
389 END
390
391 Validate IPv6 Network Config On BMC
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500392
393
394Modify IPv6 Address
395 [Documentation] Modify and verify IPv6 address of BMC.
396 [Arguments] ${ipv6} ${new_ipv6} ${prefix_len}
397 ... ${valid_status_codes}=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
398
399 # Description of argument(s):
400 # ipv6 IPv6 address to be replaced (e.g. "2001:AABB:CCDD::AAFF").
401 # new_ipv6 New IPv6 address to be configured.
402 # prefix_len Prefix length value (Range 1 to 128).
403 # valid_status_codes Expected return code from patch operation
404 # (e.g. "200", "201").
405
406 ${empty_dict}= Create Dictionary
407 ${patch_list}= Create List
408 ${prefix_length}= Convert To Integer ${prefix_len}
409 ${ipv6_data}= Create Dictionary
410 ... Address=${new_ipv6} PrefixLength=${prefix_length}
411
412 # Sample IPv6 network configurations:
413 # "IPv6AddressPolicyTable": [],
414 # "IPv6Addresses": [
415 # {
416 # "Address": "X002:db8:0:2::XX0",
417 # "AddressOrigin": "DHCPv6",
418 # "PrefixLength": 128
419 # },
420 # {
421 # "Address": “X002:db8:0:2:a94:XXff:fe82:XXXX",
422 # "AddressOrigin": "SLAAC",
423 # "PrefixLength": 64
424 # },
425 # {
426 # "Address": “Y002:db8:0:2:a94:efff:fe82:5000",
427 # "AddressOrigin": "Static",
428 # "PrefixLength": 56
429 # },
430 # {
431 # "Address": “Z002:db8:0:2:a94:efff:fe82:5000",
432 # "AddressOrigin": "Static",
433 # "PrefixLength": 56
434 # },
435 # {
436 # "Address": “Xe80::a94:efff:YYYY:XXXX",
437 # "AddressOrigin": "LinkLocal",
438 # "PrefixLength": 64
439 # },
440 # {
441 # "Address": “X002:db8:1:2:eff:233:fee:546",
442 # "AddressOrigin": "Static",
443 # "PrefixLength": 56
444 # }
445 # ],
446 # "IPv6DefaultGateway": “XXXX::ab2e:80fe:87df:XXXX”,
447 # "IPv6StaticAddresses": [
448 # {
449 # "Address": “X002:db8:0:2:a94:efff:fe82:5000",
450 # "PrefixLength": 56
451 # },
452 # {
453 # "Address": “Y002:db8:0:2:a94:efff:fe82:5000",
454 # "PrefixLength": 56
455 # },
456 # {
457 # "Address": “Z002:db8:1:2:eff:233:fee:546",
458 # "PrefixLength": 56
459 # }
460 # ],
461 # "IPv6StaticDefaultGateways": [],
462
463 # Find the position of IPv6 address to be modified.
464 @{ipv6_network_configurations}= Get IPv6 Network Configuration
465 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
George Keishinge6e161e2025-05-08 10:18:30 +0530466 IF '${ipv6_network_configuration['Address']}' == '${ipv6}'
467 Append To List ${patch_list} ${ipv6_data}
468 ELSE
469 Append To List ${patch_list} ${empty_dict}
470 END
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500471 END
472
473 # Modify the IPv6 address only if given IPv6 is found
474 ${ip_found}= Run Keyword And Return Status List Should Contain Value
475 ... ${patch_list} ${ipv6_data} msg=${ipv6} does not exist on BMC
476 Pass Execution If ${ip_found} == ${False} ${ipv6} does not exist on BMC
477
478 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
479
480 ${active_channel_config}= Get Active Channel Config
481 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
482
483 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
484 ... body=&{data} valid_status_codes=${valid_status_codes}
485
486 # Note: Network restart takes around 15-18s after patch request processing.
487 Sleep ${NETWORK_TIMEOUT}s
488 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
489
490 # Verify if new IPv6 address is configured on BMC.
491 Verify IPv6 On BMC ${new_ipv6}
492
493 # Verify if old IPv6 address is erased.
494 ${cmd_status}= Run Keyword And Return Status
495 ... Verify IPv6 On BMC ${ipv6}
496 Should Be Equal ${cmd_status} ${False} msg=Old IPv6 address is not deleted.
497
498 Validate IPv6 Network Config On BMC
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500499
500
501Set SLAACv6 Configuration State And Verify
502 [Documentation] Set SLAACv6 configuration state and verify.
Sweta Potthuri610f86f2025-05-30 00:47:23 -0500503 [Arguments] ${slaac_state} ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500504
505 # Description of argument(s):
506 # slaac_state SLAACv6 state('True' or 'False').
507 # valid_status_code Expected valid status codes.
508
509 ${active_channel_config}= Get Active Channel Config
510 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
511
512 ${data}= Set Variable If ${slaac_state} == ${False} ${DISABLE_SLAAC} ${ENABLE_SLAAC}
513 ${resp}= Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
Sweta Potthuri610f86f2025-05-30 00:47:23 -0500514 ... body=${data} valid_status_codes=${valid_status_codes}
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500515
516 # Verify SLAACv6 is set correctly.
517 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
518 ${slaac_verify}= Get From Dictionary ${resp.dict} StatelessAddressAutoConfig
519
George Keishinge6e161e2025-05-08 10:18:30 +0530520 IF '${slaac_verify['IPv6AutoConfigEnabled']}' != '${slaac_state}'
521 Fail msg=SLAACv6 not set properly.
522 END
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500523
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500524
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500525Set And Verify DHCPv6 Property
526 [Documentation] Set DHCPv6 attribute and verify.
527 [Arguments] ${dhcpv6_operating_mode}=${Disabled}
528
529 # Description of argument(s):
530 # dhcpv6_operating_mode Enabled if user wants to enable DHCPv6('Enabled' or 'Disabled').
531
532 ${data}= Set Variable If '${dhcpv6_operating_mode}' == 'Disabled' ${DISABLE_DHCPv6} ${ENABLE_DHCPv6}
533 ${active_channel_config}= Get Active Channel Config
534 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
535
536 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
537 ... body=${data} valid_status_codes=[${HTTP_OK},${HTTP_NO_CONTENT}]
538
539 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
540 ${dhcpv6_verify}= Get From Dictionary ${resp.dict} DHCPv6
541
542 Should Be Equal '${dhcpv6_verify['OperatingMode']}' '${dhcpv6_operating_mode}'
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500543