blob: 1ba79a42627a20052f82ada7f34060f0e1810552 [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
37${ipv6_eliminate_zero} 2001:22:33::111
Prashanth Katti8abbb4d2021-01-29 02:17:45 -060038
39*** Test Cases ***
40
41Get IPv6 Address And Verify
42 [Documentation] Get IPv6 Address And Verify.
43 [Tags] Get_IPv6_Address_And_Verify
44
45 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
46 Verify IPv6 On BMC ${ipv6_network_configuration['Address']}
47 END
48
49
Prashanth Katti2c73abc2021-03-17 07:42:25 -050050Get PrefixLength And Verify
51 [Documentation] Get IPv6 prefix length and verify.
52 [Tags] Get_PrefixLength_And_Verify
53
54 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
55 Verify IPv6 On BMC ${ipv6_network_configuration['PrefixLength']}
56 END
57
58
59Get IPv6 Default Gateway And Verify
George Keishing96143832021-03-23 07:55:08 -050060 [Documentation] Get IPv6 default gateway and verify.
George Keishingade6ab42022-07-19 11:41:03 -050061 [Tags] Get_IPv6_Default_Gateway_And_Verify
Prashanth Katti2c73abc2021-03-17 07:42:25 -050062
63 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
64 ${ipv6_gateway}= Get From Dictionary ${resp.dict} IPv6DefaultGateway
65 Verify IPv6 Default Gateway On BMC ${ipv6_gateway}
66
67
Prashanth Kattic1d2daa2022-07-26 03:53:06 -050068Verify All Configured IPv6 And PrefixLength On BMC
69 [Documentation] Verify IPv6 address and its prefix length on BMC.
70 [Tags] Verify_All_Configured_IPv6_And_PrefixLength_On_BMC
71
72 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
George Keishingf02ca2b2023-04-05 22:11:03 +053073 Verify IPv6 And PrefixLength ${ipv6_network_configuration['Address']}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -050074 ... ${ipv6_network_configuration['PrefixLength']}
75 END
76
77
78Configure IPv6 Address And Verify
79 [Documentation] Configure IPv6 address and verify.
80 [Tags] Configure_IPv6_Address_And_Verify
Anvesh-Kumar_Rayankula3a26c662025-04-16 01:19:26 -050081 [Teardown] Run Keywords
82 ... Delete IPv6 Address ${test_ipv6_addr} AND Test Teardown Execution
Prashanth Kattic1d2daa2022-07-26 03:53:06 -050083 [Template] Configure IPv6 Address On BMC
84
85
86 # IPv6 address Prefix length
87 ${test_ipv6_addr} ${test_prefix_length}
88
89
Prashanth Katti12ed4b72023-05-16 05:24:00 -050090Delete IPv6 Address And Verify
91 [Documentation] Delete IPv6 address and verify.
92 [Tags] Delete_IPv6_Address_And_Verify
93
94 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
95
96 Delete IPv6 Address ${test_ipv6_addr}
97
98
George Keishingcc288312024-10-22 10:13:12 +053099Modify IPv6 Address And Verify
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500100 [Documentation] Modify IPv6 address and verify.
101 [Tags] Modify_IPv6_Address_And_Verify
kvishal88de8c42025-03-04 01:45:10 -0600102 [Teardown] Run Keywords
George Keishingcfdd0992025-03-17 11:59:20 +0530103 ... Delete IPv6 Address ${test_ipv6_addr1} AND Test Teardown Execution
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500104
105 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
106
107 Modify IPv6 Address ${test_ipv6_addr} ${test_ipv6_addr1} ${test_prefix_length}
108
109
Sweta Potthuriafe858e2025-02-25 23:52:51 -0600110Verify Persistency Of IPv6 After BMC Reboot
111 [Documentation] Verify persistency of IPv6 after BMC reboot.
112 [Tags] Verify_Persistency_Of_IPv6_After_BMC_Reboot
113 [Teardown] Run Keywords
114 ... Delete IPv6 Address ${test_ipv6_addr} AND Test Teardown Execution
115
116 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
117
118 Redfish OBMC Reboot (off) stack_mode=skip
119
120 # Verifying persistency of IPv6.
121 Verify IPv6 On BMC ${test_ipv6_addr}
122
123
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500124Enable SLAAC On BMC And Verify
125 [Documentation] Enable SLAAC on BMC and verify.
126 [Tags] Enable_SLAAC_On_BMC_And_Verify
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500127
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500128 Set SLAAC Configuration State And Verify ${True}
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500129
130
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500131Enable DHCPv6 Property On BMC And Verify
132 [Documentation] Enable DHCPv6 property on BMC and verify.
133 [Tags] Enable_DHCPv6_Property_On_BMC_And_Verify
134
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500135 Set And Verify DHCPv6 Property Enabled
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500136
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500137
kvishal0d199a92025-05-29 02:35:18 -0500138Disable DHCPv6 Property On BMC And Verify
139 [Documentation] Disable DHCPv6 property on BMC and verify.
140 [Tags] Disable_DHCPv6_Property_On_BMC_And_Verify
141
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500142 Set And Verify DHCPv6 Property Disabled
kvishalbd04bd62025-08-05 03:57:53 -0500143
144
145Verify Persistency Of DHCPv6 On Reboot
146 [Documentation] Verify persistency of DHCPv6 property on reboot.
147 [Tags] Verify_Persistency_Of_DHCPv6_On_Reboot
148
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500149 Set And Verify DHCPv6 Property Enabled
150 Redfish OBMC Reboot (off) stack_mode=skip
151 Verify DHCPv6 Property Enabled
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500152
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500153
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500154Configure Invalid Static IPv6 And Verify
155 [Documentation] Configure invalid static IPv6 and verify.
156 [Tags] Configure_Invalid_Static_IPv6_And_Verify
157 [Template] Configure IPv6 Address On BMC
158
kvishal9c6774c2025-09-10 02:14:07 -0500159 #invalid_ipv6 prefix length valid_status_code
160 ${ipv4_hexword_addr} ${test_prefix_length} ${HTTP_BAD_REQUEST}
161 ${invalid_hexadec_ipv6} ${test_prefix_length} ${HTTP_BAD_REQUEST}
162 ${ipv6_multi_short} ${test_prefix_length} ${HTTP_BAD_REQUEST}
163
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500164
Sweta Potthuri565318d2025-06-09 06:13:46 -0500165
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500166Configure IPv6 Static Default Gateway And Verify
167 [Documentation] Configure IPv6 static default gateway and verify.
168 [Tags] Configure_IPv6_Static_Default_Gateway_And_Verify
169 [Template] Configure IPv6 Static Default Gateway On BMC
Sweta Potthuri565318d2025-06-09 06:13:46 -0500170
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500171 # static_def_gw prefix length valid_status_code
172 ${ipv6_gw_addr} ${prefix_length_def} ${HTTP_OK}
173 ${invalid_staticv6_gateway} ${test_prefix_length} ${HTTP_BAD_REQUEST}
Sweta Potthuri565318d2025-06-09 06:13:46 -0500174
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500175
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500176Modify Static Default Gateway And Verify
177 [Documentation] Modify static default gateway and verify.
178 [Tags] Modify_Static_Default_Gateway_And_Verify
179 [Setup] Configure IPv6 Static Default Gateway On BMC ${ipv6_gw_addr} ${prefix_length_def}
180
181 Modify IPv6 Static Default Gateway On BMC ${test_ipv6_addr1} ${prefix_length_def} ${HTTP_OK} ${ipv6_gw_addr}
182
183
Sweta Potthuri2d085732025-07-16 09:10:08 -0500184Delete IPv6 Static Default Gateway And Verify
185 [Documentation] Delete IPv6 static default gateway and verify.
186 [Tags] Delete_IPv6_Static_Default_Gateway_And_Verify
187 [Setup] Configure IPv6 Static Default Gateway On BMC ${ipv6_gw_addr} ${prefix_length_def}
188
189 Delete IPv6 Static Default Gateway ${ipv6_gw_addr}
190
191
Sweta Potthuri35c503b2025-07-27 23:36:20 -0500192Verify Coexistence Of Linklocalv6 And Static IPv6 On BMC
193 [Documentation] Verify linklocalv6 And static IPv6 both exist.
194 [Tags] Verify_Coexistence_Of_Linklocalv6_And_Static_IPv6_On_BMC
Anvesh-Kumar_Rayankula019d9362025-09-03 22:55:12 -0500195 [Setup] Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
196 [Teardown] Delete IPv6 Address ${test_ipv6_addr}
Sweta Potthuri35c503b2025-07-27 23:36:20 -0500197
198 Check Coexistence Of Linklocalv6 And Static IPv6
199
200
George Keishingbadb4c62025-09-18 16:14:12 +0530201Verify IPv6 Linklocal Address Is In Correct Format
202 [Documentation] Verify linklocal address has network part as fe80 and
203 ... host part as EUI64.
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -0500204 [Tags] Verify_IPv6_Linklocal_Address_Is_In_Correct_Format
205
206 Check If Linklocal Address Is In Correct Format
207
208
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500209Verify BMC Gets SLAAC Address On Enabling SLAAC
210 [Documentation] On enabling SLAAC verify SLAAC address comes up.
211 [Tags] Verify_BMC_Gets_SLAAC_Address_On_Enabling_SLAAC
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500212 [Setup] Set SLAAC Configuration State And Verify ${False}
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500213
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500214 Set SLAAC Configuration State And Verify ${True}
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500215 Sleep ${NETWORK_TIMEOUT}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500216 Check BMC Gets SLAAC Address
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500217
218
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500219Verify Enable And Disable SLAAC On Both Interfaces
220 [Documentation] Verify enable and disable SLAAC on both the interfaces.
221 [Tags] Verify_Enable_And_Disable_SLAAC_On_Both_Interfaces
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500222 [Setup] Get The Initial SLAAC Settings
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500223 [Template] Set And Verify SLAAC Property On Both Interfaces
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500224 [Teardown] Run Keywords Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1}
225 ... AND Set SLAAC Configuration State And Verify ${slaac_channel_2} [${HTTP_OK}] ${2}
226
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500227 # slaac_eth0 slaac_eth1
228 ${True} ${True}
229 ${True} ${False}
230 ${False} ${True}
231 ${False} ${False}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500232
233
Sweta Potthuri425713a2025-10-16 00:28:20 -0500234Configure And Validate DHCPv6 Settings On Both Network Interfaces
235 [Documentation] Configure and validate the DHCPv6 enable/disable settings
236 ... on both network interfaces.
237 [Tags] Configure_And_Validate_DHCPv6_Settings_On_Both_Network_Interfaces
238 [Setup] Get The Initial DHCPv6 Settings
239 [Template] Set And Verify DHCPv6 Property On Both Interfaces
240 [Teardown] Run Keywords Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1} AND
241 ... Set And Verify DHCPv6 Property ${dhcpv6_channel_2} ${2}
242
243 # DHCPv6_eth0 DHCPv6_eth1
244 Enabled Enabled
245 Enabled Disabled
246 Disabled Enabled
247 Disabled Disabled
248
249
abhijith-1213a645902025-09-08 01:12:34 -0500250Verify Autoconfig Is Present On Ethernet Interface
251 [Documentation] Verify autoconfig is present on ethernet interface.
252 [Tags] Verify_Autoconfig_Is_Present_On_Ethernet_Interface
253
254 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
255 Should Contain ${resp.dict} StatelessAddressAutoConfig
256
257
Sweta Potthurif3d188f2025-09-08 07:17:31 -0500258Verify Interface ID Of SLAAC And LinkLocal Addresses Are Same
259 [Documentation] Validate interface id of SLAAC and link-local addresses are same.
260 [Tags] Verify_Interface_ID_Of_SLAAC_And_LinkLocal_Addresses_Are_Same
261
262 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
263 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= Get Address Origin List And Address For Type SLAAC
264
265 ${linklocal_interface_id}= Get Interface ID Of IPv6 ${ipv6_linklocal_addr}
266 ${slaac_interface_id}= Get Interface ID Of IPv6 ${ipv6_slaac_addr}
267
268 Should Be Equal ${linklocal_interface_id} ${slaac_interface_id}
269
270
abhijith-121c3e96d72025-09-09 11:35:09 -0500271Verify Persistency Of Link Local IPv6 On BMC Reboot
272 [Documentation] Verify persistency of link local on BMC reboot.
273 [Tags] Verify_Persistency_Of_Link_Local_IPv6_On_BMC_Reboot
274
275 # Capturing the linklocal before reboot.
276 @{ipv6_address_origin_list} ${linklocal_addr_before_reboot}=
277 ... Get Address Origin List And Address For Type LinkLocal
278
279 # Rebooting BMC.
280 Redfish OBMC Reboot (off) stack_mode=skip
281
282 @{ipv6_address_origin_list} ${linklocal_addr_after_reboot}=
283 ... Get Address Origin List And Address For Type LinkLocal
284
285 # Verifying the linklocal must be the same before and after reboot.
286 Should Be Equal ${linklocal_addr_before_reboot} ${linklocal_addr_after_reboot}
287 ... msg=IPv6 Linklocal address has changed after reboot.
288
289
Sweta Potthuri2f3fbb52025-09-19 00:50:47 -0500290Modify MAC and Verify BMC Reinitializing Linklocal
291 [Documentation] Modify MAC and verify BMC reinitializing linklocal.
292 [Tags] Modify_MAC_and_Verify_BMC_Reinitializing_Linklocal
293 [Teardown] Configure MAC Settings ${original_address}
294
295 ${original_address}= Get BMC MAC Address
296 @{ipv6_addressorigin_list} ${ipv6_before_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
297
298 # Modify MAC Address Of Ethernet Interface.
299 Configure MAC Settings ${new_mac_addr}
300 Sleep 30s
301 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
302 @{ipv6_addressorigin_list} ${ipv6_linklocal_after_addr}= Get Address Origin List And Address For Type LinkLocal
303
304 # Verify whether the linklocal has changed and is in the the correct format.
305 Check If Linklocal Address Is In Correct Format
306 Should Not Be Equal ${ipv6_before_linklocal_addr} ${ipv6_linklocal_after_addr}
307
308
abhijith-121bfbd03a2025-09-15 01:40:35 -0500309Add Multiple IPv6 Address And Verify
310 [Documentation] Add multiple IPv6 address and verify.
311 [Tags] Add_Multiple_IPv6_Address_And_Verify
312 [Teardown] Run Keywords
313 ... Delete IPv6 Address ${test_ipv6_addr} AND Delete IPv6 Address ${test_ipv6_addr1}
314 ... AND Test Teardown Execution
315
316 Configure Multiple IPv6 Address on BMC ${test_prefix_length}
317
318
abhijith-12197078c52025-09-25 01:13:00 -0500319Verify Coexistence Of Static IPv6 And SLAAC On BMC
abhijith-1214dc01a02025-09-24 11:29:55 -0500320 [Documentation] Verify static IPv6 And SLAAC both coexist.
abhijith-12197078c52025-09-25 01:13:00 -0500321 [Tags] Verify_Coexistence_Of_Static_IPv6_And_SLAAC_On_BMC
322 [Setup] Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
323 Set SLAAC Configuration State And Verify ${True}
324 [Teardown] Delete IPv6 Address ${test_ipv6_addr}
325
326 Sleep ${NETWORK_TIMEOUT}s
327
328 Check Coexistence Of Static IPv6 And SLAAC
329
330
abhijith-1218ff5db42025-09-24 06:24:03 -0500331Verify Coexistence Of Link Local And DHCPv6 On BMC
332 [Documentation] Verify link local And dhcpv6 both coexist.
333 [Tags] Verify_Coexistence_Of_Link_Local_And_DHCPv6_On_BMC
334 [Setup] Set DHCPv6 Property Enabled ${2}
335
336 Sleep ${NETWORK_TIMEOUT}s
337
338 Check Coexistence Of Link Local And DHCPv6
339
340
abhijith-1214dc01a02025-09-24 11:29:55 -0500341Verify Coexistence Of Link Local And SLAAC On BMC
342 [Documentation] Verify link local And SLAAC both coexist.
343 [Tags] Verify_Coexistence_Of_Link_Local_And_SLAAC_On_BMC
344 [Setup] Set SLAAC Configuration State And Verify ${True}
345
346 Sleep ${NETWORK_TIMEOUT}s
347
348 Check Coexistence Of Link Local And SLAAC
349
350
abhijith-121ffea1912025-10-06 02:39:22 -0500351Verify Coexistence Of All IPv6 Type Addresses On BMC
352 [Documentation] Verify coexistence of link local, static, DHCPv6 and SLAAC ipv6 addresses.
353 [Tags] Verify_Coexistence_Of_All_IPv6_Type_Addresses_On_BMC
354 [Setup] Run Keywords Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
355 ... AND Get The Initial DHCPv6 Setting On Each Interface ${1}
356 ... AND Set And Verify DHCPv6 Property Enabled
357 ... AND Get The Initial SLAAC Setting On Each Interface ${1}
358 ... AND Set SLAAC Configuration State And Verify ${True}
359 [Teardown] Run Keywords Delete IPv6 Address ${test_ipv6_addr}
360 ... AND Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1}
361 ... AND Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1}
362
363 Sleep ${NETWORK_TIMEOUT}s
364
365 # Verify link local, static, DHCPv6 and SLAAC ipv6 addresses coexist.
366 Verify The Coexistence Of The Address Type LinkLocal Static DHCPv6 SLAAC
367
368
abhijith-1219e190dd2025-10-15 03:35:06 -0500369Configure Link Local IPv6 Address And Verify
370 [Documentation] Configure link local IPv6 address and verify.
371 [Tags] Configure_Link_Local_IPv6_Address_And_Verify
372
373 Configure IPv6 Address On BMC ${link_local_addr} ${link_local_prefix_len}
374
375 # Verify the address origin contains link local.
376 @{ipv6_address_origin_list} ${ipv6_link_local_addr}=
377 ... Get Address Origin List And Address For Type LinkLocal
378
379 ${count}= Evaluate ${ipv6_address_origin_list}.count("LinkLocal")
380
381 Should Be Equal As Integers ${count} 2
382
383
abhijith-121b9fc2742025-10-14 09:46:43 -0500384Configure IPv6 With Leading Zeros And Verify
385 [Documentation] Configure IPv6 with leading zeros & verify address is configured by eliminating 0s in multiple hextets.
386 [Tags] Configure_IPv6_with_Leading_Zeros_And_Verify
387 [Teardown] Run Keywords
388 ... Delete IPv6 Address ${ipv6_eliminate_zero} AND Test Teardown Execution
389
390 #Verify 2001:0022:0033::0111 configured as 2001:22:33::111.
391 Configure IPv6 Address On BMC
392 ... ${ipv6_leading_zero} ${test_prefix_length} ${ipv6_eliminate_zero}
393
394
abhijith-121d8322b72025-10-13 02:23:48 -0500395Verify Coexistence Of IPv6 Addresses Type Combination On BMC
396 [Documentation] Verify coexistence of IPv6 addresses type combination on BMC.
397 [Tags] Verify_Coexistence_Of_IPv6_Addresses_Type_Combination_On_BMC
398 [Setup] Run Keywords
399 ... Get The Initial DHCPv6 Setting On Each Interface ${1}
400 ... AND Get The Initial SLAAC Setting On Each Interface ${1}
401 [Teardown] Run Keywords
402 ... Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1}
403 ... AND Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1}
404 [Template] Verify IPv6 Addresses Coexist
405
406 # type1 type2.
407 Static DHCPv6
408 DHCPv6 SLAAC
409 SLAAC Static
410 Static Static
411
412
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600413*** Keywords ***
414
Prashanth Katti3270fd02021-06-11 08:02:22 -0500415Suite Setup Execution
416 [Documentation] Do suite setup execution.
417
Anvesh-Kumar_Rayankula019d9362025-09-03 22:55:12 -0500418 Redfish.Login
Prashanth Katti3270fd02021-06-11 08:02:22 -0500419 ${active_channel_config}= Get Active Channel Config
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -0500420 Set Suite Variable ${active_channel_config}
421
Prashanth Katti3270fd02021-06-11 08:02:22 -0500422 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
423
424 Set Suite variable ${ethernet_interface}
425
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500426 # Get initial IPv4 and IPv6 addresses and address origins for eth0.
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500427 ${initial_ipv4_addressorigin_list} ${initial_ipv4_addr_list}= Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses
428 ${initial_ipv6_addressorigin_list} ${initial_ipv6_addr_list}= Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses
429
430 Set Suite Variable ${initial_ipv4_addressorigin_list}
431 Set Suite Variable ${initial_ipv4_addr_list}
432 Set Suite Variable ${initial_ipv6_addressorigin_list}
433 Set Suite Variable ${initial_ipv6_addr_list}
434
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500435 # Get initial IPv4 and IPv6 addresses and address origins for eth1.
436 ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}=
437 ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${2}
438 ${eth1_initial_ipv6_addressorigin_list} ${eth1_initial_ipv6_addr_list}=
439 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${2}
440 Set Suite Variable ${eth1_initial_ipv4_addressorigin_list}
441 Set Suite Variable ${eth1_initial_ipv4_addr_list}
442 Set Suite Variable ${eth1_initial_ipv6_addressorigin_list}
443 Set Suite Variable ${eth1_initial_ipv6_addr_list}
444
Prashanth Katti3270fd02021-06-11 08:02:22 -0500445
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600446Test Setup Execution
447 [Documentation] Test setup execution.
448
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600449 @{ipv6_network_configurations}= Get IPv6 Network Configuration
450 Set Test Variable @{ipv6_network_configurations}
451
452 # Get BMC IPv6 address and prefix length.
453 ${ipv6_data}= Get BMC IPv6 Info
454 Set Test Variable ${ipv6_data}
455
456
457Test Teardown Execution
458 [Documentation] Test teardown execution.
459
460 FFDC On Test Case Fail
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600461
462
463Get IPv6 Network Configuration
464 [Documentation] Get Ipv6 network configuration.
465 # Sample output:
466 # {
ganesanb4d430282023-04-27 14:33:23 +0000467 # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0",
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600468 # "@odata.type": "#EthernetInterface.v1_4_1.EthernetInterface",
469 # "DHCPv4": {
470 # "DHCPEnabled": false,
471 # "UseDNSServers": false,
472 # "UseDomainName": true,
473 # "UseNTPServers": false
474 # },
475 # "DHCPv6": {
476 # "OperatingMode": "Disabled",
477 # "UseDNSServers": false,
478 # "UseDomainName": true,
479 # "UseNTPServers": false
480 # },
481 # "Description": "Management Network Interface",
482 # "FQDN": "localhost",
483 # "HostName": "localhost",
484 # "IPv4Addresses": [
485 # {
486 # "Address": "xx.xx.xx.xx",
487 # "AddressOrigin": "Static",
488 # "Gateway": "xx.xx.xx.1",
489 # "SubnetMask": "xx.xx.xx.0"
490 # },
491 # {
492 # "Address": "169.254.xx.xx",
493 # "AddressOrigin": "IPv4LinkLocal",
494 # "Gateway": "0.0.0.0",
495 # "SubnetMask": "xx.xx.0.0"
496 # },
497 # ],
498 # "IPv4StaticAddresses": [
499 # {
500 # "Address": "xx.xx.xx.xx",
501 # "AddressOrigin": "Static",
502 # "Gateway": "xx.xx.xx.1",
503 # "SubnetMask": "xx.xx.0.0"
504 # }
505 # }
506 # ],
507 # "IPv6AddressPolicyTable": [],
508 # "IPv6Addresses": [
509 # {
510 # "Address": "fe80::xxxx:xxxx:xxxx:xxxx",
511 # "AddressOrigin": "LinkLocal",
512 # "AddressState": null,
513 # "PrefixLength": xx
514 # }
515 # ],
516 # "IPv6DefaultGateway": "",
517 # "IPv6StaticAddresses": [
518 # { "Address": "xxxx:xxxx:xxxx:xxxx::xxxx",
519 # "AddressOrigin": "Static",
520 # "AddressState": null,
521 # "PrefixLength": xxx
522 # }
523 # ],
524 # "Id": "eth0",
525 # "InterfaceEnabled": true,
526 # "LinkStatus": "LinkUp",
527 # "MACAddress": "xx:xx:xx:xx:xx:xx",
528 # "Name": "Manager Ethernet Interface",
529 # "NameServers": [],
530 # "SpeedMbps": 0,
531 # "StaticNameServers": [],
532 # "Status": {
533 # "Health": "OK",
534 # "HealthRollup": "OK",
535 # "State": "Enabled"
536 # },
537 # "VLANs": {
ganesanb4d430282023-04-27 14:33:23 +0000538 # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0/VLANs"
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600539
540
541 ${active_channel_config}= Get Active Channel Config
542 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${CHANNEL_NUMBER}']['name']}
543
544 @{ipv6_network_configurations}= Get From Dictionary ${resp.dict} IPv6StaticAddresses
George Keishing409df052024-01-17 22:36:14 +0530545 RETURN @{ipv6_network_configurations}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500546
547
548Verify IPv6 And PrefixLength
549 [Documentation] Verify IPv6 address and prefix length on BMC.
550 [Arguments] ${ipv6_addr} ${prefix_len}
551
552 # Description of the argument(s):
553 # ipv6_addr IPv6 address to be verified.
554 # prefix_len PrefixLength value to be verified.
555
556 # Catenate IPv6 address and its prefix length.
557 ${ipv6_with_prefix}= Catenate ${ipv6_addr}/${prefix_len}
558
559 # Get IPv6 address details on BMC using IP command.
560 @{ip_data}= Get BMC IPv6 Info
561
562 # Verify if IPv6 and prefix length is configured on BMC.
563
564 Should Contain ${ip_data} ${ipv6_with_prefix}
565 ... msg=IPv6 and prefix length pair does not exist.
566
567
568Configure IPv6 Address On BMC
569 [Documentation] Add IPv6 Address on BMC.
abhijith-121b9fc2742025-10-14 09:46:43 -0500570 [Arguments] ${ipv6_addr1} ${prefix_len} ${ipv6_addr2}=${None}
571 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_NO_CONTENT}]
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500572
573 # Description of argument(s):
abhijith-121b9fc2742025-10-14 09:46:43 -0500574 # ipv6_addr1 IPv6 address to be added (e.g. "2001:0022:0033::0111").
575 # ipv6_addr2 IPv6 address to be Verified (e.g. "2001:22:33::111").
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500576 # prefix_len Prefix length for the IPv6 to be added
577 # (e.g. "64").
578 # valid_status_codes Expected return code from patch operation
579 # (e.g. "200").
580
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500581 ${prefix_length}= Convert To Integer ${prefix_len}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500582 ${empty_dict}= Create Dictionary
abhijith-121b9fc2742025-10-14 09:46:43 -0500583 ${ipv6_data}= Create Dictionary Address=${ipv6_addr1}
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500584 ... PrefixLength=${prefix_length}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500585
586 ${patch_list}= Create List
587
588 # Get existing static IPv6 configurations on BMC.
589 ${ipv6_network_configurations}= Get IPv6 Network Configuration
590 ${num_entries}= Get Length ${ipv6_network_configurations}
591
592 FOR ${INDEX} IN RANGE 0 ${num_entries}
593 Append To List ${patch_list} ${empty_dict}
594 END
595
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500596 # We need not check for existence of IPv6 on BMC while adding.
597 Append To List ${patch_list} ${ipv6_data}
598 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
599
600 ${active_channel_config}= Get Active Channel Config
601 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
602
603 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
abhijith-121b9fc2742025-10-14 09:46:43 -0500604 ... valid_status_codes=${valid_status_codes}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500605
abhijith-121b9fc2742025-10-14 09:46:43 -0500606 IF ${valid_status_codes} != [${HTTP_OK}, ${HTTP_NO_CONTENT}]
607 Fail msg=Static address not added correctly
608 END
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500609
610 # Note: Network restart takes around 15-18s after patch request processing.
611 Sleep ${NETWORK_TIMEOUT}s
612 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
613
abhijith-121b9fc2742025-10-14 09:46:43 -0500614 #Verify ip address on CLI.
615 IF '${ipv6_addr2}' != '${None}'
616 Verify IPv6 And PrefixLength ${ipv6_addr2} ${prefix_len}
617 ELSE
618 Verify IPv6 And PrefixLength ${ipv6_addr1} ${prefix_len}
619 END
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500620
621 # Verify if existing static IPv6 addresses still exist.
622 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
623 Verify IPv6 On BMC ${ipv6_network_configuration['Address']}
624 END
625
abhijith-121b9fc2742025-10-14 09:46:43 -0500626 #Verify redfish and CLI data matches.
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500627 Validate IPv6 Network Config On BMC
628
629
abhijith-121bfbd03a2025-09-15 01:40:35 -0500630Configure Multiple IPv6 Address on BMC
631 [Documentation] Add multiple IPv6 address on BMC.
632 [Arguments] ${prefix_len}
633 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_NO_CONTENT}]
634
635 # Description of argument(s):
636 # prefix_len Prefix length for the IPv6 to be added
637 # (e.g. "64").
638 # valid_status_codes Expected return code from patch operation
639 # (e.g. "200").
640
641 ${ipv6_list}= Create List ${test_ipv6_addr} ${test_ipv6_addr1}
642 ${prefix_length}= Convert To Integer ${prefix_len}
643 ${empty_dict}= Create Dictionary
644 ${patch_list}= Create List
645
646 # Get existing static IPv6 configurations on BMC.
647 ${ipv6_network_configurations}= Get IPv6 Network Configuration
648 ${num_entries}= Get Length ${ipv6_network_configurations}
649
650 FOR ${INDEX} IN RANGE 0 ${num_entries}
651 Append To List ${patch_list} ${empty_dict}
652 END
653
654 # We need not check for existence of IPv6 on BMC while adding.
655 FOR ${ipv6_addr} IN @{ipv6_list}
656 ${ipv6_data}= Create Dictionary Address=${ipv6_addr} PrefixLength=${prefix_length}
657 Append To List ${patch_list} ${ipv6_data}
658 END
659 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
660
661 ${active_channel_config}= Get Active Channel Config
662 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
663
664 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
665 ... valid_status_codes=${valid_status_codes}
666
667 IF ${valid_status_codes} != [${HTTP_OK}, ${HTTP_NO_CONTENT}]
668 Fail msg=Static address not added correctly
669 END
670
671 # Note: Network restart takes around 15-18s after patch request processing.
672 Sleep ${NETWORK_TIMEOUT}s
673 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
674
675 # Verify newly added ip address on CLI.
676 FOR ${ipv6_addr} IN @{ipv6_list}
677 Verify IPv6 And PrefixLength ${ipv6_addr} ${prefix_len}
678 END
679
680 # Verify if existing static IPv6 addresses still exist.
681 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
682 Verify IPv6 On BMC ${ipv6_network_configuration['Address']}
683 END
684
685 # Get the latest ipv6 network configurations.
686 @{ipv6_network_configurations}= Get IPv6 Network Configuration
687
688 # Verify newly added ip address on BMC.
689 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
690 Should Contain Match ${ipv6_list} ${ipv6_network_configuration['Address']}
691 END
692
693 Validate IPv6 Network Config On BMC
694
695
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500696Validate IPv6 Network Config On BMC
697 [Documentation] Check that IPv6 network info obtained via redfish matches info
698 ... obtained via CLI.
Sridevi Rameshed94c692025-09-07 23:41:10 -0500699
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500700 @{ipv6_network_configurations}= Get IPv6 Network Configuration
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500701 ${ipv6_data}= Get BMC IPv6 Info
702 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
703 Should Contain Match ${ipv6_data} ${ipv6_network_configuration['Address']}/*
704 ... msg=IPv6 address does not exist.
705 END
706
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500707
708Delete IPv6 Address
709 [Documentation] Delete IPv6 address of BMC.
Prashanth Kattibcb9dab2025-04-01 12:58:37 -0500710 [Arguments] ${ipv6_addr}
711 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500712
713 # Description of argument(s):
714 # ipv6_addr IPv6 address to be deleted (e.g. "2001:1234:1234:1234::1234").
715 # valid_status_codes Expected return code from patch operation
716 # (e.g. "200"). See prolog of rest_request
717 # method in redfish_plus.py for details.
718
719 ${empty_dict}= Create Dictionary
720 ${patch_list}= Create List
721
722 @{ipv6_network_configurations}= Get IPv6 Network Configuration
723 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
724 IF '${ipv6_network_configuration['Address']}' == '${ipv6_addr}'
725 Append To List ${patch_list} ${null}
726 ELSE
727 Append To List ${patch_list} ${empty_dict}
728 END
729 END
730
731 ${ip_found}= Run Keyword And Return Status List Should Contain Value
732 ... ${patch_list} ${null} msg=${ipv6_addr} does not exist on BMC
733 Pass Execution If ${ip_found} == ${False} ${ipv6_addr} does not exist on BMC
734
735 # Run patch command only if given IP is found on BMC
736 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
737
738 ${active_channel_config}= Get Active Channel Config
739 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
740
741 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
Sweta Potthuria1981612025-05-09 05:41:10 -0500742 ... valid_status_codes=${valid_status_codes}
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500743
744 # Note: Network restart takes around 15-18s after patch request processing
745 Sleep ${NETWORK_TIMEOUT}s
746 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
747
748 # IPv6 address that is deleted should not be there on BMC.
749 ${delete_status}= Run Keyword And Return Status Verify IPv6 On BMC ${ipv6_addr}
Anvesh-Kumar_Rayankula3a26c662025-04-16 01:19:26 -0500750 IF '${valid_status_codes}' == '[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]'
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500751 Should Be True '${delete_status}' == '${False}'
752 ELSE
753 Should Be True '${delete_status}' == '${True}'
754 END
755
756 Validate IPv6 Network Config On BMC
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500757
758
759Modify IPv6 Address
760 [Documentation] Modify and verify IPv6 address of BMC.
761 [Arguments] ${ipv6} ${new_ipv6} ${prefix_len}
762 ... ${valid_status_codes}=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
763
764 # Description of argument(s):
765 # ipv6 IPv6 address to be replaced (e.g. "2001:AABB:CCDD::AAFF").
766 # new_ipv6 New IPv6 address to be configured.
767 # prefix_len Prefix length value (Range 1 to 128).
768 # valid_status_codes Expected return code from patch operation
769 # (e.g. "200", "201").
770
771 ${empty_dict}= Create Dictionary
772 ${patch_list}= Create List
773 ${prefix_length}= Convert To Integer ${prefix_len}
774 ${ipv6_data}= Create Dictionary
775 ... Address=${new_ipv6} PrefixLength=${prefix_length}
776
777 # Sample IPv6 network configurations:
778 # "IPv6AddressPolicyTable": [],
779 # "IPv6Addresses": [
780 # {
781 # "Address": "X002:db8:0:2::XX0",
782 # "AddressOrigin": "DHCPv6",
783 # "PrefixLength": 128
784 # },
785 # {
786 # "Address": “X002:db8:0:2:a94:XXff:fe82:XXXX",
787 # "AddressOrigin": "SLAAC",
788 # "PrefixLength": 64
789 # },
790 # {
791 # "Address": “Y002:db8:0:2:a94:efff:fe82:5000",
792 # "AddressOrigin": "Static",
793 # "PrefixLength": 56
794 # },
795 # {
796 # "Address": “Z002:db8:0:2:a94:efff:fe82:5000",
797 # "AddressOrigin": "Static",
798 # "PrefixLength": 56
799 # },
800 # {
801 # "Address": “Xe80::a94:efff:YYYY:XXXX",
802 # "AddressOrigin": "LinkLocal",
803 # "PrefixLength": 64
804 # },
805 # {
806 # "Address": “X002:db8:1:2:eff:233:fee:546",
807 # "AddressOrigin": "Static",
808 # "PrefixLength": 56
809 # }
810 # ],
811 # "IPv6DefaultGateway": “XXXX::ab2e:80fe:87df:XXXX”,
812 # "IPv6StaticAddresses": [
813 # {
814 # "Address": “X002:db8:0:2:a94:efff:fe82:5000",
815 # "PrefixLength": 56
816 # },
817 # {
818 # "Address": “Y002:db8:0:2:a94:efff:fe82:5000",
819 # "PrefixLength": 56
820 # },
821 # {
822 # "Address": “Z002:db8:1:2:eff:233:fee:546",
823 # "PrefixLength": 56
824 # }
825 # ],
826 # "IPv6StaticDefaultGateways": [],
827
828 # Find the position of IPv6 address to be modified.
829 @{ipv6_network_configurations}= Get IPv6 Network Configuration
830 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
George Keishinge6e161e2025-05-08 10:18:30 +0530831 IF '${ipv6_network_configuration['Address']}' == '${ipv6}'
832 Append To List ${patch_list} ${ipv6_data}
833 ELSE
834 Append To List ${patch_list} ${empty_dict}
835 END
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500836 END
837
838 # Modify the IPv6 address only if given IPv6 is found
839 ${ip_found}= Run Keyword And Return Status List Should Contain Value
840 ... ${patch_list} ${ipv6_data} msg=${ipv6} does not exist on BMC
841 Pass Execution If ${ip_found} == ${False} ${ipv6} does not exist on BMC
842
843 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
844
845 ${active_channel_config}= Get Active Channel Config
846 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
847
848 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
849 ... body=&{data} valid_status_codes=${valid_status_codes}
850
851 # Note: Network restart takes around 15-18s after patch request processing.
852 Sleep ${NETWORK_TIMEOUT}s
853 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
854
855 # Verify if new IPv6 address is configured on BMC.
856 Verify IPv6 On BMC ${new_ipv6}
857
858 # Verify if old IPv6 address is erased.
859 ${cmd_status}= Run Keyword And Return Status
860 ... Verify IPv6 On BMC ${ipv6}
861 Should Be Equal ${cmd_status} ${False} msg=Old IPv6 address is not deleted.
862
863 Validate IPv6 Network Config On BMC
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500864
865
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500866Set SLAAC Configuration State And Verify
867 [Documentation] Set SLAAC configuration state and verify.
Sridevi Rameshed94c692025-09-07 23:41:10 -0500868 [Arguments] ${slaac_state} ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]
869 ... ${channel_number}=${CHANNEL_NUMBER}
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500870
871 # Description of argument(s):
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500872 # slaac_state SLAAC state('True' or 'False').
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500873 # valid_status_code Expected valid status codes.
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500874 # channel_number Channel number 1(eth0) or 2(eth1).
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500875
876 ${active_channel_config}= Get Active Channel Config
877 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
878
879 ${data}= Set Variable If ${slaac_state} == ${False} ${DISABLE_SLAAC} ${ENABLE_SLAAC}
880 ${resp}= Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
Sweta Potthuri610f86f2025-05-30 00:47:23 -0500881 ... body=${data} valid_status_codes=${valid_status_codes}
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500882
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500883 # Verify SLAAC is set correctly.
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500884 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
885 ${slaac_verify}= Get From Dictionary ${resp.dict} StatelessAddressAutoConfig
886
George Keishinge6e161e2025-05-08 10:18:30 +0530887 IF '${slaac_verify['IPv6AutoConfigEnabled']}' != '${slaac_state}'
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500888 Fail msg=SLAAC not set properly.
George Keishinge6e161e2025-05-08 10:18:30 +0530889 END
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500890
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500891Set And Verify DHCPv6 Property
892 [Documentation] Set DHCPv6 property and verify.
893 [Arguments] ${dhcpv6_operating_mode}=${Disabled} ${channel_number}=${CHANNEL_NUMBER}
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500894
895 # Description of argument(s):
896 # dhcpv6_operating_mode Enabled if user wants to enable DHCPv6('Enabled' or 'Disabled').
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500897 # channel_number Channel number 1 or 2.
898
899 Set DHCPv6 Property ${dhcpv6_operating_mode} ${channel_number}
900 Verify DHCPv6 Property ${dhcpv6_operating_mode} ${channel_number}
901
902
903Set DHCPv6 Property
904 [Documentation] Set DHCPv6 attribute is enables or disabled.
905 [Arguments] ${dhcpv6_operating_mode}=${Disabled} ${channel_number}=${CHANNEL_NUMBER}
906
907 # Description of argument(s):
908 # dhcpv6_operating_mode Enabled if user wants to enable DHCPv6('Enabled' or 'Disabled').
909 # channel_number Channel number 1 or 2.
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500910
911 ${data}= Set Variable If '${dhcpv6_operating_mode}' == 'Disabled' ${DISABLE_DHCPv6} ${ENABLE_DHCPv6}
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500912 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
913
914 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
915 ... body=${data} valid_status_codes=[${HTTP_OK},${HTTP_NO_CONTENT}]
916
kvishalbd04bd62025-08-05 03:57:53 -0500917
918Verify DHCPv6 Property
919 [Documentation] Verify DHCPv6 settings is enabled or disabled.
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500920 [Arguments] ${dhcpv6_operating_mode} ${channel_number}=${CHANNEL_NUMBER}
kvishalbd04bd62025-08-05 03:57:53 -0500921
922 # Description of Argument(s):
923 # dhcpv6_operating_mode Enable/ Disable DHCPv6.
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500924 # channel_number Channel number 1 or 2.
925
Sweta Potthuri425713a2025-10-16 00:28:20 -0500926 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
kvishalbd04bd62025-08-05 03:57:53 -0500927
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500928 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
929 ${dhcpv6_verify}= Get From Dictionary ${resp.dict} DHCPv6
930
931 Should Be Equal '${dhcpv6_verify['OperatingMode']}' '${dhcpv6_operating_mode}'
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500932
Sweta Potthuri425713a2025-10-16 00:28:20 -0500933 Sleep 30s
934
935 @{ipv6_addressorigin_list} ${ipv6_dhcpv6_addr}=
936 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${channel_number}
937
938 IF "${dhcpv6_operating_mode}" == "Enabled"
939 @{ipv6_addressorigin_list} ${ipv6_dhcpv6_addr}=
940 ... Get Address Origin List And Address For Type DHCPv6 ${channel_number}
941 Should Not Be Empty ${ipv6_dhcpv6_addr} msg=DHCPv6 must be present.
942 ELSE
943 Should Not Contain ${ipv6_addressorigin_list} DHCPv6
944 END
945
946
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500947
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500948Get IPv6 Static Default Gateway
949 [Documentation] Get IPv6 static default gateway.
950
951 ${active_channel_config}= Get Active Channel Config
952 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${CHANNEL_NUMBER}']['name']}
953
954 @{ipv6_static_defgw_configurations}= Get From Dictionary ${resp.dict} IPv6StaticDefaultGateways
955 RETURN @{ipv6_static_defgw_configurations}
956
Sweta Potthuri2d085732025-07-16 09:10:08 -0500957
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500958Configure IPv6 Static Default Gateway On BMC
959 [Documentation] Configure IPv6 static default gateway on BMC.
960 [Arguments] ${ipv6_gw_addr} ${prefix_length_def}
961 ... ${valid_status_codes}=${HTTP_OK}
Sridevi Rameshed94c692025-09-07 23:41:10 -0500962
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500963 # Description of argument(s):
964 # ipv6_gw_addr IPv6 Static Default Gateway address to be configured.
965 # prefix_len_def Prefix length value (Range 1 to 128).
966 # valid_status_codes Expected return code from patch operation
967 # (e.g. "200", "204".)
968
969 # Prefix Length is passed as None.
970 IF '${prefix_length_def}' == '${None}'
971 ${ipv6_gw}= Create Dictionary Address=${ipv6_gw_addr}
972 ELSE
973 ${ipv6_gw}= Create Dictionary Address=${ipv6_gw_addr} Prefix Length=${prefix_length_def}
974 END
975
976 ${ipv6_static_def_gw}= Get IPv6 Static Default Gateway
977
978 ${num_entries}= Get Length ${ipv6_static_def_gw}
979
980 ${patch_list}= Create List
981 ${empty_dict}= Create Dictionary
982
983 FOR ${INDEX} IN RANGE 0 ${num_entries}
984 Append To List ${patch_list} ${empty_dict}
985 END
986
987 ${valid_status_codes}= Set Variable If '${valid_status_codes}' == '${HTTP_OK}'
988 ... ${HTTP_OK},${HTTP_NO_CONTENT}
989 ... ${valid_status_codes}
990
991 Append To List ${patch_list} ${ipv6_gw}
992 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
993
994 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
995 ... body=${data} valid_status_codes=[${valid_status_codes}]
996
997 # Verify the added static default gateway is present in Redfish Get Output.
998 ${ipv6_staticdef_gateway}= Get IPv6 Static Default Gateway
999
1000 ${ipv6_static_def_gw_list}= Create List
1001 FOR ${ipv6_staticdef_gateway} IN @{ipv6_staticdef_gateway}
1002 ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address
1003 Append To List ${ipv6_static_def_gw_list} ${value}
1004 END
1005
1006 IF '${valid_status_codes}' != '${HTTP_OK},${HTTP_NO_CONTENT}'
1007 Should Not Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr}
1008 ELSE
1009 Should Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr}
1010 END
1011
Sweta Potthuri2d085732025-07-16 09:10:08 -05001012
Anvesh-Kumar_Rayankula019d9362025-09-03 22:55:12 -05001013Modify IPv6 Static Default Gateway On BMC
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001014 [Documentation] Modify and verify IPv6 address of BMC.
1015 [Arguments] ${ipv6_gw_addr} ${new_static_def_gw} ${prefix_length}
1016 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED}]
Sweta Potthuri2edacd32025-07-02 01:04:43 -05001017
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001018 # Description of argument(s):
1019 # ipv6_gw_addr IPv6 static default gateway address to be replaced (e.g. "2001:AABB:CCDD::AAFF").
1020 # new_static_def_gw New static default gateway address to be configured.
Sridevi Rameshed94c692025-09-07 23:41:10 -05001021 # prefix_length Prefix length value (Range 1 to 128).
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001022 # valid_status_codes Expected return code from patch operation
1023 # (e.g. "200", "204").
Sweta Potthuri2edacd32025-07-02 01:04:43 -05001024
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001025 ${empty_dict}= Create Dictionary
1026 ${patch_list}= Create List
1027 # Prefix Length is passed as None.
1028 IF '${prefix_length_def}' == '${None}'
1029 ${modified_ipv6_gw_addripv6_data}= Create Dictionary Address=${new_static_def_gw}
1030 ELSE
1031 ${modified_ipv6_gw_addripv6_data}= Create Dictionary Address=${new_static_def_gw} Prefix Length=${prefix_length_def}
1032 END
Sweta Potthuri2edacd32025-07-02 01:04:43 -05001033
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001034 @{ipv6_static_def_gw_list}= Get IPv6 Static Default Gateway
1035
1036 FOR ${ipv6_static_def_gw} IN @{ipv6_static_def_gw_list}
1037 IF '${ipv6_static_def_gw['Address']}' == '${ipv6_gw_addr}'
1038 Append To List ${patch_list} ${modified_ipv6_gw_addripv6_data}
1039 ELSE
1040 Append To List ${patch_list} ${empty_dict}
1041 END
1042 END
1043
1044 # Modify the IPv6 address only if given IPv6 static default gateway is found.
1045 ${ip_static_def_gw_found}= Run Keyword And Return Status List Should Contain Value
1046 ... ${patch_list} ${modified_ipv6_gw_addripv6_data} msg=${ipv6_gw_addr} does not exist on BMC
1047 Pass Execution If ${ip_static_def_gw_found} == ${False} ${ipv6_gw_addr} does not exist on BMC
1048
1049 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
1050
1051 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1052 ... body=&{data} valid_status_codes=${valid_status_codes}
1053
1054 ${ipv6_staticdef_gateway}= Get IPv6 Static Default Gateway
1055
1056 ${ipv6_static_def_gw_list}= Create List
1057 FOR ${ipv6_staticdef_gateway} IN @{ipv6_staticdef_gateway}
Sweta Potthuri2d085732025-07-16 09:10:08 -05001058 ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001059 Append To List ${ipv6_static_def_gw_list} ${value}
1060 END
1061
1062 Should Contain ${ipv6_static_def_gw_list} ${new_static_def_gw}
1063 # Verify if old static default gateway address is erased.
1064 Should Not Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr}
1065
Sweta Potthuri2d085732025-07-16 09:10:08 -05001066
1067Delete IPv6 Static Default Gateway
1068 [Documentation] Delete IPv6 static default gateway on BMC.
1069 [Arguments] ${ipv6_gw_addr}
1070 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]
1071
1072 # Description of argument(s):
1073 # ipv6_gw_addr IPv6 Static Default Gateway address to be deleted.
1074 # valid_status_codes Expected return code from patch operation
1075 # (e.g. "200").
1076
1077 ${patch_list}= Create List
1078 ${empty_dict}= Create Dictionary
1079
1080 ${ipv6_static_def_gw_list}= Create List
1081 @{ipv6_static_defgw_configurations}= Get IPv6 Static Default Gateway
1082
1083 FOR ${ipv6_staticdef_gateway} IN @{ipv6_static_defgw_configurations}
1084 ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address
1085 Append To List ${ipv6_static_def_gw_list} ${value}
1086 END
1087
1088 ${defgw_found}= Run Keyword And Return Status List Should Contain Value
1089 ... ${ipv6_static_def_gw_list} ${ipv6_gw_addr} msg=${ipv6_gw_addr} does not exist on BMC
1090 Skip If ${defgw_found} == ${False} ${ipv6_gw_addr} does not exist on BMC
1091
1092 FOR ${ipv6_static_def_gw} IN @{ipv6_static_defgw_configurations}
1093 IF '${ipv6_static_def_gw['Address']}' == '${ipv6_gw_addr}'
1094 Append To List ${patch_list} ${null}
1095 ELSE
1096 Append To List ${patch_list} ${empty_dict}
1097 END
1098 END
1099
1100 # Run patch command only if given IP is found on BMC.
1101 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
1102
1103 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
1104 ... valid_status_codes=${valid_status_codes}
1105
1106 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
1107
1108 @{ipv6_static_defgw_configurations}= Get IPv6 Static Default Gateway
1109 Should Not Contain Match ${ipv6_static_defgw_configurations} ${ipv6_gw_addr}
1110 ... msg=IPv6 Static default gateway does not exist.
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001111
1112
1113Check Coexistence Of Linklocalv6 And Static IPv6
1114 [Documentation] Verify both linklocalv6 and static IPv6 exist.
1115
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001116 # Verify the address origin contains static and linklocal.
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001117 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001118
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001119 Should Match Regexp ${ipv6_linklocal_addr} ${linklocal_addr_format}
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001120 Should Contain ${ipv6_addressorigin_list} Static
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -05001121
1122
abhijith-12197078c52025-09-25 01:13:00 -05001123Check Coexistence Of Static IPv6 And SLAAC
abhijith-1214dc01a02025-09-24 11:29:55 -05001124 [Documentation] Verify both static IPv6 and SLAAC coexist.
abhijith-12197078c52025-09-25 01:13:00 -05001125
1126 # Verify the address origin contains static and slaac.
1127 @{ipv6_addressorigin_list} ${ipv6_static_addr}=
1128 ... Get Address Origin List And Address For Type Static
1129
1130 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1131 ... Get Address Origin List And Address For Type SLAAC
1132
1133
abhijith-1214dc01a02025-09-24 11:29:55 -05001134Check Coexistence Of Link Local And SLAAC
1135 [Documentation] Verify both link local and SLAAC coexist.
1136
1137 # Verify the address origin contains SLAAC and link local.
1138 @{ipv6_addressorigin_list} ${ipv6_link_local_addr}=
1139 ... Get Address Origin List And Address For Type LinkLocal
1140
1141 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1142 ... Get Address Origin List And Address For Type SLAAC
1143
1144 Should Match Regexp ${ipv6_link_local_addr} ${linklocal_addr_format}
1145
1146
abhijith-1218ff5db42025-09-24 06:24:03 -05001147Check Coexistence Of Link Local And DHCPv6
1148 [Documentation] Verify both link local and dhcpv6 coexist.
1149
1150 # Verify the address origin contains dhcpv6 and link local.
1151 @{ipv6_address_origin_list} ${ipv6_link_local_addr}=
1152 ... Get Address Origin List And Address For Type LinkLocal
1153
1154 @{ipv6_address_origin_list} ${ipv6_dhcpv6_addr}=
1155 ... Get Address Origin List And Address For Type DHCPv6
1156
1157 Should Match Regexp ${ipv6_link_local_addr} ${linklocal_addr_format}
1158
1159
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -05001160Check If Linklocal Address Is In Correct Format
1161 [Documentation] Linklocal address has network part fe80 and host part EUI64.
1162
1163 # Fetch the linklocal address.
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001164 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -05001165
1166 # Follow EUI64 from MAC.
1167 ${system_mac}= Get BMC MAC Address
1168 ${split_octets}= Split String ${system_mac} :
1169 ${first_octet}= Evaluate int('${split_octets[0]}', 16)
1170 ${flipped_hex}= Evaluate format(${first_octet} ^ 2, '02x')
1171 ${grp1}= Evaluate re.sub(r'^0+', '', '${flipped_hex}${split_octets[1]}') modules=re
1172 ${grp2}= Evaluate re.sub(r'^0+', '', '${split_octets[2]}ff') modules=re
1173 ${grp3}= Evaluate re.sub(r'^0+', '', '${split_octets[4]}${split_octets[5]}') modules=re
1174 ${linklocal}= Set Variable fe80::${grp1}:${grp2}:fe${split_octets[3]}:${grp3}
1175
1176 # Verify the linklocal obtained is the same as on the machine.
1177 Should Be Equal ${linklocal} ${ipv6_linklocal_addr}
1178
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001179
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001180Check BMC Gets SLAAC Address
1181 [Documentation] Check BMC gets slaac address.
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001182
1183 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= Get Address Origin List And Address For Type SLAAC
1184
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001185
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001186Get The Initial DHCPv6 Setting On Each Interface
1187 [Documentation] Get the initial DHCPv6 setting of each interface.
1188 [Arguments] ${channel_number}
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001189
1190 # Description of the argument(s):
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001191 # channel_number Channel number 1 or 2.
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001192
1193 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
1194 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1195 ${initial_dhcpv6_iface}= Get From Dictionary ${resp.dict} DHCPv6
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001196 IF ${channel_number}==${1}
1197 Set Test Variable ${dhcpv6_channel_1} ${initial_dhcpv6_iface['OperatingMode']}
1198 ELSE
1199 Set Test Variable ${dhcpv6_channel_2} ${initial_dhcpv6_iface['OperatingMode']}
1200 END
1201
1202
1203Get The Initial DHCPv6 Settings
1204 [Documentation] Get the initial DHCPv6 settings of both the interfaces.
1205
1206 Get The Initial DHCPv6 Setting On Each Interface ${1}
1207 Get The Initial DHCPv6 Setting On Each Interface ${2}
1208
1209
1210Get The Initial SLAAC Settings
1211 [Documentation] Get the initial SLAAC settings of both the interfaces.
1212
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001213 Get The Initial SLAAC Setting On Each Interface ${1}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001214 Get The Initial SLAAC Setting On Each Interface ${2}
1215
1216
1217Get The Initial SLAAC Setting On Each Interface
1218 [Documentation] Get the initial SLAAC setting of the interface.
1219 [Arguments] ${channel_number}
1220
1221 # Description of the argument(s):
1222 # channel_number Channel number 1 or 2.
1223
1224 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
1225 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1226 ${initial_slaac_iface}= Get From Dictionary ${resp.dict} StatelessAddressAutoConfig
1227 IF ${channel_number}==${1}
1228 Set Test Variable ${slaac_channel_1} ${initial_slaac_iface['IPv6AutoConfigEnabled']}
1229 ELSE
1230 Set Test Variable ${slaac_channel_2} ${initial_slaac_iface['IPv6AutoConfigEnabled']}
1231 END
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001232
1233
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001234Get Address Origin List And IPv4 or IPv6 Address
1235 [Documentation] Get address origin list and address for type.
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001236 [Arguments] ${ip_address_type} ${channel_number}=${CHANNEL_NUMBER}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001237
1238 # Description of the argument(s):
Sridevi Rameshed94c692025-09-07 23:41:10 -05001239 # ip_address_type Type of IPv4 or IPv6 address to be checked.
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001240 # channel_number Channel number 1(eth0) or 2(eth1).
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001241
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001242 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${channel_number}']['name']}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001243 @{ip_addresses}= Get From Dictionary ${resp.dict} ${ip_address_type}
1244
1245 ${ip_addressorigin_list}= Create List
1246 ${ip_addr_list}= Create List
1247 FOR ${ip_address} IN @{ip_addresses}
1248 ${ip_addressorigin}= Get From Dictionary ${ip_address} AddressOrigin
1249 Append To List ${ip_addressorigin_list} ${ip_addressorigin}
1250 Append To List ${ip_addr_list} ${ip_address['Address']}
1251 END
1252 RETURN ${ip_addressorigin_list} ${ip_addr_list}
1253
1254
1255Verify All The Addresses Are Intact
1256 [Documentation] Verify all the addresses and address origins remain intact.
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001257 [Arguments] ${channel_number}=${CHANNEL_NUMBER}
1258 ... ${initial_ipv4_addressorigin_list}=${initial_ipv4_addressorigin_list}
1259 ... ${initial_ipv4_addr_list}=${initial_ipv4_addr_list}
1260
1261 # Description of argument(s):
1262 # channel_number Channel number 1(eth0) or 2(eth1).
1263 # initial_ipv4_addressorigin_list Initial IPv4 address origin list.
1264 # initial_ipv4_addr_list Initial IPv4 address list.
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001265
1266 # Verify that it will not impact the IPv4 configuration.
1267 Sleep ${NETWORK_TIMEOUT}
1268 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
1269
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001270 # IPv6 Linklocal address must be present.
1271 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}=
1272 ... Get Address Origin List And Address For Type LinkLocal ${channel_number}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001273
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001274 # IPv4 addresses must remain intact.
1275 ${ipv4_addressorigin_list} ${ipv4_addr_list}=
1276 ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${channel_number}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001277
1278 Should be Equal ${initial_ipv4_addressorigin_list} ${ipv4_addressorigin_list}
1279 Should be Equal ${initial_ipv4_addr_list} ${ipv4_addr_list}
Sweta Potthurif3d188f2025-09-08 07:17:31 -05001280
1281
1282Get Interface ID Of IPv6
1283 [Documentation] Get interface id of IPv6 address.
1284 [Arguments] ${ipv6_address}
1285
1286 # Description of the argument(s):
1287 # ${ipv6_address} IPv6 Address to extract the last 4 hextets.
1288
1289 # Last 64 bits of SLAAC and Linklocal must be the same.
1290 # Sample IPv6 network configurations.
1291 #"IPv6AddressPolicyTable": [],
1292 # "IPv6Addresses": [
1293 # {
1294 # "Address": "fe80::xxxx:xxxx:xxxx:xxxx",
1295 # "AddressOrigin": "LinkLocal",
1296 # "AddressState": null,
1297 # "PrefixLength": xx
1298 # }
1299 # ],
1300 # {
1301 # "Address": "2002:xxxx:xxxx:xxxx:xxxx",
1302 # "AddressOrigin": "SLAAC",
1303 # "PrefixLength": 64
1304 # }
1305 # ],
1306
1307 ${split_ip_address}= Split String ${ipv6_address} :
1308 ${missing_ip}= Evaluate 8 - len(${split_ip_address}) + 1
1309 ${expanded_ip}= Create List
1310
1311 FOR ${hextet} IN @{split_ip_address}
1312 IF '${hextet}' == ''
1313 FOR ${i} IN RANGE ${missing_ip}
1314 Append To List ${expanded_ip} 0000
1315 END
1316 ELSE
1317 Append To List ${expanded_ip} ${hextet}
1318 END
1319 END
1320 ${interface_id}= Evaluate ':'.join(${expanded_ip}[-4:])
1321 RETURN ${interface_id}
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001322
1323
1324Set And Verify SLAAC Property On Both Interfaces
1325 [Documentation] Set and verify SLAAC property on both interfaces.
1326 [Arguments] ${slaac_value_1} ${slaac_value_2}
1327
1328 # Description of the argument(s):
1329 # slaac_value_1 SLAAC value for channel 1.
1330 # slaac_value_2 SLAAC value for channel 2.
1331
1332 Set SLAAC Configuration State And Verify ${slaac_value_1} [${HTTP_OK}] ${1}
1333 Set SLAAC Configuration State And Verify ${slaac_value_2} [${HTTP_OK}] ${2}
1334
1335 Sleep 30s
1336
1337 # Check SLAAC Settings for eth0.
1338 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1339 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${1}
1340 IF "${slaac_value_1}" == "${True}"
1341 Should Not Be Empty ${ipv6_slaac_addr} SLAAC
1342 ELSE
1343 Should Not Contain ${ipv6_addressorigin_list} SLAAC
1344 END
1345
1346 # Check SLAAC Settings for eth1.
1347 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1348 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${2}
1349 IF "${slaac_value_2}" == "${True}"
1350 Should Not Be Empty ${ipv6_slaac_addr} SLAAC
1351 ELSE
1352 Should Not Contain ${ipv6_addressorigin_list} SLAAC
1353 END
1354
1355 Verify All The Addresses Are Intact ${1}
1356 Verify All The Addresses Are Intact ${2}
1357 ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}
1358
Sweta Potthuri425713a2025-10-16 00:28:20 -05001359
1360Set And Verify DHCPv6 Property On Both Interfaces
1361 [Documentation] Set and verify DHCPv6 property on both interfaces.
1362 [Arguments] ${dhcpv6_value_1} ${dhcpv6_value_2}
1363
1364 # Description of the argument(s):
1365 # dhcpv6_value_1 DHCPv6 value for channel 1.
1366 # dhcpv6_value_2 DHCPv6 value for channel 2.
1367
1368 Set And Verify DHCPv6 Property ${dhcpv6_value_1} ${1}
1369 Set And Verify DHCPv6 Property ${dhcpv6_value_2} ${2}
1370
1371 Verify All The Addresses Are Intact ${1}
1372 Verify All The Addresses Are Intact ${2}
1373 ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}
abhijith-121d8322b72025-10-13 02:23:48 -05001374
1375
1376Verify IPv6 Addresses Coexist
1377 [Documentation] Verify IPv6 address type coexist.
1378 [Arguments] ${ipv6_address_type1} ${ipv6_address_type2}
1379
1380 # Description of the argument(s):
1381 # ipv6_address_type1 IPv6 address type.
1382 # ipv6_address_type2 IPv6 address type.
1383 # Valid IPv6 address type (Static, DHCPv6, SLAAC).
1384
1385 IF '${ipv6_address_type1}' == 'Static' and '${ipv6_address_type2}' == 'DHCPv6'
1386 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
1387 Set And Verify DHCPv6 Property Enabled
1388 ELSE IF '${ipv6_address_type1}' == 'DHCPv6' and '${ipv6_address_type2}' == 'SLAAC'
1389 Set And Verify DHCPv6 Property Enabled
1390 Set SLAAC Configuration State And Verify ${True}
1391 ELSE IF '${ipv6_address_type1}' == 'SLAAC' and '${ipv6_address_type2}' == 'Static'
1392 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
1393 Set SLAAC Configuration State And Verify ${True}
1394 ELSE IF '${ipv6_address_type1}' == 'Static' and '${ipv6_address_type2}' == 'Static'
1395 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
1396 Configure IPv6 Address On BMC ${test_ipv6_addr1} ${test_prefix_length}
1397 END
1398
1399 Sleep ${NETWORK_TIMEOUT}s
1400
1401 # Verify coexistence.
1402 Verify The Coexistence Of The Address Type ${ipv6_address_type1} ${ipv6_address_type2}
1403
1404 IF '${ipv6_address_type1}' == 'Static' or '${ipv6_address_type2}' == 'Static'
1405 Delete IPv6 Address ${test_ipv6_addr}
1406 END
1407 IF '${ipv6_address_type1}' == 'Static' and '${ipv6_address_type2}' == 'Static'
1408 Delete IPv6 Address ${test_ipv6_addr1}
1409 END
1410
1411 Set And Verify DHCPv6 Property Disabled
1412 Set SLAAC Configuration State And Verify ${False}