blob: 65d085632f66509311d9b7bd63239d3a92013da5 [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
abhijith-121b9fc2742025-10-14 09:46:43 -050036${ipv6_leading_zero} 2001:0022:0033::0111
abhijith-1215f0aa202025-10-24 02:53:53 -050037${ipv6_firsthextet_zero} 2001:0022:1133::1111
abhijith-121b9fc2742025-10-14 09:46:43 -050038${ipv6_eliminate_zero} 2001:22:33::111
abhijith-1215f0aa202025-10-24 02:53:53 -050039${ipv6_eliminate_zero1} 2001:22:1133::1111
40${ipv6_contigeous_zero} 2001:0022:0000:0000:1:2:3:8
41${ipv6_zero_compression} 2001:22::1:2:3:8
Prashanth Katti8abbb4d2021-01-29 02:17:45 -060042
43*** Test Cases ***
44
45Get IPv6 Address And Verify
46 [Documentation] Get IPv6 Address And Verify.
47 [Tags] Get_IPv6_Address_And_Verify
48
49 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
50 Verify IPv6 On BMC ${ipv6_network_configuration['Address']}
51 END
52
53
Prashanth Katti2c73abc2021-03-17 07:42:25 -050054Get PrefixLength And Verify
55 [Documentation] Get IPv6 prefix length and verify.
56 [Tags] Get_PrefixLength_And_Verify
57
58 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
59 Verify IPv6 On BMC ${ipv6_network_configuration['PrefixLength']}
60 END
61
62
63Get IPv6 Default Gateway And Verify
George Keishing96143832021-03-23 07:55:08 -050064 [Documentation] Get IPv6 default gateway and verify.
George Keishingade6ab42022-07-19 11:41:03 -050065 [Tags] Get_IPv6_Default_Gateway_And_Verify
Prashanth Katti2c73abc2021-03-17 07:42:25 -050066
67 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
68 ${ipv6_gateway}= Get From Dictionary ${resp.dict} IPv6DefaultGateway
69 Verify IPv6 Default Gateway On BMC ${ipv6_gateway}
70
71
Prashanth Kattic1d2daa2022-07-26 03:53:06 -050072Verify All Configured IPv6 And PrefixLength On BMC
73 [Documentation] Verify IPv6 address and its prefix length on BMC.
74 [Tags] Verify_All_Configured_IPv6_And_PrefixLength_On_BMC
75
76 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
George Keishingf02ca2b2023-04-05 22:11:03 +053077 Verify IPv6 And PrefixLength ${ipv6_network_configuration['Address']}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -050078 ... ${ipv6_network_configuration['PrefixLength']}
79 END
80
81
82Configure IPv6 Address And Verify
83 [Documentation] Configure IPv6 address and verify.
84 [Tags] Configure_IPv6_Address_And_Verify
Anvesh-Kumar_Rayankula3a26c662025-04-16 01:19:26 -050085 [Teardown] Run Keywords
86 ... Delete IPv6 Address ${test_ipv6_addr} AND Test Teardown Execution
Prashanth Kattic1d2daa2022-07-26 03:53:06 -050087 [Template] Configure IPv6 Address On BMC
88
89
90 # IPv6 address Prefix length
91 ${test_ipv6_addr} ${test_prefix_length}
92
93
Prashanth Katti12ed4b72023-05-16 05:24:00 -050094Delete IPv6 Address And Verify
95 [Documentation] Delete IPv6 address and verify.
96 [Tags] Delete_IPv6_Address_And_Verify
97
98 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
99
100 Delete IPv6 Address ${test_ipv6_addr}
101
102
George Keishingcc288312024-10-22 10:13:12 +0530103Modify IPv6 Address And Verify
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500104 [Documentation] Modify IPv6 address and verify.
105 [Tags] Modify_IPv6_Address_And_Verify
kvishal88de8c42025-03-04 01:45:10 -0600106 [Teardown] Run Keywords
George Keishingcfdd0992025-03-17 11:59:20 +0530107 ... Delete IPv6 Address ${test_ipv6_addr1} AND Test Teardown Execution
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500108
109 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
110
111 Modify IPv6 Address ${test_ipv6_addr} ${test_ipv6_addr1} ${test_prefix_length}
112
113
Sweta Potthuriafe858e2025-02-25 23:52:51 -0600114Verify Persistency Of IPv6 After BMC Reboot
115 [Documentation] Verify persistency of IPv6 after BMC reboot.
116 [Tags] Verify_Persistency_Of_IPv6_After_BMC_Reboot
117 [Teardown] Run Keywords
118 ... Delete IPv6 Address ${test_ipv6_addr} AND Test Teardown Execution
119
120 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
121
122 Redfish OBMC Reboot (off) stack_mode=skip
123
124 # Verifying persistency of IPv6.
125 Verify IPv6 On BMC ${test_ipv6_addr}
126
127
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500128Enable SLAAC On BMC And Verify
129 [Documentation] Enable SLAAC on BMC and verify.
130 [Tags] Enable_SLAAC_On_BMC_And_Verify
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500131
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500132 Set SLAAC Configuration State And Verify ${True}
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500133
134
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500135Enable DHCPv6 Property On BMC And Verify
136 [Documentation] Enable DHCPv6 property on BMC and verify.
137 [Tags] Enable_DHCPv6_Property_On_BMC_And_Verify
138
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500139 Set And Verify DHCPv6 Property Enabled
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500140
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500141
kvishal0d199a92025-05-29 02:35:18 -0500142Disable DHCPv6 Property On BMC And Verify
143 [Documentation] Disable DHCPv6 property on BMC and verify.
144 [Tags] Disable_DHCPv6_Property_On_BMC_And_Verify
145
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500146 Set And Verify DHCPv6 Property Disabled
kvishalbd04bd62025-08-05 03:57:53 -0500147
148
149Verify Persistency Of DHCPv6 On Reboot
150 [Documentation] Verify persistency of DHCPv6 property on reboot.
151 [Tags] Verify_Persistency_Of_DHCPv6_On_Reboot
152
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500153 Set And Verify DHCPv6 Property Enabled
154 Redfish OBMC Reboot (off) stack_mode=skip
155 Verify DHCPv6 Property Enabled
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500156
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500157
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500158Configure Invalid Static IPv6 And Verify
159 [Documentation] Configure invalid static IPv6 and verify.
160 [Tags] Configure_Invalid_Static_IPv6_And_Verify
161 [Template] Configure IPv6 Address On BMC
162
kvishal9c6774c2025-09-10 02:14:07 -0500163 #invalid_ipv6 prefix length valid_status_code
164 ${ipv4_hexword_addr} ${test_prefix_length} ${HTTP_BAD_REQUEST}
165 ${invalid_hexadec_ipv6} ${test_prefix_length} ${HTTP_BAD_REQUEST}
166 ${ipv6_multi_short} ${test_prefix_length} ${HTTP_BAD_REQUEST}
167
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500168
Sweta Potthuri565318d2025-06-09 06:13:46 -0500169
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500170Configure IPv6 Static Default Gateway And Verify
171 [Documentation] Configure IPv6 static default gateway and verify.
172 [Tags] Configure_IPv6_Static_Default_Gateway_And_Verify
173 [Template] Configure IPv6 Static Default Gateway On BMC
Sweta Potthuri565318d2025-06-09 06:13:46 -0500174
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500175 # static_def_gw prefix length valid_status_code
176 ${ipv6_gw_addr} ${prefix_length_def} ${HTTP_OK}
177 ${invalid_staticv6_gateway} ${test_prefix_length} ${HTTP_BAD_REQUEST}
Sweta Potthuri565318d2025-06-09 06:13:46 -0500178
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500179
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500180Modify Static Default Gateway And Verify
181 [Documentation] Modify static default gateway and verify.
182 [Tags] Modify_Static_Default_Gateway_And_Verify
183 [Setup] Configure IPv6 Static Default Gateway On BMC ${ipv6_gw_addr} ${prefix_length_def}
184
185 Modify IPv6 Static Default Gateway On BMC ${test_ipv6_addr1} ${prefix_length_def} ${HTTP_OK} ${ipv6_gw_addr}
186
187
Sweta Potthuri2d085732025-07-16 09:10:08 -0500188Delete IPv6 Static Default Gateway And Verify
189 [Documentation] Delete IPv6 static default gateway and verify.
190 [Tags] Delete_IPv6_Static_Default_Gateway_And_Verify
191 [Setup] Configure IPv6 Static Default Gateway On BMC ${ipv6_gw_addr} ${prefix_length_def}
192
193 Delete IPv6 Static Default Gateway ${ipv6_gw_addr}
194
195
Sweta Potthuri35c503b2025-07-27 23:36:20 -0500196Verify Coexistence Of Linklocalv6 And Static IPv6 On BMC
197 [Documentation] Verify linklocalv6 And static IPv6 both exist.
198 [Tags] Verify_Coexistence_Of_Linklocalv6_And_Static_IPv6_On_BMC
Anvesh-Kumar_Rayankula019d9362025-09-03 22:55:12 -0500199 [Setup] Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
200 [Teardown] Delete IPv6 Address ${test_ipv6_addr}
Sweta Potthuri35c503b2025-07-27 23:36:20 -0500201
202 Check Coexistence Of Linklocalv6 And Static IPv6
203
204
George Keishingbadb4c62025-09-18 16:14:12 +0530205Verify IPv6 Linklocal Address Is In Correct Format
206 [Documentation] Verify linklocal address has network part as fe80 and
207 ... host part as EUI64.
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -0500208 [Tags] Verify_IPv6_Linklocal_Address_Is_In_Correct_Format
209
210 Check If Linklocal Address Is In Correct Format
211
212
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500213Verify BMC Gets SLAAC Address On Enabling SLAAC
214 [Documentation] On enabling SLAAC verify SLAAC address comes up.
215 [Tags] Verify_BMC_Gets_SLAAC_Address_On_Enabling_SLAAC
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500216 [Setup] Set SLAAC Configuration State And Verify ${False}
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500217
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500218 Set SLAAC Configuration State And Verify ${True}
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500219 Sleep ${NETWORK_TIMEOUT}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500220 Check BMC Gets SLAAC Address
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500221
222
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500223Verify Enable And Disable SLAAC On Both Interfaces
224 [Documentation] Verify enable and disable SLAAC on both the interfaces.
225 [Tags] Verify_Enable_And_Disable_SLAAC_On_Both_Interfaces
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500226 [Setup] Get The Initial SLAAC Settings
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500227 [Template] Set And Verify SLAAC Property On Both Interfaces
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500228 [Teardown] Run Keywords Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1}
229 ... AND Set SLAAC Configuration State And Verify ${slaac_channel_2} [${HTTP_OK}] ${2}
230
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500231 # slaac_eth0 slaac_eth1
232 ${True} ${True}
233 ${True} ${False}
234 ${False} ${True}
235 ${False} ${False}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500236
237
Sweta Potthuri425713a2025-10-16 00:28:20 -0500238Configure And Validate DHCPv6 Settings On Both Network Interfaces
239 [Documentation] Configure and validate the DHCPv6 enable/disable settings
240 ... on both network interfaces.
241 [Tags] Configure_And_Validate_DHCPv6_Settings_On_Both_Network_Interfaces
242 [Setup] Get The Initial DHCPv6 Settings
243 [Template] Set And Verify DHCPv6 Property On Both Interfaces
244 [Teardown] Run Keywords Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1} AND
245 ... Set And Verify DHCPv6 Property ${dhcpv6_channel_2} ${2}
246
247 # DHCPv6_eth0 DHCPv6_eth1
248 Enabled Enabled
249 Enabled Disabled
250 Disabled Enabled
251 Disabled Disabled
252
253
abhijith-1213a645902025-09-08 01:12:34 -0500254Verify Autoconfig Is Present On Ethernet Interface
255 [Documentation] Verify autoconfig is present on ethernet interface.
256 [Tags] Verify_Autoconfig_Is_Present_On_Ethernet_Interface
257
258 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
259 Should Contain ${resp.dict} StatelessAddressAutoConfig
260
261
Sweta Potthurif3d188f2025-09-08 07:17:31 -0500262Verify Interface ID Of SLAAC And LinkLocal Addresses Are Same
263 [Documentation] Validate interface id of SLAAC and link-local addresses are same.
264 [Tags] Verify_Interface_ID_Of_SLAAC_And_LinkLocal_Addresses_Are_Same
265
266 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
267 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= Get Address Origin List And Address For Type SLAAC
268
269 ${linklocal_interface_id}= Get Interface ID Of IPv6 ${ipv6_linklocal_addr}
270 ${slaac_interface_id}= Get Interface ID Of IPv6 ${ipv6_slaac_addr}
271
272 Should Be Equal ${linklocal_interface_id} ${slaac_interface_id}
273
274
abhijith-121c3e96d72025-09-09 11:35:09 -0500275Verify Persistency Of Link Local IPv6 On BMC Reboot
276 [Documentation] Verify persistency of link local on BMC reboot.
277 [Tags] Verify_Persistency_Of_Link_Local_IPv6_On_BMC_Reboot
278
279 # Capturing the linklocal before reboot.
280 @{ipv6_address_origin_list} ${linklocal_addr_before_reboot}=
281 ... Get Address Origin List And Address For Type LinkLocal
282
283 # Rebooting BMC.
284 Redfish OBMC Reboot (off) stack_mode=skip
285
286 @{ipv6_address_origin_list} ${linklocal_addr_after_reboot}=
287 ... Get Address Origin List And Address For Type LinkLocal
288
289 # Verifying the linklocal must be the same before and after reboot.
290 Should Be Equal ${linklocal_addr_before_reboot} ${linklocal_addr_after_reboot}
291 ... msg=IPv6 Linklocal address has changed after reboot.
292
293
Sweta Potthuri2f3fbb52025-09-19 00:50:47 -0500294Modify MAC and Verify BMC Reinitializing Linklocal
295 [Documentation] Modify MAC and verify BMC reinitializing linklocal.
296 [Tags] Modify_MAC_and_Verify_BMC_Reinitializing_Linklocal
297 [Teardown] Configure MAC Settings ${original_address}
298
299 ${original_address}= Get BMC MAC Address
300 @{ipv6_addressorigin_list} ${ipv6_before_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
301
302 # Modify MAC Address Of Ethernet Interface.
303 Configure MAC Settings ${new_mac_addr}
304 Sleep 30s
305 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
306 @{ipv6_addressorigin_list} ${ipv6_linklocal_after_addr}= Get Address Origin List And Address For Type LinkLocal
307
308 # Verify whether the linklocal has changed and is in the the correct format.
309 Check If Linklocal Address Is In Correct Format
310 Should Not Be Equal ${ipv6_before_linklocal_addr} ${ipv6_linklocal_after_addr}
311
312
abhijith-121bfbd03a2025-09-15 01:40:35 -0500313Add Multiple IPv6 Address And Verify
314 [Documentation] Add multiple IPv6 address and verify.
315 [Tags] Add_Multiple_IPv6_Address_And_Verify
316 [Teardown] Run Keywords
317 ... Delete IPv6 Address ${test_ipv6_addr} AND Delete IPv6 Address ${test_ipv6_addr1}
318 ... AND Test Teardown Execution
319
320 Configure Multiple IPv6 Address on BMC ${test_prefix_length}
321
322
abhijith-12197078c52025-09-25 01:13:00 -0500323Verify Coexistence Of Static IPv6 And SLAAC On BMC
abhijith-1214dc01a02025-09-24 11:29:55 -0500324 [Documentation] Verify static IPv6 And SLAAC both coexist.
abhijith-12197078c52025-09-25 01:13:00 -0500325 [Tags] Verify_Coexistence_Of_Static_IPv6_And_SLAAC_On_BMC
326 [Setup] Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
327 Set SLAAC Configuration State And Verify ${True}
328 [Teardown] Delete IPv6 Address ${test_ipv6_addr}
329
330 Sleep ${NETWORK_TIMEOUT}s
331
332 Check Coexistence Of Static IPv6 And SLAAC
333
334
abhijith-1218ff5db42025-09-24 06:24:03 -0500335Verify Coexistence Of Link Local And DHCPv6 On BMC
336 [Documentation] Verify link local And dhcpv6 both coexist.
337 [Tags] Verify_Coexistence_Of_Link_Local_And_DHCPv6_On_BMC
338 [Setup] Set DHCPv6 Property Enabled ${2}
339
340 Sleep ${NETWORK_TIMEOUT}s
341
342 Check Coexistence Of Link Local And DHCPv6
343
344
abhijith-1214dc01a02025-09-24 11:29:55 -0500345Verify Coexistence Of Link Local And SLAAC On BMC
346 [Documentation] Verify link local And SLAAC both coexist.
347 [Tags] Verify_Coexistence_Of_Link_Local_And_SLAAC_On_BMC
348 [Setup] Set SLAAC Configuration State And Verify ${True}
349
350 Sleep ${NETWORK_TIMEOUT}s
351
352 Check Coexistence Of Link Local And SLAAC
353
354
abhijith-121ffea1912025-10-06 02:39:22 -0500355Verify Coexistence Of All IPv6 Type Addresses On BMC
356 [Documentation] Verify coexistence of link local, static, DHCPv6 and SLAAC ipv6 addresses.
357 [Tags] Verify_Coexistence_Of_All_IPv6_Type_Addresses_On_BMC
358 [Setup] Run Keywords Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
359 ... AND Get The Initial DHCPv6 Setting On Each Interface ${1}
360 ... AND Set And Verify DHCPv6 Property Enabled
361 ... AND Get The Initial SLAAC Setting On Each Interface ${1}
362 ... AND Set SLAAC Configuration State And Verify ${True}
363 [Teardown] Run Keywords Delete IPv6 Address ${test_ipv6_addr}
364 ... AND Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1}
365 ... AND Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1}
366
367 Sleep ${NETWORK_TIMEOUT}s
368
369 # Verify link local, static, DHCPv6 and SLAAC ipv6 addresses coexist.
370 Verify The Coexistence Of The Address Type LinkLocal Static DHCPv6 SLAAC
371
372
abhijith-1219e190dd2025-10-15 03:35:06 -0500373Configure Link Local IPv6 Address And Verify
374 [Documentation] Configure link local IPv6 address and verify.
375 [Tags] Configure_Link_Local_IPv6_Address_And_Verify
376
377 Configure IPv6 Address On BMC ${link_local_addr} ${link_local_prefix_len}
378
379 # Verify the address origin contains link local.
380 @{ipv6_address_origin_list} ${ipv6_link_local_addr}=
381 ... Get Address Origin List And Address For Type LinkLocal
382
383 ${count}= Evaluate ${ipv6_address_origin_list}.count("LinkLocal")
384
385 Should Be Equal As Integers ${count} 2
386
387
abhijith-1215f0aa202025-10-24 02:53:53 -0500388Configure Valid IPv6 Address And Verify
389 [Documentation] Configure valid IPv6 address and verify it is getting added as expected format.
390 [Tags] Configure_Valid_IPv6_Address_And_Verify
abhijith-121b9fc2742025-10-14 09:46:43 -0500391 [Teardown] Run Keywords
abhijith-1215f0aa202025-10-24 02:53:53 -0500392 ... Delete IPv6 Address ${ipv6_zero_compression}
393 ... AND Delete IPv6 Address ${ipv6_eliminate_zero}
394 ... AND Delete IPv6 Address ${ipv6_eliminate_zero1}
395 ... AND Test Teardown Execution
396 [Template] Configure IPv6 Address On BMC
abhijith-121b9fc2742025-10-14 09:46:43 -0500397
abhijith-1215f0aa202025-10-24 02:53:53 -0500398 # IPv6 address prefix length IPv6 address verified.
399 ${ipv6_contigeous_zero} ${test_prefix_length} ${ipv6_zero_compression}
400 ${ipv6_firsthextet_zero} ${test_prefix_length} ${ipv6_eliminate_zero1}
401 ${ipv6_leading_zero} ${test_prefix_length} ${ipv6_eliminate_zero}
abhijith-121b9fc2742025-10-14 09:46:43 -0500402
403
abhijith-121d8322b72025-10-13 02:23:48 -0500404Verify Coexistence Of IPv6 Addresses Type Combination On BMC
405 [Documentation] Verify coexistence of IPv6 addresses type combination on BMC.
406 [Tags] Verify_Coexistence_Of_IPv6_Addresses_Type_Combination_On_BMC
407 [Setup] Run Keywords
408 ... Get The Initial DHCPv6 Setting On Each Interface ${1}
409 ... AND Get The Initial SLAAC Setting On Each Interface ${1}
410 [Teardown] Run Keywords
411 ... Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1}
412 ... AND Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1}
413 [Template] Verify IPv6 Addresses Coexist
414
415 # type1 type2.
416 Static DHCPv6
417 DHCPv6 SLAAC
418 SLAAC Static
419 Static Static
420
421
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600422*** Keywords ***
423
Prashanth Katti3270fd02021-06-11 08:02:22 -0500424Suite Setup Execution
425 [Documentation] Do suite setup execution.
426
Anvesh-Kumar_Rayankula019d9362025-09-03 22:55:12 -0500427 Redfish.Login
Prashanth Katti3270fd02021-06-11 08:02:22 -0500428 ${active_channel_config}= Get Active Channel Config
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -0500429 Set Suite Variable ${active_channel_config}
430
Prashanth Katti3270fd02021-06-11 08:02:22 -0500431 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
432
433 Set Suite variable ${ethernet_interface}
434
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500435 # Get initial IPv4 and IPv6 addresses and address origins for eth0.
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500436 ${initial_ipv4_addressorigin_list} ${initial_ipv4_addr_list}= Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses
437 ${initial_ipv6_addressorigin_list} ${initial_ipv6_addr_list}= Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses
438
439 Set Suite Variable ${initial_ipv4_addressorigin_list}
440 Set Suite Variable ${initial_ipv4_addr_list}
441 Set Suite Variable ${initial_ipv6_addressorigin_list}
442 Set Suite Variable ${initial_ipv6_addr_list}
443
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500444 # Get initial IPv4 and IPv6 addresses and address origins for eth1.
445 ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}=
446 ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${2}
447 ${eth1_initial_ipv6_addressorigin_list} ${eth1_initial_ipv6_addr_list}=
448 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${2}
449 Set Suite Variable ${eth1_initial_ipv4_addressorigin_list}
450 Set Suite Variable ${eth1_initial_ipv4_addr_list}
451 Set Suite Variable ${eth1_initial_ipv6_addressorigin_list}
452 Set Suite Variable ${eth1_initial_ipv6_addr_list}
453
Prashanth Katti3270fd02021-06-11 08:02:22 -0500454
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600455Test Setup Execution
456 [Documentation] Test setup execution.
457
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600458 @{ipv6_network_configurations}= Get IPv6 Network Configuration
459 Set Test Variable @{ipv6_network_configurations}
460
461 # Get BMC IPv6 address and prefix length.
462 ${ipv6_data}= Get BMC IPv6 Info
463 Set Test Variable ${ipv6_data}
464
465
466Test Teardown Execution
467 [Documentation] Test teardown execution.
468
469 FFDC On Test Case Fail
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600470
471
472Get IPv6 Network Configuration
473 [Documentation] Get Ipv6 network configuration.
474 # Sample output:
475 # {
ganesanb4d430282023-04-27 14:33:23 +0000476 # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0",
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600477 # "@odata.type": "#EthernetInterface.v1_4_1.EthernetInterface",
478 # "DHCPv4": {
479 # "DHCPEnabled": false,
480 # "UseDNSServers": false,
481 # "UseDomainName": true,
482 # "UseNTPServers": false
483 # },
484 # "DHCPv6": {
485 # "OperatingMode": "Disabled",
486 # "UseDNSServers": false,
487 # "UseDomainName": true,
488 # "UseNTPServers": false
489 # },
490 # "Description": "Management Network Interface",
491 # "FQDN": "localhost",
492 # "HostName": "localhost",
493 # "IPv4Addresses": [
494 # {
495 # "Address": "xx.xx.xx.xx",
496 # "AddressOrigin": "Static",
497 # "Gateway": "xx.xx.xx.1",
498 # "SubnetMask": "xx.xx.xx.0"
499 # },
500 # {
501 # "Address": "169.254.xx.xx",
502 # "AddressOrigin": "IPv4LinkLocal",
503 # "Gateway": "0.0.0.0",
504 # "SubnetMask": "xx.xx.0.0"
505 # },
506 # ],
507 # "IPv4StaticAddresses": [
508 # {
509 # "Address": "xx.xx.xx.xx",
510 # "AddressOrigin": "Static",
511 # "Gateway": "xx.xx.xx.1",
512 # "SubnetMask": "xx.xx.0.0"
513 # }
514 # }
515 # ],
516 # "IPv6AddressPolicyTable": [],
517 # "IPv6Addresses": [
518 # {
519 # "Address": "fe80::xxxx:xxxx:xxxx:xxxx",
520 # "AddressOrigin": "LinkLocal",
521 # "AddressState": null,
522 # "PrefixLength": xx
523 # }
524 # ],
525 # "IPv6DefaultGateway": "",
526 # "IPv6StaticAddresses": [
527 # { "Address": "xxxx:xxxx:xxxx:xxxx::xxxx",
528 # "AddressOrigin": "Static",
529 # "AddressState": null,
530 # "PrefixLength": xxx
531 # }
532 # ],
533 # "Id": "eth0",
534 # "InterfaceEnabled": true,
535 # "LinkStatus": "LinkUp",
536 # "MACAddress": "xx:xx:xx:xx:xx:xx",
537 # "Name": "Manager Ethernet Interface",
538 # "NameServers": [],
539 # "SpeedMbps": 0,
540 # "StaticNameServers": [],
541 # "Status": {
542 # "Health": "OK",
543 # "HealthRollup": "OK",
544 # "State": "Enabled"
545 # },
546 # "VLANs": {
ganesanb4d430282023-04-27 14:33:23 +0000547 # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0/VLANs"
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600548
549
550 ${active_channel_config}= Get Active Channel Config
551 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${CHANNEL_NUMBER}']['name']}
552
553 @{ipv6_network_configurations}= Get From Dictionary ${resp.dict} IPv6StaticAddresses
George Keishing409df052024-01-17 22:36:14 +0530554 RETURN @{ipv6_network_configurations}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500555
556
557Verify IPv6 And PrefixLength
558 [Documentation] Verify IPv6 address and prefix length on BMC.
559 [Arguments] ${ipv6_addr} ${prefix_len}
560
561 # Description of the argument(s):
562 # ipv6_addr IPv6 address to be verified.
563 # prefix_len PrefixLength value to be verified.
564
565 # Catenate IPv6 address and its prefix length.
566 ${ipv6_with_prefix}= Catenate ${ipv6_addr}/${prefix_len}
567
568 # Get IPv6 address details on BMC using IP command.
569 @{ip_data}= Get BMC IPv6 Info
570
571 # Verify if IPv6 and prefix length is configured on BMC.
572
573 Should Contain ${ip_data} ${ipv6_with_prefix}
574 ... msg=IPv6 and prefix length pair does not exist.
575
576
577Configure IPv6 Address On BMC
578 [Documentation] Add IPv6 Address on BMC.
abhijith-121b9fc2742025-10-14 09:46:43 -0500579 [Arguments] ${ipv6_addr1} ${prefix_len} ${ipv6_addr2}=${None}
580 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_NO_CONTENT}]
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500581
582 # Description of argument(s):
abhijith-121b9fc2742025-10-14 09:46:43 -0500583 # ipv6_addr1 IPv6 address to be added (e.g. "2001:0022:0033::0111").
584 # ipv6_addr2 IPv6 address to be Verified (e.g. "2001:22:33::111").
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500585 # prefix_len Prefix length for the IPv6 to be added
586 # (e.g. "64").
587 # valid_status_codes Expected return code from patch operation
588 # (e.g. "200").
589
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500590 ${prefix_length}= Convert To Integer ${prefix_len}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500591 ${empty_dict}= Create Dictionary
abhijith-121b9fc2742025-10-14 09:46:43 -0500592 ${ipv6_data}= Create Dictionary Address=${ipv6_addr1}
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500593 ... PrefixLength=${prefix_length}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500594
595 ${patch_list}= Create List
596
597 # Get existing static IPv6 configurations on BMC.
598 ${ipv6_network_configurations}= Get IPv6 Network Configuration
599 ${num_entries}= Get Length ${ipv6_network_configurations}
600
601 FOR ${INDEX} IN RANGE 0 ${num_entries}
602 Append To List ${patch_list} ${empty_dict}
603 END
604
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500605 # We need not check for existence of IPv6 on BMC while adding.
606 Append To List ${patch_list} ${ipv6_data}
607 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
608
609 ${active_channel_config}= Get Active Channel Config
610 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
611
612 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
abhijith-121b9fc2742025-10-14 09:46:43 -0500613 ... valid_status_codes=${valid_status_codes}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500614
abhijith-121b9fc2742025-10-14 09:46:43 -0500615 IF ${valid_status_codes} != [${HTTP_OK}, ${HTTP_NO_CONTENT}]
616 Fail msg=Static address not added correctly
617 END
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500618
619 # Note: Network restart takes around 15-18s after patch request processing.
620 Sleep ${NETWORK_TIMEOUT}s
621 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
622
abhijith-121b9fc2742025-10-14 09:46:43 -0500623 #Verify ip address on CLI.
624 IF '${ipv6_addr2}' != '${None}'
625 Verify IPv6 And PrefixLength ${ipv6_addr2} ${prefix_len}
626 ELSE
627 Verify IPv6 And PrefixLength ${ipv6_addr1} ${prefix_len}
628 END
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500629
630 # Verify if existing static IPv6 addresses still exist.
631 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
632 Verify IPv6 On BMC ${ipv6_network_configuration['Address']}
633 END
634
abhijith-121b9fc2742025-10-14 09:46:43 -0500635 #Verify redfish and CLI data matches.
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500636 Validate IPv6 Network Config On BMC
637
638
abhijith-121bfbd03a2025-09-15 01:40:35 -0500639Configure Multiple IPv6 Address on BMC
640 [Documentation] Add multiple IPv6 address on BMC.
641 [Arguments] ${prefix_len}
642 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_NO_CONTENT}]
643
644 # Description of argument(s):
645 # prefix_len Prefix length for the IPv6 to be added
646 # (e.g. "64").
647 # valid_status_codes Expected return code from patch operation
648 # (e.g. "200").
649
650 ${ipv6_list}= Create List ${test_ipv6_addr} ${test_ipv6_addr1}
651 ${prefix_length}= Convert To Integer ${prefix_len}
652 ${empty_dict}= Create Dictionary
653 ${patch_list}= Create List
654
655 # Get existing static IPv6 configurations on BMC.
656 ${ipv6_network_configurations}= Get IPv6 Network Configuration
657 ${num_entries}= Get Length ${ipv6_network_configurations}
658
659 FOR ${INDEX} IN RANGE 0 ${num_entries}
660 Append To List ${patch_list} ${empty_dict}
661 END
662
663 # We need not check for existence of IPv6 on BMC while adding.
664 FOR ${ipv6_addr} IN @{ipv6_list}
665 ${ipv6_data}= Create Dictionary Address=${ipv6_addr} PrefixLength=${prefix_length}
666 Append To List ${patch_list} ${ipv6_data}
667 END
668 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
669
670 ${active_channel_config}= Get Active Channel Config
671 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
672
673 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
674 ... valid_status_codes=${valid_status_codes}
675
676 IF ${valid_status_codes} != [${HTTP_OK}, ${HTTP_NO_CONTENT}]
677 Fail msg=Static address not added correctly
678 END
679
680 # Note: Network restart takes around 15-18s after patch request processing.
681 Sleep ${NETWORK_TIMEOUT}s
682 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
683
684 # Verify newly added ip address on CLI.
685 FOR ${ipv6_addr} IN @{ipv6_list}
686 Verify IPv6 And PrefixLength ${ipv6_addr} ${prefix_len}
687 END
688
689 # Verify if existing static IPv6 addresses still exist.
690 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
691 Verify IPv6 On BMC ${ipv6_network_configuration['Address']}
692 END
693
694 # Get the latest ipv6 network configurations.
695 @{ipv6_network_configurations}= Get IPv6 Network Configuration
696
697 # Verify newly added ip address on BMC.
698 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
699 Should Contain Match ${ipv6_list} ${ipv6_network_configuration['Address']}
700 END
701
702 Validate IPv6 Network Config On BMC
703
704
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500705Validate IPv6 Network Config On BMC
706 [Documentation] Check that IPv6 network info obtained via redfish matches info
707 ... obtained via CLI.
Sridevi Rameshed94c692025-09-07 23:41:10 -0500708
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500709 @{ipv6_network_configurations}= Get IPv6 Network Configuration
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500710 ${ipv6_data}= Get BMC IPv6 Info
711 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
712 Should Contain Match ${ipv6_data} ${ipv6_network_configuration['Address']}/*
713 ... msg=IPv6 address does not exist.
714 END
715
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500716
717Delete IPv6 Address
718 [Documentation] Delete IPv6 address of BMC.
Prashanth Kattibcb9dab2025-04-01 12:58:37 -0500719 [Arguments] ${ipv6_addr}
720 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500721
722 # Description of argument(s):
723 # ipv6_addr IPv6 address to be deleted (e.g. "2001:1234:1234:1234::1234").
724 # valid_status_codes Expected return code from patch operation
725 # (e.g. "200"). See prolog of rest_request
726 # method in redfish_plus.py for details.
727
728 ${empty_dict}= Create Dictionary
729 ${patch_list}= Create List
730
731 @{ipv6_network_configurations}= Get IPv6 Network Configuration
732 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
733 IF '${ipv6_network_configuration['Address']}' == '${ipv6_addr}'
734 Append To List ${patch_list} ${null}
735 ELSE
736 Append To List ${patch_list} ${empty_dict}
737 END
738 END
739
740 ${ip_found}= Run Keyword And Return Status List Should Contain Value
741 ... ${patch_list} ${null} msg=${ipv6_addr} does not exist on BMC
742 Pass Execution If ${ip_found} == ${False} ${ipv6_addr} does not exist on BMC
743
744 # Run patch command only if given IP is found on BMC
745 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
746
747 ${active_channel_config}= Get Active Channel Config
748 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
749
750 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
Sweta Potthuria1981612025-05-09 05:41:10 -0500751 ... valid_status_codes=${valid_status_codes}
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500752
753 # Note: Network restart takes around 15-18s after patch request processing
754 Sleep ${NETWORK_TIMEOUT}s
755 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
756
757 # IPv6 address that is deleted should not be there on BMC.
758 ${delete_status}= Run Keyword And Return Status Verify IPv6 On BMC ${ipv6_addr}
Anvesh-Kumar_Rayankula3a26c662025-04-16 01:19:26 -0500759 IF '${valid_status_codes}' == '[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]'
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500760 Should Be True '${delete_status}' == '${False}'
761 ELSE
762 Should Be True '${delete_status}' == '${True}'
763 END
764
765 Validate IPv6 Network Config On BMC
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500766
767
768Modify IPv6 Address
769 [Documentation] Modify and verify IPv6 address of BMC.
770 [Arguments] ${ipv6} ${new_ipv6} ${prefix_len}
771 ... ${valid_status_codes}=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
772
773 # Description of argument(s):
774 # ipv6 IPv6 address to be replaced (e.g. "2001:AABB:CCDD::AAFF").
775 # new_ipv6 New IPv6 address to be configured.
776 # prefix_len Prefix length value (Range 1 to 128).
777 # valid_status_codes Expected return code from patch operation
778 # (e.g. "200", "201").
779
780 ${empty_dict}= Create Dictionary
781 ${patch_list}= Create List
782 ${prefix_length}= Convert To Integer ${prefix_len}
783 ${ipv6_data}= Create Dictionary
784 ... Address=${new_ipv6} PrefixLength=${prefix_length}
785
786 # Sample IPv6 network configurations:
787 # "IPv6AddressPolicyTable": [],
788 # "IPv6Addresses": [
789 # {
790 # "Address": "X002:db8:0:2::XX0",
791 # "AddressOrigin": "DHCPv6",
792 # "PrefixLength": 128
793 # },
794 # {
795 # "Address": “X002:db8:0:2:a94:XXff:fe82:XXXX",
796 # "AddressOrigin": "SLAAC",
797 # "PrefixLength": 64
798 # },
799 # {
800 # "Address": “Y002:db8:0:2:a94:efff:fe82:5000",
801 # "AddressOrigin": "Static",
802 # "PrefixLength": 56
803 # },
804 # {
805 # "Address": “Z002:db8:0:2:a94:efff:fe82:5000",
806 # "AddressOrigin": "Static",
807 # "PrefixLength": 56
808 # },
809 # {
810 # "Address": “Xe80::a94:efff:YYYY:XXXX",
811 # "AddressOrigin": "LinkLocal",
812 # "PrefixLength": 64
813 # },
814 # {
815 # "Address": “X002:db8:1:2:eff:233:fee:546",
816 # "AddressOrigin": "Static",
817 # "PrefixLength": 56
818 # }
819 # ],
820 # "IPv6DefaultGateway": “XXXX::ab2e:80fe:87df:XXXX”,
821 # "IPv6StaticAddresses": [
822 # {
823 # "Address": “X002:db8:0:2:a94:efff:fe82:5000",
824 # "PrefixLength": 56
825 # },
826 # {
827 # "Address": “Y002:db8:0:2:a94:efff:fe82:5000",
828 # "PrefixLength": 56
829 # },
830 # {
831 # "Address": “Z002:db8:1:2:eff:233:fee:546",
832 # "PrefixLength": 56
833 # }
834 # ],
835 # "IPv6StaticDefaultGateways": [],
836
837 # Find the position of IPv6 address to be modified.
838 @{ipv6_network_configurations}= Get IPv6 Network Configuration
839 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
George Keishinge6e161e2025-05-08 10:18:30 +0530840 IF '${ipv6_network_configuration['Address']}' == '${ipv6}'
841 Append To List ${patch_list} ${ipv6_data}
842 ELSE
843 Append To List ${patch_list} ${empty_dict}
844 END
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500845 END
846
847 # Modify the IPv6 address only if given IPv6 is found
848 ${ip_found}= Run Keyword And Return Status List Should Contain Value
849 ... ${patch_list} ${ipv6_data} msg=${ipv6} does not exist on BMC
850 Pass Execution If ${ip_found} == ${False} ${ipv6} does not exist on BMC
851
852 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
853
854 ${active_channel_config}= Get Active Channel Config
855 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
856
857 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
858 ... body=&{data} valid_status_codes=${valid_status_codes}
859
860 # Note: Network restart takes around 15-18s after patch request processing.
861 Sleep ${NETWORK_TIMEOUT}s
862 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
863
864 # Verify if new IPv6 address is configured on BMC.
865 Verify IPv6 On BMC ${new_ipv6}
866
867 # Verify if old IPv6 address is erased.
868 ${cmd_status}= Run Keyword And Return Status
869 ... Verify IPv6 On BMC ${ipv6}
870 Should Be Equal ${cmd_status} ${False} msg=Old IPv6 address is not deleted.
871
872 Validate IPv6 Network Config On BMC
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500873
874
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500875Set SLAAC Configuration State And Verify
876 [Documentation] Set SLAAC configuration state and verify.
Sridevi Rameshed94c692025-09-07 23:41:10 -0500877 [Arguments] ${slaac_state} ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]
878 ... ${channel_number}=${CHANNEL_NUMBER}
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500879
880 # Description of argument(s):
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500881 # slaac_state SLAAC state('True' or 'False').
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500882 # valid_status_code Expected valid status codes.
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500883 # channel_number Channel number 1(eth0) or 2(eth1).
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500884
885 ${active_channel_config}= Get Active Channel Config
886 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
887
888 ${data}= Set Variable If ${slaac_state} == ${False} ${DISABLE_SLAAC} ${ENABLE_SLAAC}
889 ${resp}= Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
Sweta Potthuri610f86f2025-05-30 00:47:23 -0500890 ... body=${data} valid_status_codes=${valid_status_codes}
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500891
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500892 # Verify SLAAC is set correctly.
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500893 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
894 ${slaac_verify}= Get From Dictionary ${resp.dict} StatelessAddressAutoConfig
895
George Keishinge6e161e2025-05-08 10:18:30 +0530896 IF '${slaac_verify['IPv6AutoConfigEnabled']}' != '${slaac_state}'
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500897 Fail msg=SLAAC not set properly.
George Keishinge6e161e2025-05-08 10:18:30 +0530898 END
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500899
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500900Set And Verify DHCPv6 Property
901 [Documentation] Set DHCPv6 property and verify.
902 [Arguments] ${dhcpv6_operating_mode}=${Disabled} ${channel_number}=${CHANNEL_NUMBER}
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500903
904 # Description of argument(s):
905 # dhcpv6_operating_mode Enabled if user wants to enable DHCPv6('Enabled' or 'Disabled').
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500906 # channel_number Channel number 1 or 2.
907
908 Set DHCPv6 Property ${dhcpv6_operating_mode} ${channel_number}
909 Verify DHCPv6 Property ${dhcpv6_operating_mode} ${channel_number}
910
911
912Set DHCPv6 Property
913 [Documentation] Set DHCPv6 attribute is enables or disabled.
914 [Arguments] ${dhcpv6_operating_mode}=${Disabled} ${channel_number}=${CHANNEL_NUMBER}
915
916 # Description of argument(s):
917 # dhcpv6_operating_mode Enabled if user wants to enable DHCPv6('Enabled' or 'Disabled').
918 # channel_number Channel number 1 or 2.
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500919
920 ${data}= Set Variable If '${dhcpv6_operating_mode}' == 'Disabled' ${DISABLE_DHCPv6} ${ENABLE_DHCPv6}
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500921 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
922
923 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
924 ... body=${data} valid_status_codes=[${HTTP_OK},${HTTP_NO_CONTENT}]
925
kvishalbd04bd62025-08-05 03:57:53 -0500926
927Verify DHCPv6 Property
928 [Documentation] Verify DHCPv6 settings is enabled or disabled.
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500929 [Arguments] ${dhcpv6_operating_mode} ${channel_number}=${CHANNEL_NUMBER}
kvishalbd04bd62025-08-05 03:57:53 -0500930
931 # Description of Argument(s):
932 # dhcpv6_operating_mode Enable/ Disable DHCPv6.
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500933 # channel_number Channel number 1 or 2.
934
Sweta Potthuri425713a2025-10-16 00:28:20 -0500935 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
kvishalbd04bd62025-08-05 03:57:53 -0500936
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500937 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
938 ${dhcpv6_verify}= Get From Dictionary ${resp.dict} DHCPv6
939
940 Should Be Equal '${dhcpv6_verify['OperatingMode']}' '${dhcpv6_operating_mode}'
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500941
Sweta Potthuri425713a2025-10-16 00:28:20 -0500942 Sleep 30s
943
944 @{ipv6_addressorigin_list} ${ipv6_dhcpv6_addr}=
945 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${channel_number}
946
947 IF "${dhcpv6_operating_mode}" == "Enabled"
948 @{ipv6_addressorigin_list} ${ipv6_dhcpv6_addr}=
949 ... Get Address Origin List And Address For Type DHCPv6 ${channel_number}
950 Should Not Be Empty ${ipv6_dhcpv6_addr} msg=DHCPv6 must be present.
951 ELSE
952 Should Not Contain ${ipv6_addressorigin_list} DHCPv6
953 END
954
955
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500956
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500957Get IPv6 Static Default Gateway
958 [Documentation] Get IPv6 static default gateway.
959
960 ${active_channel_config}= Get Active Channel Config
961 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${CHANNEL_NUMBER}']['name']}
962
963 @{ipv6_static_defgw_configurations}= Get From Dictionary ${resp.dict} IPv6StaticDefaultGateways
964 RETURN @{ipv6_static_defgw_configurations}
965
Sweta Potthuri2d085732025-07-16 09:10:08 -0500966
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500967Configure IPv6 Static Default Gateway On BMC
968 [Documentation] Configure IPv6 static default gateway on BMC.
969 [Arguments] ${ipv6_gw_addr} ${prefix_length_def}
970 ... ${valid_status_codes}=${HTTP_OK}
Sridevi Rameshed94c692025-09-07 23:41:10 -0500971
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500972 # Description of argument(s):
973 # ipv6_gw_addr IPv6 Static Default Gateway address to be configured.
974 # prefix_len_def Prefix length value (Range 1 to 128).
975 # valid_status_codes Expected return code from patch operation
976 # (e.g. "200", "204".)
977
978 # Prefix Length is passed as None.
979 IF '${prefix_length_def}' == '${None}'
980 ${ipv6_gw}= Create Dictionary Address=${ipv6_gw_addr}
981 ELSE
982 ${ipv6_gw}= Create Dictionary Address=${ipv6_gw_addr} Prefix Length=${prefix_length_def}
983 END
984
985 ${ipv6_static_def_gw}= Get IPv6 Static Default Gateway
986
987 ${num_entries}= Get Length ${ipv6_static_def_gw}
988
989 ${patch_list}= Create List
990 ${empty_dict}= Create Dictionary
991
992 FOR ${INDEX} IN RANGE 0 ${num_entries}
993 Append To List ${patch_list} ${empty_dict}
994 END
995
996 ${valid_status_codes}= Set Variable If '${valid_status_codes}' == '${HTTP_OK}'
997 ... ${HTTP_OK},${HTTP_NO_CONTENT}
998 ... ${valid_status_codes}
999
1000 Append To List ${patch_list} ${ipv6_gw}
1001 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
1002
1003 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1004 ... body=${data} valid_status_codes=[${valid_status_codes}]
1005
1006 # Verify the added static default gateway is present in Redfish Get Output.
1007 ${ipv6_staticdef_gateway}= Get IPv6 Static Default Gateway
1008
1009 ${ipv6_static_def_gw_list}= Create List
1010 FOR ${ipv6_staticdef_gateway} IN @{ipv6_staticdef_gateway}
1011 ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address
1012 Append To List ${ipv6_static_def_gw_list} ${value}
1013 END
1014
1015 IF '${valid_status_codes}' != '${HTTP_OK},${HTTP_NO_CONTENT}'
1016 Should Not Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr}
1017 ELSE
1018 Should Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr}
1019 END
1020
Sweta Potthuri2d085732025-07-16 09:10:08 -05001021
Anvesh-Kumar_Rayankula019d9362025-09-03 22:55:12 -05001022Modify IPv6 Static Default Gateway On BMC
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001023 [Documentation] Modify and verify IPv6 address of BMC.
1024 [Arguments] ${ipv6_gw_addr} ${new_static_def_gw} ${prefix_length}
1025 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED}]
Sweta Potthuri2edacd32025-07-02 01:04:43 -05001026
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001027 # Description of argument(s):
1028 # ipv6_gw_addr IPv6 static default gateway address to be replaced (e.g. "2001:AABB:CCDD::AAFF").
1029 # new_static_def_gw New static default gateway address to be configured.
Sridevi Rameshed94c692025-09-07 23:41:10 -05001030 # prefix_length Prefix length value (Range 1 to 128).
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001031 # valid_status_codes Expected return code from patch operation
1032 # (e.g. "200", "204").
Sweta Potthuri2edacd32025-07-02 01:04:43 -05001033
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001034 ${empty_dict}= Create Dictionary
1035 ${patch_list}= Create List
1036 # Prefix Length is passed as None.
1037 IF '${prefix_length_def}' == '${None}'
1038 ${modified_ipv6_gw_addripv6_data}= Create Dictionary Address=${new_static_def_gw}
1039 ELSE
1040 ${modified_ipv6_gw_addripv6_data}= Create Dictionary Address=${new_static_def_gw} Prefix Length=${prefix_length_def}
1041 END
Sweta Potthuri2edacd32025-07-02 01:04:43 -05001042
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001043 @{ipv6_static_def_gw_list}= Get IPv6 Static Default Gateway
1044
1045 FOR ${ipv6_static_def_gw} IN @{ipv6_static_def_gw_list}
1046 IF '${ipv6_static_def_gw['Address']}' == '${ipv6_gw_addr}'
1047 Append To List ${patch_list} ${modified_ipv6_gw_addripv6_data}
1048 ELSE
1049 Append To List ${patch_list} ${empty_dict}
1050 END
1051 END
1052
1053 # Modify the IPv6 address only if given IPv6 static default gateway is found.
1054 ${ip_static_def_gw_found}= Run Keyword And Return Status List Should Contain Value
1055 ... ${patch_list} ${modified_ipv6_gw_addripv6_data} msg=${ipv6_gw_addr} does not exist on BMC
1056 Pass Execution If ${ip_static_def_gw_found} == ${False} ${ipv6_gw_addr} does not exist on BMC
1057
1058 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
1059
1060 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1061 ... body=&{data} valid_status_codes=${valid_status_codes}
1062
1063 ${ipv6_staticdef_gateway}= Get IPv6 Static Default Gateway
1064
1065 ${ipv6_static_def_gw_list}= Create List
1066 FOR ${ipv6_staticdef_gateway} IN @{ipv6_staticdef_gateway}
Sweta Potthuri2d085732025-07-16 09:10:08 -05001067 ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001068 Append To List ${ipv6_static_def_gw_list} ${value}
1069 END
1070
1071 Should Contain ${ipv6_static_def_gw_list} ${new_static_def_gw}
1072 # Verify if old static default gateway address is erased.
1073 Should Not Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr}
1074
Sweta Potthuri2d085732025-07-16 09:10:08 -05001075
1076Delete IPv6 Static Default Gateway
1077 [Documentation] Delete IPv6 static default gateway on BMC.
1078 [Arguments] ${ipv6_gw_addr}
1079 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]
1080
1081 # Description of argument(s):
1082 # ipv6_gw_addr IPv6 Static Default Gateway address to be deleted.
1083 # valid_status_codes Expected return code from patch operation
1084 # (e.g. "200").
1085
1086 ${patch_list}= Create List
1087 ${empty_dict}= Create Dictionary
1088
1089 ${ipv6_static_def_gw_list}= Create List
1090 @{ipv6_static_defgw_configurations}= Get IPv6 Static Default Gateway
1091
1092 FOR ${ipv6_staticdef_gateway} IN @{ipv6_static_defgw_configurations}
1093 ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address
1094 Append To List ${ipv6_static_def_gw_list} ${value}
1095 END
1096
1097 ${defgw_found}= Run Keyword And Return Status List Should Contain Value
1098 ... ${ipv6_static_def_gw_list} ${ipv6_gw_addr} msg=${ipv6_gw_addr} does not exist on BMC
1099 Skip If ${defgw_found} == ${False} ${ipv6_gw_addr} does not exist on BMC
1100
1101 FOR ${ipv6_static_def_gw} IN @{ipv6_static_defgw_configurations}
1102 IF '${ipv6_static_def_gw['Address']}' == '${ipv6_gw_addr}'
1103 Append To List ${patch_list} ${null}
1104 ELSE
1105 Append To List ${patch_list} ${empty_dict}
1106 END
1107 END
1108
1109 # Run patch command only if given IP is found on BMC.
1110 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
1111
1112 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
1113 ... valid_status_codes=${valid_status_codes}
1114
1115 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
1116
1117 @{ipv6_static_defgw_configurations}= Get IPv6 Static Default Gateway
1118 Should Not Contain Match ${ipv6_static_defgw_configurations} ${ipv6_gw_addr}
1119 ... msg=IPv6 Static default gateway does not exist.
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001120
1121
1122Check Coexistence Of Linklocalv6 And Static IPv6
1123 [Documentation] Verify both linklocalv6 and static IPv6 exist.
1124
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001125 # Verify the address origin contains static and linklocal.
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001126 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001127
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001128 Should Match Regexp ${ipv6_linklocal_addr} ${linklocal_addr_format}
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001129 Should Contain ${ipv6_addressorigin_list} Static
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -05001130
1131
abhijith-12197078c52025-09-25 01:13:00 -05001132Check Coexistence Of Static IPv6 And SLAAC
abhijith-1214dc01a02025-09-24 11:29:55 -05001133 [Documentation] Verify both static IPv6 and SLAAC coexist.
abhijith-12197078c52025-09-25 01:13:00 -05001134
1135 # Verify the address origin contains static and slaac.
1136 @{ipv6_addressorigin_list} ${ipv6_static_addr}=
1137 ... Get Address Origin List And Address For Type Static
1138
1139 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1140 ... Get Address Origin List And Address For Type SLAAC
1141
1142
abhijith-1214dc01a02025-09-24 11:29:55 -05001143Check Coexistence Of Link Local And SLAAC
1144 [Documentation] Verify both link local and SLAAC coexist.
1145
1146 # Verify the address origin contains SLAAC and link local.
1147 @{ipv6_addressorigin_list} ${ipv6_link_local_addr}=
1148 ... Get Address Origin List And Address For Type LinkLocal
1149
1150 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1151 ... Get Address Origin List And Address For Type SLAAC
1152
1153 Should Match Regexp ${ipv6_link_local_addr} ${linklocal_addr_format}
1154
1155
abhijith-1218ff5db42025-09-24 06:24:03 -05001156Check Coexistence Of Link Local And DHCPv6
1157 [Documentation] Verify both link local and dhcpv6 coexist.
1158
1159 # Verify the address origin contains dhcpv6 and link local.
1160 @{ipv6_address_origin_list} ${ipv6_link_local_addr}=
1161 ... Get Address Origin List And Address For Type LinkLocal
1162
1163 @{ipv6_address_origin_list} ${ipv6_dhcpv6_addr}=
1164 ... Get Address Origin List And Address For Type DHCPv6
1165
1166 Should Match Regexp ${ipv6_link_local_addr} ${linklocal_addr_format}
1167
1168
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -05001169Check If Linklocal Address Is In Correct Format
1170 [Documentation] Linklocal address has network part fe80 and host part EUI64.
1171
1172 # Fetch the linklocal address.
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001173 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -05001174
1175 # Follow EUI64 from MAC.
1176 ${system_mac}= Get BMC MAC Address
1177 ${split_octets}= Split String ${system_mac} :
1178 ${first_octet}= Evaluate int('${split_octets[0]}', 16)
1179 ${flipped_hex}= Evaluate format(${first_octet} ^ 2, '02x')
1180 ${grp1}= Evaluate re.sub(r'^0+', '', '${flipped_hex}${split_octets[1]}') modules=re
1181 ${grp2}= Evaluate re.sub(r'^0+', '', '${split_octets[2]}ff') modules=re
1182 ${grp3}= Evaluate re.sub(r'^0+', '', '${split_octets[4]}${split_octets[5]}') modules=re
1183 ${linklocal}= Set Variable fe80::${grp1}:${grp2}:fe${split_octets[3]}:${grp3}
1184
1185 # Verify the linklocal obtained is the same as on the machine.
1186 Should Be Equal ${linklocal} ${ipv6_linklocal_addr}
1187
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001188
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001189Check BMC Gets SLAAC Address
1190 [Documentation] Check BMC gets slaac address.
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001191
1192 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= Get Address Origin List And Address For Type SLAAC
1193
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001194
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001195Get The Initial DHCPv6 Setting On Each Interface
1196 [Documentation] Get the initial DHCPv6 setting of each interface.
1197 [Arguments] ${channel_number}
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001198
1199 # Description of the argument(s):
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001200 # channel_number Channel number 1 or 2.
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001201
1202 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
1203 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1204 ${initial_dhcpv6_iface}= Get From Dictionary ${resp.dict} DHCPv6
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001205 IF ${channel_number}==${1}
1206 Set Test Variable ${dhcpv6_channel_1} ${initial_dhcpv6_iface['OperatingMode']}
1207 ELSE
1208 Set Test Variable ${dhcpv6_channel_2} ${initial_dhcpv6_iface['OperatingMode']}
1209 END
1210
1211
1212Get The Initial DHCPv6 Settings
1213 [Documentation] Get the initial DHCPv6 settings of both the interfaces.
1214
1215 Get The Initial DHCPv6 Setting On Each Interface ${1}
1216 Get The Initial DHCPv6 Setting On Each Interface ${2}
1217
1218
1219Get The Initial SLAAC Settings
1220 [Documentation] Get the initial SLAAC settings of both the interfaces.
1221
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001222 Get The Initial SLAAC Setting On Each Interface ${1}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001223 Get The Initial SLAAC Setting On Each Interface ${2}
1224
1225
1226Get The Initial SLAAC Setting On Each Interface
1227 [Documentation] Get the initial SLAAC setting of the interface.
1228 [Arguments] ${channel_number}
1229
1230 # Description of the argument(s):
1231 # channel_number Channel number 1 or 2.
1232
1233 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
1234 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1235 ${initial_slaac_iface}= Get From Dictionary ${resp.dict} StatelessAddressAutoConfig
1236 IF ${channel_number}==${1}
1237 Set Test Variable ${slaac_channel_1} ${initial_slaac_iface['IPv6AutoConfigEnabled']}
1238 ELSE
1239 Set Test Variable ${slaac_channel_2} ${initial_slaac_iface['IPv6AutoConfigEnabled']}
1240 END
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001241
1242
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001243Get Address Origin List And IPv4 or IPv6 Address
1244 [Documentation] Get address origin list and address for type.
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001245 [Arguments] ${ip_address_type} ${channel_number}=${CHANNEL_NUMBER}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001246
1247 # Description of the argument(s):
Sridevi Rameshed94c692025-09-07 23:41:10 -05001248 # ip_address_type Type of IPv4 or IPv6 address to be checked.
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001249 # channel_number Channel number 1(eth0) or 2(eth1).
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001250
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001251 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${channel_number}']['name']}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001252 @{ip_addresses}= Get From Dictionary ${resp.dict} ${ip_address_type}
1253
1254 ${ip_addressorigin_list}= Create List
1255 ${ip_addr_list}= Create List
1256 FOR ${ip_address} IN @{ip_addresses}
1257 ${ip_addressorigin}= Get From Dictionary ${ip_address} AddressOrigin
1258 Append To List ${ip_addressorigin_list} ${ip_addressorigin}
1259 Append To List ${ip_addr_list} ${ip_address['Address']}
1260 END
1261 RETURN ${ip_addressorigin_list} ${ip_addr_list}
1262
1263
1264Verify All The Addresses Are Intact
1265 [Documentation] Verify all the addresses and address origins remain intact.
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001266 [Arguments] ${channel_number}=${CHANNEL_NUMBER}
1267 ... ${initial_ipv4_addressorigin_list}=${initial_ipv4_addressorigin_list}
1268 ... ${initial_ipv4_addr_list}=${initial_ipv4_addr_list}
1269
1270 # Description of argument(s):
1271 # channel_number Channel number 1(eth0) or 2(eth1).
1272 # initial_ipv4_addressorigin_list Initial IPv4 address origin list.
1273 # initial_ipv4_addr_list Initial IPv4 address list.
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001274
1275 # Verify that it will not impact the IPv4 configuration.
1276 Sleep ${NETWORK_TIMEOUT}
1277 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
1278
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001279 # IPv6 Linklocal address must be present.
1280 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}=
1281 ... Get Address Origin List And Address For Type LinkLocal ${channel_number}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001282
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001283 # IPv4 addresses must remain intact.
1284 ${ipv4_addressorigin_list} ${ipv4_addr_list}=
1285 ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${channel_number}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001286
1287 Should be Equal ${initial_ipv4_addressorigin_list} ${ipv4_addressorigin_list}
1288 Should be Equal ${initial_ipv4_addr_list} ${ipv4_addr_list}
Sweta Potthurif3d188f2025-09-08 07:17:31 -05001289
1290
1291Get Interface ID Of IPv6
1292 [Documentation] Get interface id of IPv6 address.
1293 [Arguments] ${ipv6_address}
1294
1295 # Description of the argument(s):
1296 # ${ipv6_address} IPv6 Address to extract the last 4 hextets.
1297
1298 # Last 64 bits of SLAAC and Linklocal must be the same.
1299 # Sample IPv6 network configurations.
1300 #"IPv6AddressPolicyTable": [],
1301 # "IPv6Addresses": [
1302 # {
1303 # "Address": "fe80::xxxx:xxxx:xxxx:xxxx",
1304 # "AddressOrigin": "LinkLocal",
1305 # "AddressState": null,
1306 # "PrefixLength": xx
1307 # }
1308 # ],
1309 # {
1310 # "Address": "2002:xxxx:xxxx:xxxx:xxxx",
1311 # "AddressOrigin": "SLAAC",
1312 # "PrefixLength": 64
1313 # }
1314 # ],
1315
1316 ${split_ip_address}= Split String ${ipv6_address} :
1317 ${missing_ip}= Evaluate 8 - len(${split_ip_address}) + 1
1318 ${expanded_ip}= Create List
1319
1320 FOR ${hextet} IN @{split_ip_address}
1321 IF '${hextet}' == ''
1322 FOR ${i} IN RANGE ${missing_ip}
1323 Append To List ${expanded_ip} 0000
1324 END
1325 ELSE
1326 Append To List ${expanded_ip} ${hextet}
1327 END
1328 END
1329 ${interface_id}= Evaluate ':'.join(${expanded_ip}[-4:])
1330 RETURN ${interface_id}
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001331
1332
1333Set And Verify SLAAC Property On Both Interfaces
1334 [Documentation] Set and verify SLAAC property on both interfaces.
1335 [Arguments] ${slaac_value_1} ${slaac_value_2}
1336
1337 # Description of the argument(s):
1338 # slaac_value_1 SLAAC value for channel 1.
1339 # slaac_value_2 SLAAC value for channel 2.
1340
1341 Set SLAAC Configuration State And Verify ${slaac_value_1} [${HTTP_OK}] ${1}
1342 Set SLAAC Configuration State And Verify ${slaac_value_2} [${HTTP_OK}] ${2}
1343
1344 Sleep 30s
1345
1346 # Check SLAAC Settings for eth0.
1347 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1348 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${1}
1349 IF "${slaac_value_1}" == "${True}"
1350 Should Not Be Empty ${ipv6_slaac_addr} SLAAC
1351 ELSE
1352 Should Not Contain ${ipv6_addressorigin_list} SLAAC
1353 END
1354
1355 # Check SLAAC Settings for eth1.
1356 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1357 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${2}
1358 IF "${slaac_value_2}" == "${True}"
1359 Should Not Be Empty ${ipv6_slaac_addr} SLAAC
1360 ELSE
1361 Should Not Contain ${ipv6_addressorigin_list} SLAAC
1362 END
1363
1364 Verify All The Addresses Are Intact ${1}
1365 Verify All The Addresses Are Intact ${2}
1366 ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}
1367
Sweta Potthuri425713a2025-10-16 00:28:20 -05001368
1369Set And Verify DHCPv6 Property On Both Interfaces
1370 [Documentation] Set and verify DHCPv6 property on both interfaces.
1371 [Arguments] ${dhcpv6_value_1} ${dhcpv6_value_2}
1372
1373 # Description of the argument(s):
1374 # dhcpv6_value_1 DHCPv6 value for channel 1.
1375 # dhcpv6_value_2 DHCPv6 value for channel 2.
1376
1377 Set And Verify DHCPv6 Property ${dhcpv6_value_1} ${1}
1378 Set And Verify DHCPv6 Property ${dhcpv6_value_2} ${2}
1379
1380 Verify All The Addresses Are Intact ${1}
1381 Verify All The Addresses Are Intact ${2}
1382 ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}
abhijith-121d8322b72025-10-13 02:23:48 -05001383
1384
1385Verify IPv6 Addresses Coexist
1386 [Documentation] Verify IPv6 address type coexist.
1387 [Arguments] ${ipv6_address_type1} ${ipv6_address_type2}
1388
1389 # Description of the argument(s):
1390 # ipv6_address_type1 IPv6 address type.
1391 # ipv6_address_type2 IPv6 address type.
1392 # Valid IPv6 address type (Static, DHCPv6, SLAAC).
1393
1394 IF '${ipv6_address_type1}' == 'Static' and '${ipv6_address_type2}' == 'DHCPv6'
1395 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
1396 Set And Verify DHCPv6 Property Enabled
1397 ELSE IF '${ipv6_address_type1}' == 'DHCPv6' and '${ipv6_address_type2}' == 'SLAAC'
1398 Set And Verify DHCPv6 Property Enabled
1399 Set SLAAC Configuration State And Verify ${True}
1400 ELSE IF '${ipv6_address_type1}' == 'SLAAC' and '${ipv6_address_type2}' == 'Static'
1401 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
1402 Set SLAAC Configuration State And Verify ${True}
1403 ELSE IF '${ipv6_address_type1}' == 'Static' and '${ipv6_address_type2}' == 'Static'
1404 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
1405 Configure IPv6 Address On BMC ${test_ipv6_addr1} ${test_prefix_length}
1406 END
1407
1408 Sleep ${NETWORK_TIMEOUT}s
1409
1410 # Verify coexistence.
1411 Verify The Coexistence Of The Address Type ${ipv6_address_type1} ${ipv6_address_type2}
1412
1413 IF '${ipv6_address_type1}' == 'Static' or '${ipv6_address_type2}' == 'Static'
1414 Delete IPv6 Address ${test_ipv6_addr}
1415 END
1416 IF '${ipv6_address_type1}' == 'Static' and '${ipv6_address_type2}' == 'Static'
1417 Delete IPv6 Address ${test_ipv6_addr1}
1418 END
1419
1420 Set And Verify DHCPv6 Property Disabled
1421 Set SLAAC Configuration State And Verify ${False}