blob: 10b45bf782cca85473783f607eec48fb1158f9bf [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
Sweta Potthuri2f3fbb52025-09-19 00:50:47 -05009Resource ../../lib/bmc_network_utils.robot
Prashanth Katti8abbb4d2021-01-29 02:17:45 -060010Library ../../lib/bmc_network_utils.py
11Library Collections
Sweta Potthuri35c503b2025-07-27 23:36:20 -050012Library Process
Prashanth Katti8abbb4d2021-01-29 02:17:45 -060013
Anvesh-Kumar_Rayankula019d9362025-09-03 22:55:12 -050014Test Setup Test Setup Execution
15Test Teardown Test Teardown Execution
16Suite Setup Suite Setup Execution
17Suite Teardown Redfish.Logout
Prashanth Katti8abbb4d2021-01-29 02:17:45 -060018
Matt Fischer6fb70d92023-10-24 19:06:33 -060019Test Tags BMC_IPv6
Prashanth Katti8abbb4d2021-01-29 02:17:45 -060020
21*** Variables ***
Sweta Potthuri2edacd32025-07-02 01:04:43 -050022${test_ipv6_addr} 2001:db8:3333:4444:5555:6666:7777:8888
23${test_ipv6_invalid_addr} 2001:db8:3333:4444:5555:6666:7777:JJKK
24${test_ipv6_addr1} 2001:db8:3333:4444:5555:6666:7777:9999
kvishal9c6774c2025-09-10 02:14:07 -050025${invalid_hexadec_ipv6} x:x:x:x:x:x:10.5.5.6
26${ipv6_multi_short} 2001::33::111
George Keishinge16f1582022-12-15 07:32:21 -060027# Valid prefix length is a integer ranges from 1 to 128.
Sweta Potthuri2edacd32025-07-02 01:04:43 -050028${test_prefix_length} 64
29${ipv6_gw_addr} 2002:903:15F:32:9:3:32:1
30${prefix_length_def} None
31${invalid_staticv6_gateway} 9.41.164.1
Sweta Potthuri2f3fbb52025-09-19 00:50:47 -050032${new_mac_addr} AA:E2:84:14:28:79
abhijith-1219e190dd2025-10-15 03:35:06 -050033${linklocal_addr_format} fe80::[0-9a-f:]+$
34${link_local_addr} fe80::
35${link_local_prefix_len} 10
Prashanth Katti8abbb4d2021-01-29 02:17:45 -060036
37*** Test Cases ***
38
39Get IPv6 Address And Verify
40 [Documentation] Get IPv6 Address And Verify.
41 [Tags] Get_IPv6_Address_And_Verify
42
43 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
44 Verify IPv6 On BMC ${ipv6_network_configuration['Address']}
45 END
46
47
Prashanth Katti2c73abc2021-03-17 07:42:25 -050048Get PrefixLength And Verify
49 [Documentation] Get IPv6 prefix length and verify.
50 [Tags] Get_PrefixLength_And_Verify
51
52 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
53 Verify IPv6 On BMC ${ipv6_network_configuration['PrefixLength']}
54 END
55
56
57Get IPv6 Default Gateway And Verify
George Keishing96143832021-03-23 07:55:08 -050058 [Documentation] Get IPv6 default gateway and verify.
George Keishingade6ab42022-07-19 11:41:03 -050059 [Tags] Get_IPv6_Default_Gateway_And_Verify
Prashanth Katti2c73abc2021-03-17 07:42:25 -050060
61 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
62 ${ipv6_gateway}= Get From Dictionary ${resp.dict} IPv6DefaultGateway
63 Verify IPv6 Default Gateway On BMC ${ipv6_gateway}
64
65
Prashanth Kattic1d2daa2022-07-26 03:53:06 -050066Verify All Configured IPv6 And PrefixLength On BMC
67 [Documentation] Verify IPv6 address and its prefix length on BMC.
68 [Tags] Verify_All_Configured_IPv6_And_PrefixLength_On_BMC
69
70 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
George Keishingf02ca2b2023-04-05 22:11:03 +053071 Verify IPv6 And PrefixLength ${ipv6_network_configuration['Address']}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -050072 ... ${ipv6_network_configuration['PrefixLength']}
73 END
74
75
76Configure IPv6 Address And Verify
77 [Documentation] Configure IPv6 address and verify.
78 [Tags] Configure_IPv6_Address_And_Verify
Anvesh-Kumar_Rayankula3a26c662025-04-16 01:19:26 -050079 [Teardown] Run Keywords
80 ... Delete IPv6 Address ${test_ipv6_addr} AND Test Teardown Execution
Prashanth Kattic1d2daa2022-07-26 03:53:06 -050081 [Template] Configure IPv6 Address On BMC
82
83
84 # IPv6 address Prefix length
85 ${test_ipv6_addr} ${test_prefix_length}
86
87
Prashanth Katti12ed4b72023-05-16 05:24:00 -050088Delete IPv6 Address And Verify
89 [Documentation] Delete IPv6 address and verify.
90 [Tags] Delete_IPv6_Address_And_Verify
91
92 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
93
94 Delete IPv6 Address ${test_ipv6_addr}
95
96
George Keishingcc288312024-10-22 10:13:12 +053097Modify IPv6 Address And Verify
Prashanth Katti5f7d2e42023-05-22 03:17:25 -050098 [Documentation] Modify IPv6 address and verify.
99 [Tags] Modify_IPv6_Address_And_Verify
kvishal88de8c42025-03-04 01:45:10 -0600100 [Teardown] Run Keywords
George Keishingcfdd0992025-03-17 11:59:20 +0530101 ... Delete IPv6 Address ${test_ipv6_addr1} AND Test Teardown Execution
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500102
103 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
104
105 Modify IPv6 Address ${test_ipv6_addr} ${test_ipv6_addr1} ${test_prefix_length}
106
107
Sweta Potthuriafe858e2025-02-25 23:52:51 -0600108Verify Persistency Of IPv6 After BMC Reboot
109 [Documentation] Verify persistency of IPv6 after BMC reboot.
110 [Tags] Verify_Persistency_Of_IPv6_After_BMC_Reboot
111 [Teardown] Run Keywords
112 ... Delete IPv6 Address ${test_ipv6_addr} AND Test Teardown Execution
113
114 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
115
116 Redfish OBMC Reboot (off) stack_mode=skip
117
118 # Verifying persistency of IPv6.
119 Verify IPv6 On BMC ${test_ipv6_addr}
120
121
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500122Enable SLAAC On BMC And Verify
123 [Documentation] Enable SLAAC on BMC and verify.
124 [Tags] Enable_SLAAC_On_BMC_And_Verify
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500125
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500126 Set SLAAC Configuration State And Verify ${True}
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500127
128
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500129Enable DHCPv6 Property On BMC And Verify
130 [Documentation] Enable DHCPv6 property on BMC and verify.
131 [Tags] Enable_DHCPv6_Property_On_BMC_And_Verify
132
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500133 Set And Verify DHCPv6 Property Enabled
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500134
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500135
kvishal0d199a92025-05-29 02:35:18 -0500136Disable DHCPv6 Property On BMC And Verify
137 [Documentation] Disable DHCPv6 property on BMC and verify.
138 [Tags] Disable_DHCPv6_Property_On_BMC_And_Verify
139
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500140 Set And Verify DHCPv6 Property Disabled
kvishalbd04bd62025-08-05 03:57:53 -0500141
142
143Verify Persistency Of DHCPv6 On Reboot
144 [Documentation] Verify persistency of DHCPv6 property on reboot.
145 [Tags] Verify_Persistency_Of_DHCPv6_On_Reboot
146
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500147 Set And Verify DHCPv6 Property Enabled
148 Redfish OBMC Reboot (off) stack_mode=skip
149 Verify DHCPv6 Property Enabled
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500150
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500151
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500152Configure Invalid Static IPv6 And Verify
153 [Documentation] Configure invalid static IPv6 and verify.
154 [Tags] Configure_Invalid_Static_IPv6_And_Verify
155 [Template] Configure IPv6 Address On BMC
156
kvishal9c6774c2025-09-10 02:14:07 -0500157 #invalid_ipv6 prefix length valid_status_code
158 ${ipv4_hexword_addr} ${test_prefix_length} ${HTTP_BAD_REQUEST}
159 ${invalid_hexadec_ipv6} ${test_prefix_length} ${HTTP_BAD_REQUEST}
160 ${ipv6_multi_short} ${test_prefix_length} ${HTTP_BAD_REQUEST}
161
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500162
Sweta Potthuri565318d2025-06-09 06:13:46 -0500163
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500164Configure IPv6 Static Default Gateway And Verify
165 [Documentation] Configure IPv6 static default gateway and verify.
166 [Tags] Configure_IPv6_Static_Default_Gateway_And_Verify
167 [Template] Configure IPv6 Static Default Gateway On BMC
Sweta Potthuri565318d2025-06-09 06:13:46 -0500168
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500169 # static_def_gw prefix length valid_status_code
170 ${ipv6_gw_addr} ${prefix_length_def} ${HTTP_OK}
171 ${invalid_staticv6_gateway} ${test_prefix_length} ${HTTP_BAD_REQUEST}
Sweta Potthuri565318d2025-06-09 06:13:46 -0500172
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500173
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500174Modify Static Default Gateway And Verify
175 [Documentation] Modify static default gateway and verify.
176 [Tags] Modify_Static_Default_Gateway_And_Verify
177 [Setup] Configure IPv6 Static Default Gateway On BMC ${ipv6_gw_addr} ${prefix_length_def}
178
179 Modify IPv6 Static Default Gateway On BMC ${test_ipv6_addr1} ${prefix_length_def} ${HTTP_OK} ${ipv6_gw_addr}
180
181
Sweta Potthuri2d085732025-07-16 09:10:08 -0500182Delete IPv6 Static Default Gateway And Verify
183 [Documentation] Delete IPv6 static default gateway and verify.
184 [Tags] Delete_IPv6_Static_Default_Gateway_And_Verify
185 [Setup] Configure IPv6 Static Default Gateway On BMC ${ipv6_gw_addr} ${prefix_length_def}
186
187 Delete IPv6 Static Default Gateway ${ipv6_gw_addr}
188
189
Sweta Potthuri35c503b2025-07-27 23:36:20 -0500190Verify Coexistence Of Linklocalv6 And Static IPv6 On BMC
191 [Documentation] Verify linklocalv6 And static IPv6 both exist.
192 [Tags] Verify_Coexistence_Of_Linklocalv6_And_Static_IPv6_On_BMC
Anvesh-Kumar_Rayankula019d9362025-09-03 22:55:12 -0500193 [Setup] Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
194 [Teardown] Delete IPv6 Address ${test_ipv6_addr}
Sweta Potthuri35c503b2025-07-27 23:36:20 -0500195
196 Check Coexistence Of Linklocalv6 And Static IPv6
197
198
George Keishingbadb4c62025-09-18 16:14:12 +0530199Verify IPv6 Linklocal Address Is In Correct Format
200 [Documentation] Verify linklocal address has network part as fe80 and
201 ... host part as EUI64.
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -0500202 [Tags] Verify_IPv6_Linklocal_Address_Is_In_Correct_Format
203
204 Check If Linklocal Address Is In Correct Format
205
206
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500207Verify BMC Gets SLAAC Address On Enabling SLAAC
208 [Documentation] On enabling SLAAC verify SLAAC address comes up.
209 [Tags] Verify_BMC_Gets_SLAAC_Address_On_Enabling_SLAAC
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500210 [Setup] Set SLAAC Configuration State And Verify ${False}
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500211
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500212 Set SLAAC Configuration State And Verify ${True}
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500213 Sleep ${NETWORK_TIMEOUT}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500214 Check BMC Gets SLAAC Address
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500215
216
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500217Verify Enable And Disable SLAAC On Both Interfaces
218 [Documentation] Verify enable and disable SLAAC on both the interfaces.
219 [Tags] Verify_Enable_And_Disable_SLAAC_On_Both_Interfaces
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500220 [Setup] Get The Initial SLAAC Settings
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500221 [Template] Set And Verify SLAAC Property On Both Interfaces
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500222 [Teardown] Run Keywords Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1}
223 ... AND Set SLAAC Configuration State And Verify ${slaac_channel_2} [${HTTP_OK}] ${2}
224
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500225 # slaac_eth0 slaac_eth1
226 ${True} ${True}
227 ${True} ${False}
228 ${False} ${True}
229 ${False} ${False}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500230
231
Sweta Potthuri425713a2025-10-16 00:28:20 -0500232Configure And Validate DHCPv6 Settings On Both Network Interfaces
233 [Documentation] Configure and validate the DHCPv6 enable/disable settings
234 ... on both network interfaces.
235 [Tags] Configure_And_Validate_DHCPv6_Settings_On_Both_Network_Interfaces
236 [Setup] Get The Initial DHCPv6 Settings
237 [Template] Set And Verify DHCPv6 Property On Both Interfaces
238 [Teardown] Run Keywords Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1} AND
239 ... Set And Verify DHCPv6 Property ${dhcpv6_channel_2} ${2}
240
241 # DHCPv6_eth0 DHCPv6_eth1
242 Enabled Enabled
243 Enabled Disabled
244 Disabled Enabled
245 Disabled Disabled
246
247
abhijith-1213a645902025-09-08 01:12:34 -0500248Verify Autoconfig Is Present On Ethernet Interface
249 [Documentation] Verify autoconfig is present on ethernet interface.
250 [Tags] Verify_Autoconfig_Is_Present_On_Ethernet_Interface
251
252 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
253 Should Contain ${resp.dict} StatelessAddressAutoConfig
254
255
Sweta Potthurif3d188f2025-09-08 07:17:31 -0500256Verify Interface ID Of SLAAC And LinkLocal Addresses Are Same
257 [Documentation] Validate interface id of SLAAC and link-local addresses are same.
258 [Tags] Verify_Interface_ID_Of_SLAAC_And_LinkLocal_Addresses_Are_Same
259
260 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
261 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= Get Address Origin List And Address For Type SLAAC
262
263 ${linklocal_interface_id}= Get Interface ID Of IPv6 ${ipv6_linklocal_addr}
264 ${slaac_interface_id}= Get Interface ID Of IPv6 ${ipv6_slaac_addr}
265
266 Should Be Equal ${linklocal_interface_id} ${slaac_interface_id}
267
268
abhijith-121c3e96d72025-09-09 11:35:09 -0500269Verify Persistency Of Link Local IPv6 On BMC Reboot
270 [Documentation] Verify persistency of link local on BMC reboot.
271 [Tags] Verify_Persistency_Of_Link_Local_IPv6_On_BMC_Reboot
272
273 # Capturing the linklocal before reboot.
274 @{ipv6_address_origin_list} ${linklocal_addr_before_reboot}=
275 ... Get Address Origin List And Address For Type LinkLocal
276
277 # Rebooting BMC.
278 Redfish OBMC Reboot (off) stack_mode=skip
279
280 @{ipv6_address_origin_list} ${linklocal_addr_after_reboot}=
281 ... Get Address Origin List And Address For Type LinkLocal
282
283 # Verifying the linklocal must be the same before and after reboot.
284 Should Be Equal ${linklocal_addr_before_reboot} ${linklocal_addr_after_reboot}
285 ... msg=IPv6 Linklocal address has changed after reboot.
286
287
Sweta Potthuri2f3fbb52025-09-19 00:50:47 -0500288Modify MAC and Verify BMC Reinitializing Linklocal
289 [Documentation] Modify MAC and verify BMC reinitializing linklocal.
290 [Tags] Modify_MAC_and_Verify_BMC_Reinitializing_Linklocal
291 [Teardown] Configure MAC Settings ${original_address}
292
293 ${original_address}= Get BMC MAC Address
294 @{ipv6_addressorigin_list} ${ipv6_before_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
295
296 # Modify MAC Address Of Ethernet Interface.
297 Configure MAC Settings ${new_mac_addr}
298 Sleep 30s
299 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
300 @{ipv6_addressorigin_list} ${ipv6_linklocal_after_addr}= Get Address Origin List And Address For Type LinkLocal
301
302 # Verify whether the linklocal has changed and is in the the correct format.
303 Check If Linklocal Address Is In Correct Format
304 Should Not Be Equal ${ipv6_before_linklocal_addr} ${ipv6_linklocal_after_addr}
305
306
abhijith-121bfbd03a2025-09-15 01:40:35 -0500307Add Multiple IPv6 Address And Verify
308 [Documentation] Add multiple IPv6 address and verify.
309 [Tags] Add_Multiple_IPv6_Address_And_Verify
310 [Teardown] Run Keywords
311 ... Delete IPv6 Address ${test_ipv6_addr} AND Delete IPv6 Address ${test_ipv6_addr1}
312 ... AND Test Teardown Execution
313
314 Configure Multiple IPv6 Address on BMC ${test_prefix_length}
315
316
abhijith-12197078c52025-09-25 01:13:00 -0500317Verify Coexistence Of Static IPv6 And SLAAC On BMC
abhijith-1214dc01a02025-09-24 11:29:55 -0500318 [Documentation] Verify static IPv6 And SLAAC both coexist.
abhijith-12197078c52025-09-25 01:13:00 -0500319 [Tags] Verify_Coexistence_Of_Static_IPv6_And_SLAAC_On_BMC
320 [Setup] Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
321 Set SLAAC Configuration State And Verify ${True}
322 [Teardown] Delete IPv6 Address ${test_ipv6_addr}
323
324 Sleep ${NETWORK_TIMEOUT}s
325
326 Check Coexistence Of Static IPv6 And SLAAC
327
328
abhijith-1218ff5db42025-09-24 06:24:03 -0500329Verify Coexistence Of Link Local And DHCPv6 On BMC
330 [Documentation] Verify link local And dhcpv6 both coexist.
331 [Tags] Verify_Coexistence_Of_Link_Local_And_DHCPv6_On_BMC
332 [Setup] Set DHCPv6 Property Enabled ${2}
333
334 Sleep ${NETWORK_TIMEOUT}s
335
336 Check Coexistence Of Link Local And DHCPv6
337
338
abhijith-1214dc01a02025-09-24 11:29:55 -0500339Verify Coexistence Of Link Local And SLAAC On BMC
340 [Documentation] Verify link local And SLAAC both coexist.
341 [Tags] Verify_Coexistence_Of_Link_Local_And_SLAAC_On_BMC
342 [Setup] Set SLAAC Configuration State And Verify ${True}
343
344 Sleep ${NETWORK_TIMEOUT}s
345
346 Check Coexistence Of Link Local And SLAAC
347
348
abhijith-121ffea1912025-10-06 02:39:22 -0500349Verify Coexistence Of All IPv6 Type Addresses On BMC
350 [Documentation] Verify coexistence of link local, static, DHCPv6 and SLAAC ipv6 addresses.
351 [Tags] Verify_Coexistence_Of_All_IPv6_Type_Addresses_On_BMC
352 [Setup] Run Keywords Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
353 ... AND Get The Initial DHCPv6 Setting On Each Interface ${1}
354 ... AND Set And Verify DHCPv6 Property Enabled
355 ... AND Get The Initial SLAAC Setting On Each Interface ${1}
356 ... AND Set SLAAC Configuration State And Verify ${True}
357 [Teardown] Run Keywords Delete IPv6 Address ${test_ipv6_addr}
358 ... AND Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1}
359 ... AND Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1}
360
361 Sleep ${NETWORK_TIMEOUT}s
362
363 # Verify link local, static, DHCPv6 and SLAAC ipv6 addresses coexist.
364 Verify The Coexistence Of The Address Type LinkLocal Static DHCPv6 SLAAC
365
366
abhijith-1219e190dd2025-10-15 03:35:06 -0500367Configure Link Local IPv6 Address And Verify
368 [Documentation] Configure link local IPv6 address and verify.
369 [Tags] Configure_Link_Local_IPv6_Address_And_Verify
370
371 Configure IPv6 Address On BMC ${link_local_addr} ${link_local_prefix_len}
372
373 # Verify the address origin contains link local.
374 @{ipv6_address_origin_list} ${ipv6_link_local_addr}=
375 ... Get Address Origin List And Address For Type LinkLocal
376
377 ${count}= Evaluate ${ipv6_address_origin_list}.count("LinkLocal")
378
379 Should Be Equal As Integers ${count} 2
380
381
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600382*** Keywords ***
383
Prashanth Katti3270fd02021-06-11 08:02:22 -0500384Suite Setup Execution
385 [Documentation] Do suite setup execution.
386
Anvesh-Kumar_Rayankula019d9362025-09-03 22:55:12 -0500387 Redfish.Login
Prashanth Katti3270fd02021-06-11 08:02:22 -0500388 ${active_channel_config}= Get Active Channel Config
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -0500389 Set Suite Variable ${active_channel_config}
390
Prashanth Katti3270fd02021-06-11 08:02:22 -0500391 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
392
393 Set Suite variable ${ethernet_interface}
394
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500395 # Get initial IPv4 and IPv6 addresses and address origins for eth0.
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500396 ${initial_ipv4_addressorigin_list} ${initial_ipv4_addr_list}= Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses
397 ${initial_ipv6_addressorigin_list} ${initial_ipv6_addr_list}= Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses
398
399 Set Suite Variable ${initial_ipv4_addressorigin_list}
400 Set Suite Variable ${initial_ipv4_addr_list}
401 Set Suite Variable ${initial_ipv6_addressorigin_list}
402 Set Suite Variable ${initial_ipv6_addr_list}
403
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500404 # Get initial IPv4 and IPv6 addresses and address origins for eth1.
405 ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}=
406 ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${2}
407 ${eth1_initial_ipv6_addressorigin_list} ${eth1_initial_ipv6_addr_list}=
408 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${2}
409 Set Suite Variable ${eth1_initial_ipv4_addressorigin_list}
410 Set Suite Variable ${eth1_initial_ipv4_addr_list}
411 Set Suite Variable ${eth1_initial_ipv6_addressorigin_list}
412 Set Suite Variable ${eth1_initial_ipv6_addr_list}
413
Prashanth Katti3270fd02021-06-11 08:02:22 -0500414
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600415Test Setup Execution
416 [Documentation] Test setup execution.
417
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600418 @{ipv6_network_configurations}= Get IPv6 Network Configuration
419 Set Test Variable @{ipv6_network_configurations}
420
421 # Get BMC IPv6 address and prefix length.
422 ${ipv6_data}= Get BMC IPv6 Info
423 Set Test Variable ${ipv6_data}
424
425
426Test Teardown Execution
427 [Documentation] Test teardown execution.
428
429 FFDC On Test Case Fail
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600430
431
432Get IPv6 Network Configuration
433 [Documentation] Get Ipv6 network configuration.
434 # Sample output:
435 # {
ganesanb4d430282023-04-27 14:33:23 +0000436 # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0",
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600437 # "@odata.type": "#EthernetInterface.v1_4_1.EthernetInterface",
438 # "DHCPv4": {
439 # "DHCPEnabled": false,
440 # "UseDNSServers": false,
441 # "UseDomainName": true,
442 # "UseNTPServers": false
443 # },
444 # "DHCPv6": {
445 # "OperatingMode": "Disabled",
446 # "UseDNSServers": false,
447 # "UseDomainName": true,
448 # "UseNTPServers": false
449 # },
450 # "Description": "Management Network Interface",
451 # "FQDN": "localhost",
452 # "HostName": "localhost",
453 # "IPv4Addresses": [
454 # {
455 # "Address": "xx.xx.xx.xx",
456 # "AddressOrigin": "Static",
457 # "Gateway": "xx.xx.xx.1",
458 # "SubnetMask": "xx.xx.xx.0"
459 # },
460 # {
461 # "Address": "169.254.xx.xx",
462 # "AddressOrigin": "IPv4LinkLocal",
463 # "Gateway": "0.0.0.0",
464 # "SubnetMask": "xx.xx.0.0"
465 # },
466 # ],
467 # "IPv4StaticAddresses": [
468 # {
469 # "Address": "xx.xx.xx.xx",
470 # "AddressOrigin": "Static",
471 # "Gateway": "xx.xx.xx.1",
472 # "SubnetMask": "xx.xx.0.0"
473 # }
474 # }
475 # ],
476 # "IPv6AddressPolicyTable": [],
477 # "IPv6Addresses": [
478 # {
479 # "Address": "fe80::xxxx:xxxx:xxxx:xxxx",
480 # "AddressOrigin": "LinkLocal",
481 # "AddressState": null,
482 # "PrefixLength": xx
483 # }
484 # ],
485 # "IPv6DefaultGateway": "",
486 # "IPv6StaticAddresses": [
487 # { "Address": "xxxx:xxxx:xxxx:xxxx::xxxx",
488 # "AddressOrigin": "Static",
489 # "AddressState": null,
490 # "PrefixLength": xxx
491 # }
492 # ],
493 # "Id": "eth0",
494 # "InterfaceEnabled": true,
495 # "LinkStatus": "LinkUp",
496 # "MACAddress": "xx:xx:xx:xx:xx:xx",
497 # "Name": "Manager Ethernet Interface",
498 # "NameServers": [],
499 # "SpeedMbps": 0,
500 # "StaticNameServers": [],
501 # "Status": {
502 # "Health": "OK",
503 # "HealthRollup": "OK",
504 # "State": "Enabled"
505 # },
506 # "VLANs": {
ganesanb4d430282023-04-27 14:33:23 +0000507 # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0/VLANs"
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600508
509
510 ${active_channel_config}= Get Active Channel Config
511 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${CHANNEL_NUMBER}']['name']}
512
513 @{ipv6_network_configurations}= Get From Dictionary ${resp.dict} IPv6StaticAddresses
George Keishing409df052024-01-17 22:36:14 +0530514 RETURN @{ipv6_network_configurations}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500515
516
517Verify IPv6 And PrefixLength
518 [Documentation] Verify IPv6 address and prefix length on BMC.
519 [Arguments] ${ipv6_addr} ${prefix_len}
520
521 # Description of the argument(s):
522 # ipv6_addr IPv6 address to be verified.
523 # prefix_len PrefixLength value to be verified.
524
525 # Catenate IPv6 address and its prefix length.
526 ${ipv6_with_prefix}= Catenate ${ipv6_addr}/${prefix_len}
527
528 # Get IPv6 address details on BMC using IP command.
529 @{ip_data}= Get BMC IPv6 Info
530
531 # Verify if IPv6 and prefix length is configured on BMC.
532
533 Should Contain ${ip_data} ${ipv6_with_prefix}
534 ... msg=IPv6 and prefix length pair does not exist.
535
536
537Configure IPv6 Address On BMC
538 [Documentation] Add IPv6 Address on BMC.
539 [Arguments] ${ipv6_addr} ${prefix_len} ${valid_status_codes}=${HTTP_OK}
540
541 # Description of argument(s):
542 # ipv6_addr IPv6 address to be added (e.g. "2001:EEEE:2222::2022").
543 # prefix_len Prefix length for the IPv6 to be added
544 # (e.g. "64").
545 # valid_status_codes Expected return code from patch operation
546 # (e.g. "200").
547
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500548 ${prefix_length}= Convert To Integer ${prefix_len}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500549 ${empty_dict}= Create Dictionary
550 ${ipv6_data}= Create Dictionary Address=${ipv6_addr}
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500551 ... PrefixLength=${prefix_length}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500552
553 ${patch_list}= Create List
554
555 # Get existing static IPv6 configurations on BMC.
556 ${ipv6_network_configurations}= Get IPv6 Network Configuration
557 ${num_entries}= Get Length ${ipv6_network_configurations}
558
559 FOR ${INDEX} IN RANGE 0 ${num_entries}
560 Append To List ${patch_list} ${empty_dict}
561 END
562
George Keishinge6e161e2025-05-08 10:18:30 +0530563 ${valid_status_codes}= Set Variable If '${valid_status_codes}' == '${HTTP_OK}'
564 ... ${HTTP_OK},${HTTP_NO_CONTENT}
565 ... ${valid_status_codes}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500566
567 # We need not check for existence of IPv6 on BMC while adding.
568 Append To List ${patch_list} ${ipv6_data}
569 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
570
571 ${active_channel_config}= Get Active Channel Config
572 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
573
574 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
575 ... valid_status_codes=[${valid_status_codes}]
576
577 Return From Keyword If '${valid_status_codes}' != '${HTTP_OK},${HTTP_NO_CONTENT}'
578
579 # Note: Network restart takes around 15-18s after patch request processing.
580 Sleep ${NETWORK_TIMEOUT}s
581 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
582
583 Verify IPv6 And PrefixLength ${ipv6_addr} ${prefix_len}
584
585 # Verify if existing static IPv6 addresses still exist.
586 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
587 Verify IPv6 On BMC ${ipv6_network_configuration['Address']}
588 END
589
590 Validate IPv6 Network Config On BMC
591
592
abhijith-121bfbd03a2025-09-15 01:40:35 -0500593Configure Multiple IPv6 Address on BMC
594 [Documentation] Add multiple IPv6 address on BMC.
595 [Arguments] ${prefix_len}
596 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_NO_CONTENT}]
597
598 # Description of argument(s):
599 # prefix_len Prefix length for the IPv6 to be added
600 # (e.g. "64").
601 # valid_status_codes Expected return code from patch operation
602 # (e.g. "200").
603
604 ${ipv6_list}= Create List ${test_ipv6_addr} ${test_ipv6_addr1}
605 ${prefix_length}= Convert To Integer ${prefix_len}
606 ${empty_dict}= Create Dictionary
607 ${patch_list}= Create List
608
609 # Get existing static IPv6 configurations on BMC.
610 ${ipv6_network_configurations}= Get IPv6 Network Configuration
611 ${num_entries}= Get Length ${ipv6_network_configurations}
612
613 FOR ${INDEX} IN RANGE 0 ${num_entries}
614 Append To List ${patch_list} ${empty_dict}
615 END
616
617 # We need not check for existence of IPv6 on BMC while adding.
618 FOR ${ipv6_addr} IN @{ipv6_list}
619 ${ipv6_data}= Create Dictionary Address=${ipv6_addr} PrefixLength=${prefix_length}
620 Append To List ${patch_list} ${ipv6_data}
621 END
622 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
623
624 ${active_channel_config}= Get Active Channel Config
625 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
626
627 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
628 ... valid_status_codes=${valid_status_codes}
629
630 IF ${valid_status_codes} != [${HTTP_OK}, ${HTTP_NO_CONTENT}]
631 Fail msg=Static address not added correctly
632 END
633
634 # Note: Network restart takes around 15-18s after patch request processing.
635 Sleep ${NETWORK_TIMEOUT}s
636 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
637
638 # Verify newly added ip address on CLI.
639 FOR ${ipv6_addr} IN @{ipv6_list}
640 Verify IPv6 And PrefixLength ${ipv6_addr} ${prefix_len}
641 END
642
643 # Verify if existing static IPv6 addresses still exist.
644 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
645 Verify IPv6 On BMC ${ipv6_network_configuration['Address']}
646 END
647
648 # Get the latest ipv6 network configurations.
649 @{ipv6_network_configurations}= Get IPv6 Network Configuration
650
651 # Verify newly added ip address on BMC.
652 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
653 Should Contain Match ${ipv6_list} ${ipv6_network_configuration['Address']}
654 END
655
656 Validate IPv6 Network Config On BMC
657
658
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500659Validate IPv6 Network Config On BMC
660 [Documentation] Check that IPv6 network info obtained via redfish matches info
661 ... obtained via CLI.
Sridevi Rameshed94c692025-09-07 23:41:10 -0500662
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500663 @{ipv6_network_configurations}= Get IPv6 Network Configuration
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500664 ${ipv6_data}= Get BMC IPv6 Info
665 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
666 Should Contain Match ${ipv6_data} ${ipv6_network_configuration['Address']}/*
667 ... msg=IPv6 address does not exist.
668 END
669
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500670
671Delete IPv6 Address
672 [Documentation] Delete IPv6 address of BMC.
Prashanth Kattibcb9dab2025-04-01 12:58:37 -0500673 [Arguments] ${ipv6_addr}
674 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500675
676 # Description of argument(s):
677 # ipv6_addr IPv6 address to be deleted (e.g. "2001:1234:1234:1234::1234").
678 # valid_status_codes Expected return code from patch operation
679 # (e.g. "200"). See prolog of rest_request
680 # method in redfish_plus.py for details.
681
682 ${empty_dict}= Create Dictionary
683 ${patch_list}= Create List
684
685 @{ipv6_network_configurations}= Get IPv6 Network Configuration
686 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
687 IF '${ipv6_network_configuration['Address']}' == '${ipv6_addr}'
688 Append To List ${patch_list} ${null}
689 ELSE
690 Append To List ${patch_list} ${empty_dict}
691 END
692 END
693
694 ${ip_found}= Run Keyword And Return Status List Should Contain Value
695 ... ${patch_list} ${null} msg=${ipv6_addr} does not exist on BMC
696 Pass Execution If ${ip_found} == ${False} ${ipv6_addr} does not exist on BMC
697
698 # Run patch command only if given IP is found on BMC
699 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
700
701 ${active_channel_config}= Get Active Channel Config
702 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
703
704 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
Sweta Potthuria1981612025-05-09 05:41:10 -0500705 ... valid_status_codes=${valid_status_codes}
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500706
707 # Note: Network restart takes around 15-18s after patch request processing
708 Sleep ${NETWORK_TIMEOUT}s
709 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
710
711 # IPv6 address that is deleted should not be there on BMC.
712 ${delete_status}= Run Keyword And Return Status Verify IPv6 On BMC ${ipv6_addr}
Anvesh-Kumar_Rayankula3a26c662025-04-16 01:19:26 -0500713 IF '${valid_status_codes}' == '[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]'
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500714 Should Be True '${delete_status}' == '${False}'
715 ELSE
716 Should Be True '${delete_status}' == '${True}'
717 END
718
719 Validate IPv6 Network Config On BMC
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500720
721
722Modify IPv6 Address
723 [Documentation] Modify and verify IPv6 address of BMC.
724 [Arguments] ${ipv6} ${new_ipv6} ${prefix_len}
725 ... ${valid_status_codes}=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
726
727 # Description of argument(s):
728 # ipv6 IPv6 address to be replaced (e.g. "2001:AABB:CCDD::AAFF").
729 # new_ipv6 New IPv6 address to be configured.
730 # prefix_len Prefix length value (Range 1 to 128).
731 # valid_status_codes Expected return code from patch operation
732 # (e.g. "200", "201").
733
734 ${empty_dict}= Create Dictionary
735 ${patch_list}= Create List
736 ${prefix_length}= Convert To Integer ${prefix_len}
737 ${ipv6_data}= Create Dictionary
738 ... Address=${new_ipv6} PrefixLength=${prefix_length}
739
740 # Sample IPv6 network configurations:
741 # "IPv6AddressPolicyTable": [],
742 # "IPv6Addresses": [
743 # {
744 # "Address": "X002:db8:0:2::XX0",
745 # "AddressOrigin": "DHCPv6",
746 # "PrefixLength": 128
747 # },
748 # {
749 # "Address": “X002:db8:0:2:a94:XXff:fe82:XXXX",
750 # "AddressOrigin": "SLAAC",
751 # "PrefixLength": 64
752 # },
753 # {
754 # "Address": “Y002:db8:0:2:a94:efff:fe82:5000",
755 # "AddressOrigin": "Static",
756 # "PrefixLength": 56
757 # },
758 # {
759 # "Address": “Z002:db8:0:2:a94:efff:fe82:5000",
760 # "AddressOrigin": "Static",
761 # "PrefixLength": 56
762 # },
763 # {
764 # "Address": “Xe80::a94:efff:YYYY:XXXX",
765 # "AddressOrigin": "LinkLocal",
766 # "PrefixLength": 64
767 # },
768 # {
769 # "Address": “X002:db8:1:2:eff:233:fee:546",
770 # "AddressOrigin": "Static",
771 # "PrefixLength": 56
772 # }
773 # ],
774 # "IPv6DefaultGateway": “XXXX::ab2e:80fe:87df:XXXX”,
775 # "IPv6StaticAddresses": [
776 # {
777 # "Address": “X002:db8:0:2:a94:efff:fe82:5000",
778 # "PrefixLength": 56
779 # },
780 # {
781 # "Address": “Y002:db8:0:2:a94:efff:fe82:5000",
782 # "PrefixLength": 56
783 # },
784 # {
785 # "Address": “Z002:db8:1:2:eff:233:fee:546",
786 # "PrefixLength": 56
787 # }
788 # ],
789 # "IPv6StaticDefaultGateways": [],
790
791 # Find the position of IPv6 address to be modified.
792 @{ipv6_network_configurations}= Get IPv6 Network Configuration
793 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
George Keishinge6e161e2025-05-08 10:18:30 +0530794 IF '${ipv6_network_configuration['Address']}' == '${ipv6}'
795 Append To List ${patch_list} ${ipv6_data}
796 ELSE
797 Append To List ${patch_list} ${empty_dict}
798 END
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500799 END
800
801 # Modify the IPv6 address only if given IPv6 is found
802 ${ip_found}= Run Keyword And Return Status List Should Contain Value
803 ... ${patch_list} ${ipv6_data} msg=${ipv6} does not exist on BMC
804 Pass Execution If ${ip_found} == ${False} ${ipv6} does not exist on BMC
805
806 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
807
808 ${active_channel_config}= Get Active Channel Config
809 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
810
811 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
812 ... body=&{data} valid_status_codes=${valid_status_codes}
813
814 # Note: Network restart takes around 15-18s after patch request processing.
815 Sleep ${NETWORK_TIMEOUT}s
816 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
817
818 # Verify if new IPv6 address is configured on BMC.
819 Verify IPv6 On BMC ${new_ipv6}
820
821 # Verify if old IPv6 address is erased.
822 ${cmd_status}= Run Keyword And Return Status
823 ... Verify IPv6 On BMC ${ipv6}
824 Should Be Equal ${cmd_status} ${False} msg=Old IPv6 address is not deleted.
825
826 Validate IPv6 Network Config On BMC
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500827
828
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500829Set SLAAC Configuration State And Verify
830 [Documentation] Set SLAAC configuration state and verify.
Sridevi Rameshed94c692025-09-07 23:41:10 -0500831 [Arguments] ${slaac_state} ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]
832 ... ${channel_number}=${CHANNEL_NUMBER}
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500833
834 # Description of argument(s):
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500835 # slaac_state SLAAC state('True' or 'False').
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500836 # valid_status_code Expected valid status codes.
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500837 # channel_number Channel number 1(eth0) or 2(eth1).
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500838
839 ${active_channel_config}= Get Active Channel Config
840 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
841
842 ${data}= Set Variable If ${slaac_state} == ${False} ${DISABLE_SLAAC} ${ENABLE_SLAAC}
843 ${resp}= Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
Sweta Potthuri610f86f2025-05-30 00:47:23 -0500844 ... body=${data} valid_status_codes=${valid_status_codes}
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500845
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500846 # Verify SLAAC is set correctly.
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500847 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
848 ${slaac_verify}= Get From Dictionary ${resp.dict} StatelessAddressAutoConfig
849
George Keishinge6e161e2025-05-08 10:18:30 +0530850 IF '${slaac_verify['IPv6AutoConfigEnabled']}' != '${slaac_state}'
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500851 Fail msg=SLAAC not set properly.
George Keishinge6e161e2025-05-08 10:18:30 +0530852 END
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500853
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500854Set And Verify DHCPv6 Property
855 [Documentation] Set DHCPv6 property and verify.
856 [Arguments] ${dhcpv6_operating_mode}=${Disabled} ${channel_number}=${CHANNEL_NUMBER}
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500857
858 # Description of argument(s):
859 # dhcpv6_operating_mode Enabled if user wants to enable DHCPv6('Enabled' or 'Disabled').
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500860 # channel_number Channel number 1 or 2.
861
862 Set DHCPv6 Property ${dhcpv6_operating_mode} ${channel_number}
863 Verify DHCPv6 Property ${dhcpv6_operating_mode} ${channel_number}
864
865
866Set DHCPv6 Property
867 [Documentation] Set DHCPv6 attribute is enables or disabled.
868 [Arguments] ${dhcpv6_operating_mode}=${Disabled} ${channel_number}=${CHANNEL_NUMBER}
869
870 # Description of argument(s):
871 # dhcpv6_operating_mode Enabled if user wants to enable DHCPv6('Enabled' or 'Disabled').
872 # channel_number Channel number 1 or 2.
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500873
874 ${data}= Set Variable If '${dhcpv6_operating_mode}' == 'Disabled' ${DISABLE_DHCPv6} ${ENABLE_DHCPv6}
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500875 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
876
877 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
878 ... body=${data} valid_status_codes=[${HTTP_OK},${HTTP_NO_CONTENT}]
879
kvishalbd04bd62025-08-05 03:57:53 -0500880
881Verify DHCPv6 Property
882 [Documentation] Verify DHCPv6 settings is enabled or disabled.
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500883 [Arguments] ${dhcpv6_operating_mode} ${channel_number}=${CHANNEL_NUMBER}
kvishalbd04bd62025-08-05 03:57:53 -0500884
885 # Description of Argument(s):
886 # dhcpv6_operating_mode Enable/ Disable DHCPv6.
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500887 # channel_number Channel number 1 or 2.
888
Sweta Potthuri425713a2025-10-16 00:28:20 -0500889 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
kvishalbd04bd62025-08-05 03:57:53 -0500890
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500891 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
892 ${dhcpv6_verify}= Get From Dictionary ${resp.dict} DHCPv6
893
894 Should Be Equal '${dhcpv6_verify['OperatingMode']}' '${dhcpv6_operating_mode}'
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500895
Sweta Potthuri425713a2025-10-16 00:28:20 -0500896 Sleep 30s
897
898 @{ipv6_addressorigin_list} ${ipv6_dhcpv6_addr}=
899 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${channel_number}
900
901 IF "${dhcpv6_operating_mode}" == "Enabled"
902 @{ipv6_addressorigin_list} ${ipv6_dhcpv6_addr}=
903 ... Get Address Origin List And Address For Type DHCPv6 ${channel_number}
904 Should Not Be Empty ${ipv6_dhcpv6_addr} msg=DHCPv6 must be present.
905 ELSE
906 Should Not Contain ${ipv6_addressorigin_list} DHCPv6
907 END
908
909
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500910
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500911Get IPv6 Static Default Gateway
912 [Documentation] Get IPv6 static default gateway.
913
914 ${active_channel_config}= Get Active Channel Config
915 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${CHANNEL_NUMBER}']['name']}
916
917 @{ipv6_static_defgw_configurations}= Get From Dictionary ${resp.dict} IPv6StaticDefaultGateways
918 RETURN @{ipv6_static_defgw_configurations}
919
Sweta Potthuri2d085732025-07-16 09:10:08 -0500920
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500921Configure IPv6 Static Default Gateway On BMC
922 [Documentation] Configure IPv6 static default gateway on BMC.
923 [Arguments] ${ipv6_gw_addr} ${prefix_length_def}
924 ... ${valid_status_codes}=${HTTP_OK}
Sridevi Rameshed94c692025-09-07 23:41:10 -0500925
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500926 # Description of argument(s):
927 # ipv6_gw_addr IPv6 Static Default Gateway address to be configured.
928 # prefix_len_def Prefix length value (Range 1 to 128).
929 # valid_status_codes Expected return code from patch operation
930 # (e.g. "200", "204".)
931
932 # Prefix Length is passed as None.
933 IF '${prefix_length_def}' == '${None}'
934 ${ipv6_gw}= Create Dictionary Address=${ipv6_gw_addr}
935 ELSE
936 ${ipv6_gw}= Create Dictionary Address=${ipv6_gw_addr} Prefix Length=${prefix_length_def}
937 END
938
939 ${ipv6_static_def_gw}= Get IPv6 Static Default Gateway
940
941 ${num_entries}= Get Length ${ipv6_static_def_gw}
942
943 ${patch_list}= Create List
944 ${empty_dict}= Create Dictionary
945
946 FOR ${INDEX} IN RANGE 0 ${num_entries}
947 Append To List ${patch_list} ${empty_dict}
948 END
949
950 ${valid_status_codes}= Set Variable If '${valid_status_codes}' == '${HTTP_OK}'
951 ... ${HTTP_OK},${HTTP_NO_CONTENT}
952 ... ${valid_status_codes}
953
954 Append To List ${patch_list} ${ipv6_gw}
955 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
956
957 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
958 ... body=${data} valid_status_codes=[${valid_status_codes}]
959
960 # Verify the added static default gateway is present in Redfish Get Output.
961 ${ipv6_staticdef_gateway}= Get IPv6 Static Default Gateway
962
963 ${ipv6_static_def_gw_list}= Create List
964 FOR ${ipv6_staticdef_gateway} IN @{ipv6_staticdef_gateway}
965 ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address
966 Append To List ${ipv6_static_def_gw_list} ${value}
967 END
968
969 IF '${valid_status_codes}' != '${HTTP_OK},${HTTP_NO_CONTENT}'
970 Should Not Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr}
971 ELSE
972 Should Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr}
973 END
974
Sweta Potthuri2d085732025-07-16 09:10:08 -0500975
Anvesh-Kumar_Rayankula019d9362025-09-03 22:55:12 -0500976Modify IPv6 Static Default Gateway On BMC
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500977 [Documentation] Modify and verify IPv6 address of BMC.
978 [Arguments] ${ipv6_gw_addr} ${new_static_def_gw} ${prefix_length}
979 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED}]
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500980
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500981 # Description of argument(s):
982 # ipv6_gw_addr IPv6 static default gateway address to be replaced (e.g. "2001:AABB:CCDD::AAFF").
983 # new_static_def_gw New static default gateway address to be configured.
Sridevi Rameshed94c692025-09-07 23:41:10 -0500984 # prefix_length Prefix length value (Range 1 to 128).
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500985 # valid_status_codes Expected return code from patch operation
986 # (e.g. "200", "204").
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500987
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500988 ${empty_dict}= Create Dictionary
989 ${patch_list}= Create List
990 # Prefix Length is passed as None.
991 IF '${prefix_length_def}' == '${None}'
992 ${modified_ipv6_gw_addripv6_data}= Create Dictionary Address=${new_static_def_gw}
993 ELSE
994 ${modified_ipv6_gw_addripv6_data}= Create Dictionary Address=${new_static_def_gw} Prefix Length=${prefix_length_def}
995 END
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500996
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500997 @{ipv6_static_def_gw_list}= Get IPv6 Static Default Gateway
998
999 FOR ${ipv6_static_def_gw} IN @{ipv6_static_def_gw_list}
1000 IF '${ipv6_static_def_gw['Address']}' == '${ipv6_gw_addr}'
1001 Append To List ${patch_list} ${modified_ipv6_gw_addripv6_data}
1002 ELSE
1003 Append To List ${patch_list} ${empty_dict}
1004 END
1005 END
1006
1007 # Modify the IPv6 address only if given IPv6 static default gateway is found.
1008 ${ip_static_def_gw_found}= Run Keyword And Return Status List Should Contain Value
1009 ... ${patch_list} ${modified_ipv6_gw_addripv6_data} msg=${ipv6_gw_addr} does not exist on BMC
1010 Pass Execution If ${ip_static_def_gw_found} == ${False} ${ipv6_gw_addr} does not exist on BMC
1011
1012 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
1013
1014 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1015 ... body=&{data} valid_status_codes=${valid_status_codes}
1016
1017 ${ipv6_staticdef_gateway}= Get IPv6 Static Default Gateway
1018
1019 ${ipv6_static_def_gw_list}= Create List
1020 FOR ${ipv6_staticdef_gateway} IN @{ipv6_staticdef_gateway}
Sweta Potthuri2d085732025-07-16 09:10:08 -05001021 ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001022 Append To List ${ipv6_static_def_gw_list} ${value}
1023 END
1024
1025 Should Contain ${ipv6_static_def_gw_list} ${new_static_def_gw}
1026 # Verify if old static default gateway address is erased.
1027 Should Not Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr}
1028
Sweta Potthuri2d085732025-07-16 09:10:08 -05001029
1030Delete IPv6 Static Default Gateway
1031 [Documentation] Delete IPv6 static default gateway on BMC.
1032 [Arguments] ${ipv6_gw_addr}
1033 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]
1034
1035 # Description of argument(s):
1036 # ipv6_gw_addr IPv6 Static Default Gateway address to be deleted.
1037 # valid_status_codes Expected return code from patch operation
1038 # (e.g. "200").
1039
1040 ${patch_list}= Create List
1041 ${empty_dict}= Create Dictionary
1042
1043 ${ipv6_static_def_gw_list}= Create List
1044 @{ipv6_static_defgw_configurations}= Get IPv6 Static Default Gateway
1045
1046 FOR ${ipv6_staticdef_gateway} IN @{ipv6_static_defgw_configurations}
1047 ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address
1048 Append To List ${ipv6_static_def_gw_list} ${value}
1049 END
1050
1051 ${defgw_found}= Run Keyword And Return Status List Should Contain Value
1052 ... ${ipv6_static_def_gw_list} ${ipv6_gw_addr} msg=${ipv6_gw_addr} does not exist on BMC
1053 Skip If ${defgw_found} == ${False} ${ipv6_gw_addr} does not exist on BMC
1054
1055 FOR ${ipv6_static_def_gw} IN @{ipv6_static_defgw_configurations}
1056 IF '${ipv6_static_def_gw['Address']}' == '${ipv6_gw_addr}'
1057 Append To List ${patch_list} ${null}
1058 ELSE
1059 Append To List ${patch_list} ${empty_dict}
1060 END
1061 END
1062
1063 # Run patch command only if given IP is found on BMC.
1064 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
1065
1066 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
1067 ... valid_status_codes=${valid_status_codes}
1068
1069 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
1070
1071 @{ipv6_static_defgw_configurations}= Get IPv6 Static Default Gateway
1072 Should Not Contain Match ${ipv6_static_defgw_configurations} ${ipv6_gw_addr}
1073 ... msg=IPv6 Static default gateway does not exist.
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001074
1075
1076Check Coexistence Of Linklocalv6 And Static IPv6
1077 [Documentation] Verify both linklocalv6 and static IPv6 exist.
1078
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001079 # Verify the address origin contains static and linklocal.
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001080 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001081
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001082 Should Match Regexp ${ipv6_linklocal_addr} ${linklocal_addr_format}
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001083 Should Contain ${ipv6_addressorigin_list} Static
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -05001084
1085
abhijith-12197078c52025-09-25 01:13:00 -05001086Check Coexistence Of Static IPv6 And SLAAC
abhijith-1214dc01a02025-09-24 11:29:55 -05001087 [Documentation] Verify both static IPv6 and SLAAC coexist.
abhijith-12197078c52025-09-25 01:13:00 -05001088
1089 # Verify the address origin contains static and slaac.
1090 @{ipv6_addressorigin_list} ${ipv6_static_addr}=
1091 ... Get Address Origin List And Address For Type Static
1092
1093 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1094 ... Get Address Origin List And Address For Type SLAAC
1095
1096
abhijith-1214dc01a02025-09-24 11:29:55 -05001097Check Coexistence Of Link Local And SLAAC
1098 [Documentation] Verify both link local and SLAAC coexist.
1099
1100 # Verify the address origin contains SLAAC and link local.
1101 @{ipv6_addressorigin_list} ${ipv6_link_local_addr}=
1102 ... Get Address Origin List And Address For Type LinkLocal
1103
1104 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1105 ... Get Address Origin List And Address For Type SLAAC
1106
1107 Should Match Regexp ${ipv6_link_local_addr} ${linklocal_addr_format}
1108
1109
abhijith-1218ff5db42025-09-24 06:24:03 -05001110Check Coexistence Of Link Local And DHCPv6
1111 [Documentation] Verify both link local and dhcpv6 coexist.
1112
1113 # Verify the address origin contains dhcpv6 and link local.
1114 @{ipv6_address_origin_list} ${ipv6_link_local_addr}=
1115 ... Get Address Origin List And Address For Type LinkLocal
1116
1117 @{ipv6_address_origin_list} ${ipv6_dhcpv6_addr}=
1118 ... Get Address Origin List And Address For Type DHCPv6
1119
1120 Should Match Regexp ${ipv6_link_local_addr} ${linklocal_addr_format}
1121
1122
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -05001123Check If Linklocal Address Is In Correct Format
1124 [Documentation] Linklocal address has network part fe80 and host part EUI64.
1125
1126 # Fetch the linklocal address.
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001127 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -05001128
1129 # Follow EUI64 from MAC.
1130 ${system_mac}= Get BMC MAC Address
1131 ${split_octets}= Split String ${system_mac} :
1132 ${first_octet}= Evaluate int('${split_octets[0]}', 16)
1133 ${flipped_hex}= Evaluate format(${first_octet} ^ 2, '02x')
1134 ${grp1}= Evaluate re.sub(r'^0+', '', '${flipped_hex}${split_octets[1]}') modules=re
1135 ${grp2}= Evaluate re.sub(r'^0+', '', '${split_octets[2]}ff') modules=re
1136 ${grp3}= Evaluate re.sub(r'^0+', '', '${split_octets[4]}${split_octets[5]}') modules=re
1137 ${linklocal}= Set Variable fe80::${grp1}:${grp2}:fe${split_octets[3]}:${grp3}
1138
1139 # Verify the linklocal obtained is the same as on the machine.
1140 Should Be Equal ${linklocal} ${ipv6_linklocal_addr}
1141
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001142
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001143Check BMC Gets SLAAC Address
1144 [Documentation] Check BMC gets slaac address.
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001145
1146 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= Get Address Origin List And Address For Type SLAAC
1147
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001148
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001149Get The Initial DHCPv6 Setting On Each Interface
1150 [Documentation] Get the initial DHCPv6 setting of each interface.
1151 [Arguments] ${channel_number}
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001152
1153 # Description of the argument(s):
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001154 # channel_number Channel number 1 or 2.
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001155
1156 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
1157 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1158 ${initial_dhcpv6_iface}= Get From Dictionary ${resp.dict} DHCPv6
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001159 IF ${channel_number}==${1}
1160 Set Test Variable ${dhcpv6_channel_1} ${initial_dhcpv6_iface['OperatingMode']}
1161 ELSE
1162 Set Test Variable ${dhcpv6_channel_2} ${initial_dhcpv6_iface['OperatingMode']}
1163 END
1164
1165
1166Get The Initial DHCPv6 Settings
1167 [Documentation] Get the initial DHCPv6 settings of both the interfaces.
1168
1169 Get The Initial DHCPv6 Setting On Each Interface ${1}
1170 Get The Initial DHCPv6 Setting On Each Interface ${2}
1171
1172
1173Get The Initial SLAAC Settings
1174 [Documentation] Get the initial SLAAC settings of both the interfaces.
1175
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001176 Get The Initial SLAAC Setting On Each Interface ${1}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001177 Get The Initial SLAAC Setting On Each Interface ${2}
1178
1179
1180Get The Initial SLAAC Setting On Each Interface
1181 [Documentation] Get the initial SLAAC setting of the interface.
1182 [Arguments] ${channel_number}
1183
1184 # Description of the argument(s):
1185 # channel_number Channel number 1 or 2.
1186
1187 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
1188 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1189 ${initial_slaac_iface}= Get From Dictionary ${resp.dict} StatelessAddressAutoConfig
1190 IF ${channel_number}==${1}
1191 Set Test Variable ${slaac_channel_1} ${initial_slaac_iface['IPv6AutoConfigEnabled']}
1192 ELSE
1193 Set Test Variable ${slaac_channel_2} ${initial_slaac_iface['IPv6AutoConfigEnabled']}
1194 END
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001195
1196
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001197Get Address Origin List And IPv4 or IPv6 Address
1198 [Documentation] Get address origin list and address for type.
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001199 [Arguments] ${ip_address_type} ${channel_number}=${CHANNEL_NUMBER}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001200
1201 # Description of the argument(s):
Sridevi Rameshed94c692025-09-07 23:41:10 -05001202 # ip_address_type Type of IPv4 or IPv6 address to be checked.
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001203 # channel_number Channel number 1(eth0) or 2(eth1).
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001204
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001205 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${channel_number}']['name']}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001206 @{ip_addresses}= Get From Dictionary ${resp.dict} ${ip_address_type}
1207
1208 ${ip_addressorigin_list}= Create List
1209 ${ip_addr_list}= Create List
1210 FOR ${ip_address} IN @{ip_addresses}
1211 ${ip_addressorigin}= Get From Dictionary ${ip_address} AddressOrigin
1212 Append To List ${ip_addressorigin_list} ${ip_addressorigin}
1213 Append To List ${ip_addr_list} ${ip_address['Address']}
1214 END
1215 RETURN ${ip_addressorigin_list} ${ip_addr_list}
1216
1217
1218Verify All The Addresses Are Intact
1219 [Documentation] Verify all the addresses and address origins remain intact.
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001220 [Arguments] ${channel_number}=${CHANNEL_NUMBER}
1221 ... ${initial_ipv4_addressorigin_list}=${initial_ipv4_addressorigin_list}
1222 ... ${initial_ipv4_addr_list}=${initial_ipv4_addr_list}
1223
1224 # Description of argument(s):
1225 # channel_number Channel number 1(eth0) or 2(eth1).
1226 # initial_ipv4_addressorigin_list Initial IPv4 address origin list.
1227 # initial_ipv4_addr_list Initial IPv4 address list.
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001228
1229 # Verify that it will not impact the IPv4 configuration.
1230 Sleep ${NETWORK_TIMEOUT}
1231 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
1232
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001233 # IPv6 Linklocal address must be present.
1234 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}=
1235 ... Get Address Origin List And Address For Type LinkLocal ${channel_number}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001236
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001237 # IPv4 addresses must remain intact.
1238 ${ipv4_addressorigin_list} ${ipv4_addr_list}=
1239 ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${channel_number}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001240
1241 Should be Equal ${initial_ipv4_addressorigin_list} ${ipv4_addressorigin_list}
1242 Should be Equal ${initial_ipv4_addr_list} ${ipv4_addr_list}
Sweta Potthurif3d188f2025-09-08 07:17:31 -05001243
1244
1245Get Interface ID Of IPv6
1246 [Documentation] Get interface id of IPv6 address.
1247 [Arguments] ${ipv6_address}
1248
1249 # Description of the argument(s):
1250 # ${ipv6_address} IPv6 Address to extract the last 4 hextets.
1251
1252 # Last 64 bits of SLAAC and Linklocal must be the same.
1253 # Sample IPv6 network configurations.
1254 #"IPv6AddressPolicyTable": [],
1255 # "IPv6Addresses": [
1256 # {
1257 # "Address": "fe80::xxxx:xxxx:xxxx:xxxx",
1258 # "AddressOrigin": "LinkLocal",
1259 # "AddressState": null,
1260 # "PrefixLength": xx
1261 # }
1262 # ],
1263 # {
1264 # "Address": "2002:xxxx:xxxx:xxxx:xxxx",
1265 # "AddressOrigin": "SLAAC",
1266 # "PrefixLength": 64
1267 # }
1268 # ],
1269
1270 ${split_ip_address}= Split String ${ipv6_address} :
1271 ${missing_ip}= Evaluate 8 - len(${split_ip_address}) + 1
1272 ${expanded_ip}= Create List
1273
1274 FOR ${hextet} IN @{split_ip_address}
1275 IF '${hextet}' == ''
1276 FOR ${i} IN RANGE ${missing_ip}
1277 Append To List ${expanded_ip} 0000
1278 END
1279 ELSE
1280 Append To List ${expanded_ip} ${hextet}
1281 END
1282 END
1283 ${interface_id}= Evaluate ':'.join(${expanded_ip}[-4:])
1284 RETURN ${interface_id}
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001285
1286
1287Set And Verify SLAAC Property On Both Interfaces
1288 [Documentation] Set and verify SLAAC property on both interfaces.
1289 [Arguments] ${slaac_value_1} ${slaac_value_2}
1290
1291 # Description of the argument(s):
1292 # slaac_value_1 SLAAC value for channel 1.
1293 # slaac_value_2 SLAAC value for channel 2.
1294
1295 Set SLAAC Configuration State And Verify ${slaac_value_1} [${HTTP_OK}] ${1}
1296 Set SLAAC Configuration State And Verify ${slaac_value_2} [${HTTP_OK}] ${2}
1297
1298 Sleep 30s
1299
1300 # Check SLAAC Settings for eth0.
1301 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1302 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${1}
1303 IF "${slaac_value_1}" == "${True}"
1304 Should Not Be Empty ${ipv6_slaac_addr} SLAAC
1305 ELSE
1306 Should Not Contain ${ipv6_addressorigin_list} SLAAC
1307 END
1308
1309 # Check SLAAC Settings for eth1.
1310 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1311 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${2}
1312 IF "${slaac_value_2}" == "${True}"
1313 Should Not Be Empty ${ipv6_slaac_addr} SLAAC
1314 ELSE
1315 Should Not Contain ${ipv6_addressorigin_list} SLAAC
1316 END
1317
1318 Verify All The Addresses Are Intact ${1}
1319 Verify All The Addresses Are Intact ${2}
1320 ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}
1321
Sweta Potthuri425713a2025-10-16 00:28:20 -05001322
1323Set And Verify DHCPv6 Property On Both Interfaces
1324 [Documentation] Set and verify DHCPv6 property on both interfaces.
1325 [Arguments] ${dhcpv6_value_1} ${dhcpv6_value_2}
1326
1327 # Description of the argument(s):
1328 # dhcpv6_value_1 DHCPv6 value for channel 1.
1329 # dhcpv6_value_2 DHCPv6 value for channel 2.
1330
1331 Set And Verify DHCPv6 Property ${dhcpv6_value_1} ${1}
1332 Set And Verify DHCPv6 Property ${dhcpv6_value_2} ${2}
1333
1334 Verify All The Addresses Are Intact ${1}
1335 Verify All The Addresses Are Intact ${2}
1336 ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}