blob: c11ae2bab8d7fc31b10d5a65f63e4bad272d1da3 [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
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -050094Configure IPv6 Address On BMC And Verify On Both Interfaces
95 [Documentation] Configure IPv6 address on both interfaces and verify.
96 [Tags] Configure_IPv6_Address_On_BMC_And_Verify_On_Both_Interfaces
97 [Teardown] Run Keywords
98 ... Delete IPv6 Address ${test_ipv6_addr} ${1}
99 ... AND Delete IPv6 Address ${test_ipv6_addr1} ${2}
100 ... AND Test Teardown Execution
101
102 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} ${None} ${1}
103 Configure IPv6 Address On BMC ${test_ipv6_addr1} ${test_prefix_length} ${None} ${2}
104
105 Verify All The Addresses Are Intact ${1}
106 Verify All The Addresses Are Intact ${2}
107 ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}
108
109 # Verify Static IPv6 on eth0
110 @{ipv6_addressorigin_list} ${ipv6_static_addr}=
111 ... Get Address Origin List And Address For Type Static ${1}
112 Should Contain ${ipv6_addressorigin_list} Static
113 Should Not Be Empty ${ipv6_static_addr} msg=${ipv6_static_addr} address is not present
114
115 # Verify Static IPv6 on eth1
116 @{ipv6_addressorigin_list} ${ipv6_static_addr}=
117 ... Get Address Origin List And Address For Type Static ${2}
118 Should Contain ${ipv6_addressorigin_list} Static
119 Should Not Be Empty ${ipv6_static_addr} msg=${ipv6_static_addr} address is not present
120
121
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500122Delete IPv6 Address And Verify
123 [Documentation] Delete IPv6 address and verify.
124 [Tags] Delete_IPv6_Address_And_Verify
125
126 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
127
128 Delete IPv6 Address ${test_ipv6_addr}
129
130
George Keishingcc288312024-10-22 10:13:12 +0530131Modify IPv6 Address And Verify
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500132 [Documentation] Modify IPv6 address and verify.
133 [Tags] Modify_IPv6_Address_And_Verify
kvishal88de8c42025-03-04 01:45:10 -0600134 [Teardown] Run Keywords
George Keishingcfdd0992025-03-17 11:59:20 +0530135 ... Delete IPv6 Address ${test_ipv6_addr1} AND Test Teardown Execution
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500136
137 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
138
139 Modify IPv6 Address ${test_ipv6_addr} ${test_ipv6_addr1} ${test_prefix_length}
140
141
Sweta Potthuriafe858e2025-02-25 23:52:51 -0600142Verify Persistency Of IPv6 After BMC Reboot
143 [Documentation] Verify persistency of IPv6 after BMC reboot.
144 [Tags] Verify_Persistency_Of_IPv6_After_BMC_Reboot
145 [Teardown] Run Keywords
146 ... Delete IPv6 Address ${test_ipv6_addr} AND Test Teardown Execution
147
148 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
149
150 Redfish OBMC Reboot (off) stack_mode=skip
151
152 # Verifying persistency of IPv6.
153 Verify IPv6 On BMC ${test_ipv6_addr}
154
155
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500156Enable SLAAC On BMC And Verify
157 [Documentation] Enable SLAAC on BMC and verify.
158 [Tags] Enable_SLAAC_On_BMC_And_Verify
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500159
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500160 Set SLAAC Configuration State And Verify ${True}
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500161
162
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500163Enable DHCPv6 Property On BMC And Verify
164 [Documentation] Enable DHCPv6 property on BMC and verify.
165 [Tags] Enable_DHCPv6_Property_On_BMC_And_Verify
166
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500167 Set And Verify DHCPv6 Property Enabled
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500168
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500169
kvishal0d199a92025-05-29 02:35:18 -0500170Disable DHCPv6 Property On BMC And Verify
171 [Documentation] Disable DHCPv6 property on BMC and verify.
172 [Tags] Disable_DHCPv6_Property_On_BMC_And_Verify
173
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500174 Set And Verify DHCPv6 Property Disabled
kvishalbd04bd62025-08-05 03:57:53 -0500175
176
177Verify Persistency Of DHCPv6 On Reboot
178 [Documentation] Verify persistency of DHCPv6 property on reboot.
179 [Tags] Verify_Persistency_Of_DHCPv6_On_Reboot
180
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500181 Set And Verify DHCPv6 Property Enabled
182 Redfish OBMC Reboot (off) stack_mode=skip
183 Verify DHCPv6 Property Enabled
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500184
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500185
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500186Configure Invalid Static IPv6 And Verify
187 [Documentation] Configure invalid static IPv6 and verify.
188 [Tags] Configure_Invalid_Static_IPv6_And_Verify
189 [Template] Configure IPv6 Address On BMC
190
kvishal9c6774c2025-09-10 02:14:07 -0500191 #invalid_ipv6 prefix length valid_status_code
192 ${ipv4_hexword_addr} ${test_prefix_length} ${HTTP_BAD_REQUEST}
193 ${invalid_hexadec_ipv6} ${test_prefix_length} ${HTTP_BAD_REQUEST}
194 ${ipv6_multi_short} ${test_prefix_length} ${HTTP_BAD_REQUEST}
195
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500196
Sweta Potthuri565318d2025-06-09 06:13:46 -0500197
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500198Configure IPv6 Static Default Gateway And Verify
199 [Documentation] Configure IPv6 static default gateway and verify.
200 [Tags] Configure_IPv6_Static_Default_Gateway_And_Verify
201 [Template] Configure IPv6 Static Default Gateway On BMC
Sweta Potthuri565318d2025-06-09 06:13:46 -0500202
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500203 # static_def_gw prefix length valid_status_code
204 ${ipv6_gw_addr} ${prefix_length_def} ${HTTP_OK}
205 ${invalid_staticv6_gateway} ${test_prefix_length} ${HTTP_BAD_REQUEST}
Sweta Potthuri565318d2025-06-09 06:13:46 -0500206
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500207
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500208Modify Static Default Gateway And Verify
209 [Documentation] Modify static default gateway and verify.
210 [Tags] Modify_Static_Default_Gateway_And_Verify
211 [Setup] Configure IPv6 Static Default Gateway On BMC ${ipv6_gw_addr} ${prefix_length_def}
212
213 Modify IPv6 Static Default Gateway On BMC ${test_ipv6_addr1} ${prefix_length_def} ${HTTP_OK} ${ipv6_gw_addr}
214
215
Sweta Potthuri2d085732025-07-16 09:10:08 -0500216Delete IPv6 Static Default Gateway And Verify
217 [Documentation] Delete IPv6 static default gateway and verify.
218 [Tags] Delete_IPv6_Static_Default_Gateway_And_Verify
219 [Setup] Configure IPv6 Static Default Gateway On BMC ${ipv6_gw_addr} ${prefix_length_def}
220
221 Delete IPv6 Static Default Gateway ${ipv6_gw_addr}
222
223
Sweta Potthuri35c503b2025-07-27 23:36:20 -0500224Verify Coexistence Of Linklocalv6 And Static IPv6 On BMC
225 [Documentation] Verify linklocalv6 And static IPv6 both exist.
226 [Tags] Verify_Coexistence_Of_Linklocalv6_And_Static_IPv6_On_BMC
Anvesh-Kumar_Rayankula019d9362025-09-03 22:55:12 -0500227 [Setup] Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
228 [Teardown] Delete IPv6 Address ${test_ipv6_addr}
Sweta Potthuri35c503b2025-07-27 23:36:20 -0500229
230 Check Coexistence Of Linklocalv6 And Static IPv6
231
232
George Keishingbadb4c62025-09-18 16:14:12 +0530233Verify IPv6 Linklocal Address Is In Correct Format
234 [Documentation] Verify linklocal address has network part as fe80 and
235 ... host part as EUI64.
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -0500236 [Tags] Verify_IPv6_Linklocal_Address_Is_In_Correct_Format
237
238 Check If Linklocal Address Is In Correct Format
239
240
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500241Verify BMC Gets SLAAC Address On Enabling SLAAC
242 [Documentation] On enabling SLAAC verify SLAAC address comes up.
243 [Tags] Verify_BMC_Gets_SLAAC_Address_On_Enabling_SLAAC
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500244 [Setup] Set SLAAC Configuration State And Verify ${False}
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500245
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500246 Set SLAAC Configuration State And Verify ${True}
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500247 Sleep ${NETWORK_TIMEOUT}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500248 Check BMC Gets SLAAC Address
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500249
250
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500251Verify Enable And Disable SLAAC On Both Interfaces
252 [Documentation] Verify enable and disable SLAAC on both the interfaces.
253 [Tags] Verify_Enable_And_Disable_SLAAC_On_Both_Interfaces
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500254 [Setup] Get The Initial SLAAC Settings
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500255 [Template] Set And Verify SLAAC Property On Both Interfaces
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500256 [Teardown] Run Keywords Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1}
257 ... AND Set SLAAC Configuration State And Verify ${slaac_channel_2} [${HTTP_OK}] ${2}
258
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500259 # slaac_eth0 slaac_eth1
260 ${True} ${True}
261 ${True} ${False}
262 ${False} ${True}
263 ${False} ${False}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500264
265
Sweta Potthuri425713a2025-10-16 00:28:20 -0500266Configure And Validate DHCPv6 Settings On Both Network Interfaces
267 [Documentation] Configure and validate the DHCPv6 enable/disable settings
268 ... on both network interfaces.
269 [Tags] Configure_And_Validate_DHCPv6_Settings_On_Both_Network_Interfaces
270 [Setup] Get The Initial DHCPv6 Settings
271 [Template] Set And Verify DHCPv6 Property On Both Interfaces
272 [Teardown] Run Keywords Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1} AND
273 ... Set And Verify DHCPv6 Property ${dhcpv6_channel_2} ${2}
274
275 # DHCPv6_eth0 DHCPv6_eth1
276 Enabled Enabled
277 Enabled Disabled
278 Disabled Enabled
279 Disabled Disabled
280
281
abhijith-1213a645902025-09-08 01:12:34 -0500282Verify Autoconfig Is Present On Ethernet Interface
283 [Documentation] Verify autoconfig is present on ethernet interface.
284 [Tags] Verify_Autoconfig_Is_Present_On_Ethernet_Interface
285
286 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
287 Should Contain ${resp.dict} StatelessAddressAutoConfig
288
289
Sweta Potthurif3d188f2025-09-08 07:17:31 -0500290Verify Interface ID Of SLAAC And LinkLocal Addresses Are Same
291 [Documentation] Validate interface id of SLAAC and link-local addresses are same.
292 [Tags] Verify_Interface_ID_Of_SLAAC_And_LinkLocal_Addresses_Are_Same
293
294 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
295 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= Get Address Origin List And Address For Type SLAAC
296
297 ${linklocal_interface_id}= Get Interface ID Of IPv6 ${ipv6_linklocal_addr}
298 ${slaac_interface_id}= Get Interface ID Of IPv6 ${ipv6_slaac_addr}
299
300 Should Be Equal ${linklocal_interface_id} ${slaac_interface_id}
301
302
abhijith-121c3e96d72025-09-09 11:35:09 -0500303Verify Persistency Of Link Local IPv6 On BMC Reboot
304 [Documentation] Verify persistency of link local on BMC reboot.
305 [Tags] Verify_Persistency_Of_Link_Local_IPv6_On_BMC_Reboot
306
307 # Capturing the linklocal before reboot.
308 @{ipv6_address_origin_list} ${linklocal_addr_before_reboot}=
309 ... Get Address Origin List And Address For Type LinkLocal
310
311 # Rebooting BMC.
312 Redfish OBMC Reboot (off) stack_mode=skip
313
314 @{ipv6_address_origin_list} ${linklocal_addr_after_reboot}=
315 ... Get Address Origin List And Address For Type LinkLocal
316
317 # Verifying the linklocal must be the same before and after reboot.
318 Should Be Equal ${linklocal_addr_before_reboot} ${linklocal_addr_after_reboot}
319 ... msg=IPv6 Linklocal address has changed after reboot.
320
321
Sweta Potthuri2f3fbb52025-09-19 00:50:47 -0500322Modify MAC and Verify BMC Reinitializing Linklocal
323 [Documentation] Modify MAC and verify BMC reinitializing linklocal.
324 [Tags] Modify_MAC_and_Verify_BMC_Reinitializing_Linklocal
325 [Teardown] Configure MAC Settings ${original_address}
326
327 ${original_address}= Get BMC MAC Address
328 @{ipv6_addressorigin_list} ${ipv6_before_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
329
330 # Modify MAC Address Of Ethernet Interface.
331 Configure MAC Settings ${new_mac_addr}
332 Sleep 30s
333 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
334 @{ipv6_addressorigin_list} ${ipv6_linklocal_after_addr}= Get Address Origin List And Address For Type LinkLocal
335
336 # Verify whether the linklocal has changed and is in the the correct format.
337 Check If Linklocal Address Is In Correct Format
338 Should Not Be Equal ${ipv6_before_linklocal_addr} ${ipv6_linklocal_after_addr}
339
340
abhijith-121bfbd03a2025-09-15 01:40:35 -0500341Add Multiple IPv6 Address And Verify
342 [Documentation] Add multiple IPv6 address and verify.
343 [Tags] Add_Multiple_IPv6_Address_And_Verify
344 [Teardown] Run Keywords
345 ... Delete IPv6 Address ${test_ipv6_addr} AND Delete IPv6 Address ${test_ipv6_addr1}
346 ... AND Test Teardown Execution
347
348 Configure Multiple IPv6 Address on BMC ${test_prefix_length}
349
350
abhijith-12197078c52025-09-25 01:13:00 -0500351Verify Coexistence Of Static IPv6 And SLAAC On BMC
abhijith-1214dc01a02025-09-24 11:29:55 -0500352 [Documentation] Verify static IPv6 And SLAAC both coexist.
abhijith-12197078c52025-09-25 01:13:00 -0500353 [Tags] Verify_Coexistence_Of_Static_IPv6_And_SLAAC_On_BMC
354 [Setup] Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
355 Set SLAAC Configuration State And Verify ${True}
356 [Teardown] Delete IPv6 Address ${test_ipv6_addr}
357
358 Sleep ${NETWORK_TIMEOUT}s
359
360 Check Coexistence Of Static IPv6 And SLAAC
361
362
abhijith-1218ff5db42025-09-24 06:24:03 -0500363Verify Coexistence Of Link Local And DHCPv6 On BMC
364 [Documentation] Verify link local And dhcpv6 both coexist.
365 [Tags] Verify_Coexistence_Of_Link_Local_And_DHCPv6_On_BMC
366 [Setup] Set DHCPv6 Property Enabled ${2}
367
368 Sleep ${NETWORK_TIMEOUT}s
369
370 Check Coexistence Of Link Local And DHCPv6
371
372
abhijith-1214dc01a02025-09-24 11:29:55 -0500373Verify Coexistence Of Link Local And SLAAC On BMC
374 [Documentation] Verify link local And SLAAC both coexist.
375 [Tags] Verify_Coexistence_Of_Link_Local_And_SLAAC_On_BMC
376 [Setup] Set SLAAC Configuration State And Verify ${True}
377
378 Sleep ${NETWORK_TIMEOUT}s
379
380 Check Coexistence Of Link Local And SLAAC
381
382
abhijith-121ffea1912025-10-06 02:39:22 -0500383Verify Coexistence Of All IPv6 Type Addresses On BMC
384 [Documentation] Verify coexistence of link local, static, DHCPv6 and SLAAC ipv6 addresses.
385 [Tags] Verify_Coexistence_Of_All_IPv6_Type_Addresses_On_BMC
386 [Setup] Run Keywords Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
387 ... AND Get The Initial DHCPv6 Setting On Each Interface ${1}
388 ... AND Set And Verify DHCPv6 Property Enabled
389 ... AND Get The Initial SLAAC Setting On Each Interface ${1}
390 ... AND Set SLAAC Configuration State And Verify ${True}
391 [Teardown] Run Keywords Delete IPv6 Address ${test_ipv6_addr}
392 ... AND Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1}
393 ... AND Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1}
394
395 Sleep ${NETWORK_TIMEOUT}s
396
397 # Verify link local, static, DHCPv6 and SLAAC ipv6 addresses coexist.
398 Verify The Coexistence Of The Address Type LinkLocal Static DHCPv6 SLAAC
399
400
abhijith-1219e190dd2025-10-15 03:35:06 -0500401Configure Link Local IPv6 Address And Verify
402 [Documentation] Configure link local IPv6 address and verify.
403 [Tags] Configure_Link_Local_IPv6_Address_And_Verify
404
405 Configure IPv6 Address On BMC ${link_local_addr} ${link_local_prefix_len}
406
407 # Verify the address origin contains link local.
408 @{ipv6_address_origin_list} ${ipv6_link_local_addr}=
409 ... Get Address Origin List And Address For Type LinkLocal
410
411 ${count}= Evaluate ${ipv6_address_origin_list}.count("LinkLocal")
412
413 Should Be Equal As Integers ${count} 2
414
415
abhijith-1215f0aa202025-10-24 02:53:53 -0500416Configure Valid IPv6 Address And Verify
417 [Documentation] Configure valid IPv6 address and verify it is getting added as expected format.
418 [Tags] Configure_Valid_IPv6_Address_And_Verify
abhijith-121b9fc2742025-10-14 09:46:43 -0500419 [Teardown] Run Keywords
abhijith-1215f0aa202025-10-24 02:53:53 -0500420 ... Delete IPv6 Address ${ipv6_zero_compression}
421 ... AND Delete IPv6 Address ${ipv6_eliminate_zero}
422 ... AND Delete IPv6 Address ${ipv6_eliminate_zero1}
423 ... AND Test Teardown Execution
424 [Template] Configure IPv6 Address On BMC
abhijith-121b9fc2742025-10-14 09:46:43 -0500425
abhijith-1215f0aa202025-10-24 02:53:53 -0500426 # IPv6 address prefix length IPv6 address verified.
427 ${ipv6_contigeous_zero} ${test_prefix_length} ${ipv6_zero_compression}
428 ${ipv6_firsthextet_zero} ${test_prefix_length} ${ipv6_eliminate_zero1}
429 ${ipv6_leading_zero} ${test_prefix_length} ${ipv6_eliminate_zero}
abhijith-121b9fc2742025-10-14 09:46:43 -0500430
431
abhijith-121d8322b72025-10-13 02:23:48 -0500432Verify Coexistence Of IPv6 Addresses Type Combination On BMC
433 [Documentation] Verify coexistence of IPv6 addresses type combination on BMC.
434 [Tags] Verify_Coexistence_Of_IPv6_Addresses_Type_Combination_On_BMC
435 [Setup] Run Keywords
436 ... Get The Initial DHCPv6 Setting On Each Interface ${1}
437 ... AND Get The Initial SLAAC Setting On Each Interface ${1}
438 [Teardown] Run Keywords
439 ... Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1}
440 ... AND Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1}
441 [Template] Verify IPv6 Addresses Coexist
442
443 # type1 type2.
444 Static DHCPv6
445 DHCPv6 SLAAC
446 SLAAC Static
447 Static Static
448
449
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600450*** Keywords ***
451
Prashanth Katti3270fd02021-06-11 08:02:22 -0500452Suite Setup Execution
453 [Documentation] Do suite setup execution.
454
Anvesh-Kumar_Rayankula019d9362025-09-03 22:55:12 -0500455 Redfish.Login
Prashanth Katti3270fd02021-06-11 08:02:22 -0500456 ${active_channel_config}= Get Active Channel Config
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -0500457 Set Suite Variable ${active_channel_config}
458
Prashanth Katti3270fd02021-06-11 08:02:22 -0500459 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
460
461 Set Suite variable ${ethernet_interface}
462
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500463 # Get initial IPv4 and IPv6 addresses and address origins for eth0.
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500464 ${initial_ipv4_addressorigin_list} ${initial_ipv4_addr_list}= Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses
465 ${initial_ipv6_addressorigin_list} ${initial_ipv6_addr_list}= Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses
466
467 Set Suite Variable ${initial_ipv4_addressorigin_list}
468 Set Suite Variable ${initial_ipv4_addr_list}
469 Set Suite Variable ${initial_ipv6_addressorigin_list}
470 Set Suite Variable ${initial_ipv6_addr_list}
471
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500472 # Get initial IPv4 and IPv6 addresses and address origins for eth1.
473 ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}=
474 ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${2}
475 ${eth1_initial_ipv6_addressorigin_list} ${eth1_initial_ipv6_addr_list}=
476 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${2}
477 Set Suite Variable ${eth1_initial_ipv4_addressorigin_list}
478 Set Suite Variable ${eth1_initial_ipv4_addr_list}
479 Set Suite Variable ${eth1_initial_ipv6_addressorigin_list}
480 Set Suite Variable ${eth1_initial_ipv6_addr_list}
481
Prashanth Katti3270fd02021-06-11 08:02:22 -0500482
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600483Test Setup Execution
484 [Documentation] Test setup execution.
485
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600486 @{ipv6_network_configurations}= Get IPv6 Network Configuration
487 Set Test Variable @{ipv6_network_configurations}
488
489 # Get BMC IPv6 address and prefix length.
490 ${ipv6_data}= Get BMC IPv6 Info
491 Set Test Variable ${ipv6_data}
492
493
494Test Teardown Execution
495 [Documentation] Test teardown execution.
496
497 FFDC On Test Case Fail
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600498
499
500Get IPv6 Network Configuration
501 [Documentation] Get Ipv6 network configuration.
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500502 [Arguments] ${channel_number}=${CHANNEL_NUMBER}
503
504 # Description of argument(s):
505 # channel_number Channel number (1 - eth0 and 2 - eth1).
506
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600507 # Sample output:
508 # {
ganesanb4d430282023-04-27 14:33:23 +0000509 # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0",
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600510 # "@odata.type": "#EthernetInterface.v1_4_1.EthernetInterface",
511 # "DHCPv4": {
512 # "DHCPEnabled": false,
513 # "UseDNSServers": false,
514 # "UseDomainName": true,
515 # "UseNTPServers": false
516 # },
517 # "DHCPv6": {
518 # "OperatingMode": "Disabled",
519 # "UseDNSServers": false,
520 # "UseDomainName": true,
521 # "UseNTPServers": false
522 # },
523 # "Description": "Management Network Interface",
524 # "FQDN": "localhost",
525 # "HostName": "localhost",
526 # "IPv4Addresses": [
527 # {
528 # "Address": "xx.xx.xx.xx",
529 # "AddressOrigin": "Static",
530 # "Gateway": "xx.xx.xx.1",
531 # "SubnetMask": "xx.xx.xx.0"
532 # },
533 # {
534 # "Address": "169.254.xx.xx",
535 # "AddressOrigin": "IPv4LinkLocal",
536 # "Gateway": "0.0.0.0",
537 # "SubnetMask": "xx.xx.0.0"
538 # },
539 # ],
540 # "IPv4StaticAddresses": [
541 # {
542 # "Address": "xx.xx.xx.xx",
543 # "AddressOrigin": "Static",
544 # "Gateway": "xx.xx.xx.1",
545 # "SubnetMask": "xx.xx.0.0"
546 # }
547 # }
548 # ],
549 # "IPv6AddressPolicyTable": [],
550 # "IPv6Addresses": [
551 # {
552 # "Address": "fe80::xxxx:xxxx:xxxx:xxxx",
553 # "AddressOrigin": "LinkLocal",
554 # "AddressState": null,
555 # "PrefixLength": xx
556 # }
557 # ],
558 # "IPv6DefaultGateway": "",
559 # "IPv6StaticAddresses": [
560 # { "Address": "xxxx:xxxx:xxxx:xxxx::xxxx",
561 # "AddressOrigin": "Static",
562 # "AddressState": null,
563 # "PrefixLength": xxx
564 # }
565 # ],
566 # "Id": "eth0",
567 # "InterfaceEnabled": true,
568 # "LinkStatus": "LinkUp",
569 # "MACAddress": "xx:xx:xx:xx:xx:xx",
570 # "Name": "Manager Ethernet Interface",
571 # "NameServers": [],
572 # "SpeedMbps": 0,
573 # "StaticNameServers": [],
574 # "Status": {
575 # "Health": "OK",
576 # "HealthRollup": "OK",
577 # "State": "Enabled"
578 # },
579 # "VLANs": {
ganesanb4d430282023-04-27 14:33:23 +0000580 # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0/VLANs"
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600581
582
583 ${active_channel_config}= Get Active Channel Config
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500584 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${channel_number}']['name']}
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600585
586 @{ipv6_network_configurations}= Get From Dictionary ${resp.dict} IPv6StaticAddresses
George Keishing409df052024-01-17 22:36:14 +0530587 RETURN @{ipv6_network_configurations}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500588
589
590Verify IPv6 And PrefixLength
591 [Documentation] Verify IPv6 address and prefix length on BMC.
592 [Arguments] ${ipv6_addr} ${prefix_len}
593
594 # Description of the argument(s):
595 # ipv6_addr IPv6 address to be verified.
596 # prefix_len PrefixLength value to be verified.
597
598 # Catenate IPv6 address and its prefix length.
599 ${ipv6_with_prefix}= Catenate ${ipv6_addr}/${prefix_len}
600
601 # Get IPv6 address details on BMC using IP command.
602 @{ip_data}= Get BMC IPv6 Info
603
604 # Verify if IPv6 and prefix length is configured on BMC.
605
606 Should Contain ${ip_data} ${ipv6_with_prefix}
607 ... msg=IPv6 and prefix length pair does not exist.
608
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500609Configure IPv6 Address On BMC
610 [Documentation] Add IPv6 Address on BMC.
abhijith-121b9fc2742025-10-14 09:46:43 -0500611 [Arguments] ${ipv6_addr1} ${prefix_len} ${ipv6_addr2}=${None}
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500612 ... ${channel_number}=${CHANNEL_NUMBER}
613 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_NO_CONTENT}]
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500614
615 # Description of argument(s):
abhijith-121b9fc2742025-10-14 09:46:43 -0500616 # ipv6_addr1 IPv6 address to be added (e.g. "2001:0022:0033::0111").
617 # ipv6_addr2 IPv6 address to be Verified (e.g. "2001:22:33::111").
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500618 # prefix_len Prefix length for the IPv6 to be added
619 # (e.g. "64").
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500620 # channel_number Channel number (1 - eth0 and 2 - eth1).
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500621 # valid_status_codes Expected return code from patch operation
622 # (e.g. "200").
623
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500624 ${prefix_length}= Convert To Integer ${prefix_len}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500625 ${empty_dict}= Create Dictionary
abhijith-121b9fc2742025-10-14 09:46:43 -0500626 ${ipv6_data}= Create Dictionary Address=${ipv6_addr1}
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500627 ... PrefixLength=${prefix_length}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500628
629 ${patch_list}= Create List
630
631 # Get existing static IPv6 configurations on BMC.
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500632 ${ipv6_network_configurations}= Get IPv6 Network Configuration ${channel_number}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500633 ${num_entries}= Get Length ${ipv6_network_configurations}
634
635 FOR ${INDEX} IN RANGE 0 ${num_entries}
636 Append To List ${patch_list} ${empty_dict}
637 END
638
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500639 # We need not check for existence of IPv6 on BMC while adding.
640 Append To List ${patch_list} ${ipv6_data}
641 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
642
643 ${active_channel_config}= Get Active Channel Config
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500644 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500645
646 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
abhijith-121b9fc2742025-10-14 09:46:43 -0500647 ... valid_status_codes=${valid_status_codes}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500648
abhijith-121b9fc2742025-10-14 09:46:43 -0500649 IF ${valid_status_codes} != [${HTTP_OK}, ${HTTP_NO_CONTENT}]
650 Fail msg=Static address not added correctly
651 END
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500652
653 # Note: Network restart takes around 15-18s after patch request processing.
654 Sleep ${NETWORK_TIMEOUT}s
655 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
656
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500657 # Verify ip address on CLI.
abhijith-121b9fc2742025-10-14 09:46:43 -0500658 IF '${ipv6_addr2}' != '${None}'
659 Verify IPv6 And PrefixLength ${ipv6_addr2} ${prefix_len}
660 ELSE
661 Verify IPv6 And PrefixLength ${ipv6_addr1} ${prefix_len}
662 END
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500663
664 # Verify if existing static IPv6 addresses still exist.
665 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
666 Verify IPv6 On BMC ${ipv6_network_configuration['Address']}
667 END
668
abhijith-121b9fc2742025-10-14 09:46:43 -0500669 #Verify redfish and CLI data matches.
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500670 Validate IPv6 Network Config On BMC
671
672
abhijith-121bfbd03a2025-09-15 01:40:35 -0500673Configure Multiple IPv6 Address on BMC
674 [Documentation] Add multiple IPv6 address on BMC.
675 [Arguments] ${prefix_len}
676 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_NO_CONTENT}]
677
678 # Description of argument(s):
679 # prefix_len Prefix length for the IPv6 to be added
680 # (e.g. "64").
681 # valid_status_codes Expected return code from patch operation
682 # (e.g. "200").
683
684 ${ipv6_list}= Create List ${test_ipv6_addr} ${test_ipv6_addr1}
685 ${prefix_length}= Convert To Integer ${prefix_len}
686 ${empty_dict}= Create Dictionary
687 ${patch_list}= Create List
688
689 # Get existing static IPv6 configurations on BMC.
690 ${ipv6_network_configurations}= Get IPv6 Network Configuration
691 ${num_entries}= Get Length ${ipv6_network_configurations}
692
693 FOR ${INDEX} IN RANGE 0 ${num_entries}
694 Append To List ${patch_list} ${empty_dict}
695 END
696
697 # We need not check for existence of IPv6 on BMC while adding.
698 FOR ${ipv6_addr} IN @{ipv6_list}
699 ${ipv6_data}= Create Dictionary Address=${ipv6_addr} PrefixLength=${prefix_length}
700 Append To List ${patch_list} ${ipv6_data}
701 END
702 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
703
704 ${active_channel_config}= Get Active Channel Config
705 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
706
707 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
708 ... valid_status_codes=${valid_status_codes}
709
710 IF ${valid_status_codes} != [${HTTP_OK}, ${HTTP_NO_CONTENT}]
711 Fail msg=Static address not added correctly
712 END
713
714 # Note: Network restart takes around 15-18s after patch request processing.
715 Sleep ${NETWORK_TIMEOUT}s
716 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
717
718 # Verify newly added ip address on CLI.
719 FOR ${ipv6_addr} IN @{ipv6_list}
720 Verify IPv6 And PrefixLength ${ipv6_addr} ${prefix_len}
721 END
722
723 # Verify if existing static IPv6 addresses still exist.
724 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
725 Verify IPv6 On BMC ${ipv6_network_configuration['Address']}
726 END
727
728 # Get the latest ipv6 network configurations.
729 @{ipv6_network_configurations}= Get IPv6 Network Configuration
730
731 # Verify newly added ip address on BMC.
732 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
733 Should Contain Match ${ipv6_list} ${ipv6_network_configuration['Address']}
734 END
735
736 Validate IPv6 Network Config On BMC
737
738
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500739Validate IPv6 Network Config On BMC
740 [Documentation] Check that IPv6 network info obtained via redfish matches info
741 ... obtained via CLI.
Sridevi Rameshed94c692025-09-07 23:41:10 -0500742
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500743 @{ipv6_network_configurations}= Get IPv6 Network Configuration
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500744 ${ipv6_data}= Get BMC IPv6 Info
745 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
746 Should Contain Match ${ipv6_data} ${ipv6_network_configuration['Address']}/*
747 ... msg=IPv6 address does not exist.
748 END
749
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500750
751Delete IPv6 Address
752 [Documentation] Delete IPv6 address of BMC.
Prashanth Kattibcb9dab2025-04-01 12:58:37 -0500753 [Arguments] ${ipv6_addr}
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500754 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]
755 ... ${channel_number}=${CHANNEL_NUMBER}
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500756
757 # Description of argument(s):
758 # ipv6_addr IPv6 address to be deleted (e.g. "2001:1234:1234:1234::1234").
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500759 # channel_number Channel number (1 - eth0 and 2 - eth1).
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500760 # valid_status_codes Expected return code from patch operation
761 # (e.g. "200"). See prolog of rest_request
762 # method in redfish_plus.py for details.
763
764 ${empty_dict}= Create Dictionary
765 ${patch_list}= Create List
766
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500767 @{ipv6_network_configurations}= Get IPv6 Network Configuration ${channel_number}
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500768 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
769 IF '${ipv6_network_configuration['Address']}' == '${ipv6_addr}'
770 Append To List ${patch_list} ${null}
771 ELSE
772 Append To List ${patch_list} ${empty_dict}
773 END
774 END
775
776 ${ip_found}= Run Keyword And Return Status List Should Contain Value
777 ... ${patch_list} ${null} msg=${ipv6_addr} does not exist on BMC
778 Pass Execution If ${ip_found} == ${False} ${ipv6_addr} does not exist on BMC
779
780 # Run patch command only if given IP is found on BMC
781 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
782
783 ${active_channel_config}= Get Active Channel Config
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500784 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500785
786 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
Sweta Potthuria1981612025-05-09 05:41:10 -0500787 ... valid_status_codes=${valid_status_codes}
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500788
789 # Note: Network restart takes around 15-18s after patch request processing
790 Sleep ${NETWORK_TIMEOUT}s
791 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
792
793 # IPv6 address that is deleted should not be there on BMC.
794 ${delete_status}= Run Keyword And Return Status Verify IPv6 On BMC ${ipv6_addr}
Anvesh-Kumar_Rayankula3a26c662025-04-16 01:19:26 -0500795 IF '${valid_status_codes}' == '[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]'
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500796 Should Be True '${delete_status}' == '${False}'
797 ELSE
798 Should Be True '${delete_status}' == '${True}'
799 END
800
801 Validate IPv6 Network Config On BMC
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500802
803
804Modify IPv6 Address
805 [Documentation] Modify and verify IPv6 address of BMC.
806 [Arguments] ${ipv6} ${new_ipv6} ${prefix_len}
807 ... ${valid_status_codes}=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
808
809 # Description of argument(s):
810 # ipv6 IPv6 address to be replaced (e.g. "2001:AABB:CCDD::AAFF").
811 # new_ipv6 New IPv6 address to be configured.
812 # prefix_len Prefix length value (Range 1 to 128).
813 # valid_status_codes Expected return code from patch operation
814 # (e.g. "200", "201").
815
816 ${empty_dict}= Create Dictionary
817 ${patch_list}= Create List
818 ${prefix_length}= Convert To Integer ${prefix_len}
819 ${ipv6_data}= Create Dictionary
820 ... Address=${new_ipv6} PrefixLength=${prefix_length}
821
822 # Sample IPv6 network configurations:
823 # "IPv6AddressPolicyTable": [],
824 # "IPv6Addresses": [
825 # {
826 # "Address": "X002:db8:0:2::XX0",
827 # "AddressOrigin": "DHCPv6",
828 # "PrefixLength": 128
829 # },
830 # {
831 # "Address": “X002:db8:0:2:a94:XXff:fe82:XXXX",
832 # "AddressOrigin": "SLAAC",
833 # "PrefixLength": 64
834 # },
835 # {
836 # "Address": “Y002:db8:0:2:a94:efff:fe82:5000",
837 # "AddressOrigin": "Static",
838 # "PrefixLength": 56
839 # },
840 # {
841 # "Address": “Z002:db8:0:2:a94:efff:fe82:5000",
842 # "AddressOrigin": "Static",
843 # "PrefixLength": 56
844 # },
845 # {
846 # "Address": “Xe80::a94:efff:YYYY:XXXX",
847 # "AddressOrigin": "LinkLocal",
848 # "PrefixLength": 64
849 # },
850 # {
851 # "Address": “X002:db8:1:2:eff:233:fee:546",
852 # "AddressOrigin": "Static",
853 # "PrefixLength": 56
854 # }
855 # ],
856 # "IPv6DefaultGateway": “XXXX::ab2e:80fe:87df:XXXX”,
857 # "IPv6StaticAddresses": [
858 # {
859 # "Address": “X002:db8:0:2:a94:efff:fe82:5000",
860 # "PrefixLength": 56
861 # },
862 # {
863 # "Address": “Y002:db8:0:2:a94:efff:fe82:5000",
864 # "PrefixLength": 56
865 # },
866 # {
867 # "Address": “Z002:db8:1:2:eff:233:fee:546",
868 # "PrefixLength": 56
869 # }
870 # ],
871 # "IPv6StaticDefaultGateways": [],
872
873 # Find the position of IPv6 address to be modified.
874 @{ipv6_network_configurations}= Get IPv6 Network Configuration
875 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
George Keishinge6e161e2025-05-08 10:18:30 +0530876 IF '${ipv6_network_configuration['Address']}' == '${ipv6}'
877 Append To List ${patch_list} ${ipv6_data}
878 ELSE
879 Append To List ${patch_list} ${empty_dict}
880 END
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500881 END
882
883 # Modify the IPv6 address only if given IPv6 is found
884 ${ip_found}= Run Keyword And Return Status List Should Contain Value
885 ... ${patch_list} ${ipv6_data} msg=${ipv6} does not exist on BMC
886 Pass Execution If ${ip_found} == ${False} ${ipv6} does not exist on BMC
887
888 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
889
890 ${active_channel_config}= Get Active Channel Config
891 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
892
893 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
894 ... body=&{data} valid_status_codes=${valid_status_codes}
895
896 # Note: Network restart takes around 15-18s after patch request processing.
897 Sleep ${NETWORK_TIMEOUT}s
898 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
899
900 # Verify if new IPv6 address is configured on BMC.
901 Verify IPv6 On BMC ${new_ipv6}
902
903 # Verify if old IPv6 address is erased.
904 ${cmd_status}= Run Keyword And Return Status
905 ... Verify IPv6 On BMC ${ipv6}
906 Should Be Equal ${cmd_status} ${False} msg=Old IPv6 address is not deleted.
907
908 Validate IPv6 Network Config On BMC
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500909
910
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500911Set SLAAC Configuration State And Verify
912 [Documentation] Set SLAAC configuration state and verify.
Sridevi Rameshed94c692025-09-07 23:41:10 -0500913 [Arguments] ${slaac_state} ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]
914 ... ${channel_number}=${CHANNEL_NUMBER}
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500915
916 # Description of argument(s):
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500917 # slaac_state SLAAC state('True' or 'False').
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500918 # valid_status_code Expected valid status codes.
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500919 # channel_number Channel number 1(eth0) or 2(eth1).
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500920
921 ${active_channel_config}= Get Active Channel Config
922 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
923
924 ${data}= Set Variable If ${slaac_state} == ${False} ${DISABLE_SLAAC} ${ENABLE_SLAAC}
925 ${resp}= Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
Sweta Potthuri610f86f2025-05-30 00:47:23 -0500926 ... body=${data} valid_status_codes=${valid_status_codes}
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500927
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500928 # Verify SLAAC is set correctly.
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500929 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
930 ${slaac_verify}= Get From Dictionary ${resp.dict} StatelessAddressAutoConfig
931
George Keishinge6e161e2025-05-08 10:18:30 +0530932 IF '${slaac_verify['IPv6AutoConfigEnabled']}' != '${slaac_state}'
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500933 Fail msg=SLAAC not set properly.
George Keishinge6e161e2025-05-08 10:18:30 +0530934 END
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500935
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500936Set And Verify DHCPv6 Property
937 [Documentation] Set DHCPv6 property and verify.
938 [Arguments] ${dhcpv6_operating_mode}=${Disabled} ${channel_number}=${CHANNEL_NUMBER}
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500939
940 # Description of argument(s):
941 # dhcpv6_operating_mode Enabled if user wants to enable DHCPv6('Enabled' or 'Disabled').
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500942 # channel_number Channel number 1 or 2.
943
944 Set DHCPv6 Property ${dhcpv6_operating_mode} ${channel_number}
945 Verify DHCPv6 Property ${dhcpv6_operating_mode} ${channel_number}
946
947
948Set DHCPv6 Property
949 [Documentation] Set DHCPv6 attribute is enables or disabled.
950 [Arguments] ${dhcpv6_operating_mode}=${Disabled} ${channel_number}=${CHANNEL_NUMBER}
951
952 # Description of argument(s):
953 # dhcpv6_operating_mode Enabled if user wants to enable DHCPv6('Enabled' or 'Disabled').
954 # channel_number Channel number 1 or 2.
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500955
956 ${data}= Set Variable If '${dhcpv6_operating_mode}' == 'Disabled' ${DISABLE_DHCPv6} ${ENABLE_DHCPv6}
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500957 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
958
959 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
960 ... body=${data} valid_status_codes=[${HTTP_OK},${HTTP_NO_CONTENT}]
961
kvishalbd04bd62025-08-05 03:57:53 -0500962
963Verify DHCPv6 Property
964 [Documentation] Verify DHCPv6 settings is enabled or disabled.
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500965 [Arguments] ${dhcpv6_operating_mode} ${channel_number}=${CHANNEL_NUMBER}
kvishalbd04bd62025-08-05 03:57:53 -0500966
967 # Description of Argument(s):
968 # dhcpv6_operating_mode Enable/ Disable DHCPv6.
Sweta Potthuridb4a6d62025-08-18 11:29:16 -0500969 # channel_number Channel number 1 or 2.
970
Sweta Potthuri425713a2025-10-16 00:28:20 -0500971 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
kvishalbd04bd62025-08-05 03:57:53 -0500972
Sweta Potthuri0df4a862025-03-24 12:05:09 -0500973 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
974 ${dhcpv6_verify}= Get From Dictionary ${resp.dict} DHCPv6
975
976 Should Be Equal '${dhcpv6_verify['OperatingMode']}' '${dhcpv6_operating_mode}'
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500977
Sweta Potthuri425713a2025-10-16 00:28:20 -0500978 Sleep 30s
979
980 @{ipv6_addressorigin_list} ${ipv6_dhcpv6_addr}=
981 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${channel_number}
982
983 IF "${dhcpv6_operating_mode}" == "Enabled"
984 @{ipv6_addressorigin_list} ${ipv6_dhcpv6_addr}=
985 ... Get Address Origin List And Address For Type DHCPv6 ${channel_number}
986 Should Not Be Empty ${ipv6_dhcpv6_addr} msg=DHCPv6 must be present.
987 ELSE
988 Should Not Contain ${ipv6_addressorigin_list} DHCPv6
989 END
990
991
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500992
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500993Get IPv6 Static Default Gateway
994 [Documentation] Get IPv6 static default gateway.
995
996 ${active_channel_config}= Get Active Channel Config
997 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${CHANNEL_NUMBER}']['name']}
998
999 @{ipv6_static_defgw_configurations}= Get From Dictionary ${resp.dict} IPv6StaticDefaultGateways
1000 RETURN @{ipv6_static_defgw_configurations}
1001
Sweta Potthuri2d085732025-07-16 09:10:08 -05001002
Sweta Potthuri2edacd32025-07-02 01:04:43 -05001003Configure IPv6 Static Default Gateway On BMC
1004 [Documentation] Configure IPv6 static default gateway on BMC.
1005 [Arguments] ${ipv6_gw_addr} ${prefix_length_def}
1006 ... ${valid_status_codes}=${HTTP_OK}
Sridevi Rameshed94c692025-09-07 23:41:10 -05001007
Sweta Potthuri2edacd32025-07-02 01:04:43 -05001008 # Description of argument(s):
1009 # ipv6_gw_addr IPv6 Static Default Gateway address to be configured.
1010 # prefix_len_def Prefix length value (Range 1 to 128).
1011 # valid_status_codes Expected return code from patch operation
1012 # (e.g. "200", "204".)
1013
1014 # Prefix Length is passed as None.
1015 IF '${prefix_length_def}' == '${None}'
1016 ${ipv6_gw}= Create Dictionary Address=${ipv6_gw_addr}
1017 ELSE
1018 ${ipv6_gw}= Create Dictionary Address=${ipv6_gw_addr} Prefix Length=${prefix_length_def}
1019 END
1020
1021 ${ipv6_static_def_gw}= Get IPv6 Static Default Gateway
1022
1023 ${num_entries}= Get Length ${ipv6_static_def_gw}
1024
1025 ${patch_list}= Create List
1026 ${empty_dict}= Create Dictionary
1027
1028 FOR ${INDEX} IN RANGE 0 ${num_entries}
1029 Append To List ${patch_list} ${empty_dict}
1030 END
1031
1032 ${valid_status_codes}= Set Variable If '${valid_status_codes}' == '${HTTP_OK}'
1033 ... ${HTTP_OK},${HTTP_NO_CONTENT}
1034 ... ${valid_status_codes}
1035
1036 Append To List ${patch_list} ${ipv6_gw}
1037 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
1038
1039 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1040 ... body=${data} valid_status_codes=[${valid_status_codes}]
1041
1042 # Verify the added static default gateway is present in Redfish Get Output.
1043 ${ipv6_staticdef_gateway}= Get IPv6 Static Default Gateway
1044
1045 ${ipv6_static_def_gw_list}= Create List
1046 FOR ${ipv6_staticdef_gateway} IN @{ipv6_staticdef_gateway}
1047 ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address
1048 Append To List ${ipv6_static_def_gw_list} ${value}
1049 END
1050
1051 IF '${valid_status_codes}' != '${HTTP_OK},${HTTP_NO_CONTENT}'
1052 Should Not Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr}
1053 ELSE
1054 Should Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr}
1055 END
1056
Sweta Potthuri2d085732025-07-16 09:10:08 -05001057
Anvesh-Kumar_Rayankula019d9362025-09-03 22:55:12 -05001058Modify IPv6 Static Default Gateway On BMC
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001059 [Documentation] Modify and verify IPv6 address of BMC.
1060 [Arguments] ${ipv6_gw_addr} ${new_static_def_gw} ${prefix_length}
1061 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED}]
Sweta Potthuri2edacd32025-07-02 01:04:43 -05001062
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001063 # Description of argument(s):
1064 # ipv6_gw_addr IPv6 static default gateway address to be replaced (e.g. "2001:AABB:CCDD::AAFF").
1065 # new_static_def_gw New static default gateway address to be configured.
Sridevi Rameshed94c692025-09-07 23:41:10 -05001066 # prefix_length Prefix length value (Range 1 to 128).
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001067 # valid_status_codes Expected return code from patch operation
1068 # (e.g. "200", "204").
Sweta Potthuri2edacd32025-07-02 01:04:43 -05001069
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001070 ${empty_dict}= Create Dictionary
1071 ${patch_list}= Create List
1072 # Prefix Length is passed as None.
1073 IF '${prefix_length_def}' == '${None}'
1074 ${modified_ipv6_gw_addripv6_data}= Create Dictionary Address=${new_static_def_gw}
1075 ELSE
1076 ${modified_ipv6_gw_addripv6_data}= Create Dictionary Address=${new_static_def_gw} Prefix Length=${prefix_length_def}
1077 END
Sweta Potthuri2edacd32025-07-02 01:04:43 -05001078
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001079 @{ipv6_static_def_gw_list}= Get IPv6 Static Default Gateway
1080
1081 FOR ${ipv6_static_def_gw} IN @{ipv6_static_def_gw_list}
1082 IF '${ipv6_static_def_gw['Address']}' == '${ipv6_gw_addr}'
1083 Append To List ${patch_list} ${modified_ipv6_gw_addripv6_data}
1084 ELSE
1085 Append To List ${patch_list} ${empty_dict}
1086 END
1087 END
1088
1089 # Modify the IPv6 address only if given IPv6 static default gateway is found.
1090 ${ip_static_def_gw_found}= Run Keyword And Return Status List Should Contain Value
1091 ... ${patch_list} ${modified_ipv6_gw_addripv6_data} msg=${ipv6_gw_addr} does not exist on BMC
1092 Pass Execution If ${ip_static_def_gw_found} == ${False} ${ipv6_gw_addr} does not exist on BMC
1093
1094 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
1095
1096 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1097 ... body=&{data} valid_status_codes=${valid_status_codes}
1098
1099 ${ipv6_staticdef_gateway}= Get IPv6 Static Default Gateway
1100
1101 ${ipv6_static_def_gw_list}= Create List
1102 FOR ${ipv6_staticdef_gateway} IN @{ipv6_staticdef_gateway}
Sweta Potthuri2d085732025-07-16 09:10:08 -05001103 ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001104 Append To List ${ipv6_static_def_gw_list} ${value}
1105 END
1106
1107 Should Contain ${ipv6_static_def_gw_list} ${new_static_def_gw}
1108 # Verify if old static default gateway address is erased.
1109 Should Not Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr}
1110
Sweta Potthuri2d085732025-07-16 09:10:08 -05001111
1112Delete IPv6 Static Default Gateway
1113 [Documentation] Delete IPv6 static default gateway on BMC.
1114 [Arguments] ${ipv6_gw_addr}
1115 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]
1116
1117 # Description of argument(s):
1118 # ipv6_gw_addr IPv6 Static Default Gateway address to be deleted.
1119 # valid_status_codes Expected return code from patch operation
1120 # (e.g. "200").
1121
1122 ${patch_list}= Create List
1123 ${empty_dict}= Create Dictionary
1124
1125 ${ipv6_static_def_gw_list}= Create List
1126 @{ipv6_static_defgw_configurations}= Get IPv6 Static Default Gateway
1127
1128 FOR ${ipv6_staticdef_gateway} IN @{ipv6_static_defgw_configurations}
1129 ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address
1130 Append To List ${ipv6_static_def_gw_list} ${value}
1131 END
1132
1133 ${defgw_found}= Run Keyword And Return Status List Should Contain Value
1134 ... ${ipv6_static_def_gw_list} ${ipv6_gw_addr} msg=${ipv6_gw_addr} does not exist on BMC
1135 Skip If ${defgw_found} == ${False} ${ipv6_gw_addr} does not exist on BMC
1136
1137 FOR ${ipv6_static_def_gw} IN @{ipv6_static_defgw_configurations}
1138 IF '${ipv6_static_def_gw['Address']}' == '${ipv6_gw_addr}'
1139 Append To List ${patch_list} ${null}
1140 ELSE
1141 Append To List ${patch_list} ${empty_dict}
1142 END
1143 END
1144
1145 # Run patch command only if given IP is found on BMC.
1146 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
1147
1148 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
1149 ... valid_status_codes=${valid_status_codes}
1150
1151 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
1152
1153 @{ipv6_static_defgw_configurations}= Get IPv6 Static Default Gateway
1154 Should Not Contain Match ${ipv6_static_defgw_configurations} ${ipv6_gw_addr}
1155 ... msg=IPv6 Static default gateway does not exist.
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001156
1157
1158Check Coexistence Of Linklocalv6 And Static IPv6
1159 [Documentation] Verify both linklocalv6 and static IPv6 exist.
1160
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001161 # Verify the address origin contains static and linklocal.
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001162 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001163
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001164 Should Match Regexp ${ipv6_linklocal_addr} ${linklocal_addr_format}
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001165 Should Contain ${ipv6_addressorigin_list} Static
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -05001166
1167
abhijith-12197078c52025-09-25 01:13:00 -05001168Check Coexistence Of Static IPv6 And SLAAC
abhijith-1214dc01a02025-09-24 11:29:55 -05001169 [Documentation] Verify both static IPv6 and SLAAC coexist.
abhijith-12197078c52025-09-25 01:13:00 -05001170
1171 # Verify the address origin contains static and slaac.
1172 @{ipv6_addressorigin_list} ${ipv6_static_addr}=
1173 ... Get Address Origin List And Address For Type Static
1174
1175 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1176 ... Get Address Origin List And Address For Type SLAAC
1177
1178
abhijith-1214dc01a02025-09-24 11:29:55 -05001179Check Coexistence Of Link Local And SLAAC
1180 [Documentation] Verify both link local and SLAAC coexist.
1181
1182 # Verify the address origin contains SLAAC and link local.
1183 @{ipv6_addressorigin_list} ${ipv6_link_local_addr}=
1184 ... Get Address Origin List And Address For Type LinkLocal
1185
1186 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1187 ... Get Address Origin List And Address For Type SLAAC
1188
1189 Should Match Regexp ${ipv6_link_local_addr} ${linklocal_addr_format}
1190
1191
abhijith-1218ff5db42025-09-24 06:24:03 -05001192Check Coexistence Of Link Local And DHCPv6
1193 [Documentation] Verify both link local and dhcpv6 coexist.
1194
1195 # Verify the address origin contains dhcpv6 and link local.
1196 @{ipv6_address_origin_list} ${ipv6_link_local_addr}=
1197 ... Get Address Origin List And Address For Type LinkLocal
1198
1199 @{ipv6_address_origin_list} ${ipv6_dhcpv6_addr}=
1200 ... Get Address Origin List And Address For Type DHCPv6
1201
1202 Should Match Regexp ${ipv6_link_local_addr} ${linklocal_addr_format}
1203
1204
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -05001205Check If Linklocal Address Is In Correct Format
1206 [Documentation] Linklocal address has network part fe80 and host part EUI64.
1207
1208 # Fetch the linklocal address.
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001209 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -05001210
1211 # Follow EUI64 from MAC.
1212 ${system_mac}= Get BMC MAC Address
1213 ${split_octets}= Split String ${system_mac} :
1214 ${first_octet}= Evaluate int('${split_octets[0]}', 16)
1215 ${flipped_hex}= Evaluate format(${first_octet} ^ 2, '02x')
1216 ${grp1}= Evaluate re.sub(r'^0+', '', '${flipped_hex}${split_octets[1]}') modules=re
1217 ${grp2}= Evaluate re.sub(r'^0+', '', '${split_octets[2]}ff') modules=re
1218 ${grp3}= Evaluate re.sub(r'^0+', '', '${split_octets[4]}${split_octets[5]}') modules=re
1219 ${linklocal}= Set Variable fe80::${grp1}:${grp2}:fe${split_octets[3]}:${grp3}
1220
1221 # Verify the linklocal obtained is the same as on the machine.
1222 Should Be Equal ${linklocal} ${ipv6_linklocal_addr}
1223
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001224
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001225Check BMC Gets SLAAC Address
1226 [Documentation] Check BMC gets slaac address.
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001227
1228 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= Get Address Origin List And Address For Type SLAAC
1229
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001230
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001231Get The Initial DHCPv6 Setting On Each Interface
1232 [Documentation] Get the initial DHCPv6 setting of each interface.
1233 [Arguments] ${channel_number}
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001234
1235 # Description of the argument(s):
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001236 # channel_number Channel number 1 or 2.
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001237
1238 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
1239 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1240 ${initial_dhcpv6_iface}= Get From Dictionary ${resp.dict} DHCPv6
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001241 IF ${channel_number}==${1}
1242 Set Test Variable ${dhcpv6_channel_1} ${initial_dhcpv6_iface['OperatingMode']}
1243 ELSE
1244 Set Test Variable ${dhcpv6_channel_2} ${initial_dhcpv6_iface['OperatingMode']}
1245 END
1246
1247
1248Get The Initial DHCPv6 Settings
1249 [Documentation] Get the initial DHCPv6 settings of both the interfaces.
1250
1251 Get The Initial DHCPv6 Setting On Each Interface ${1}
1252 Get The Initial DHCPv6 Setting On Each Interface ${2}
1253
1254
1255Get The Initial SLAAC Settings
1256 [Documentation] Get the initial SLAAC settings of both the interfaces.
1257
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001258 Get The Initial SLAAC Setting On Each Interface ${1}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001259 Get The Initial SLAAC Setting On Each Interface ${2}
1260
1261
1262Get The Initial SLAAC Setting On Each Interface
1263 [Documentation] Get the initial SLAAC setting of the interface.
1264 [Arguments] ${channel_number}
1265
1266 # Description of the argument(s):
1267 # channel_number Channel number 1 or 2.
1268
1269 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
1270 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1271 ${initial_slaac_iface}= Get From Dictionary ${resp.dict} StatelessAddressAutoConfig
1272 IF ${channel_number}==${1}
1273 Set Test Variable ${slaac_channel_1} ${initial_slaac_iface['IPv6AutoConfigEnabled']}
1274 ELSE
1275 Set Test Variable ${slaac_channel_2} ${initial_slaac_iface['IPv6AutoConfigEnabled']}
1276 END
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001277
1278
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001279Get Address Origin List And IPv4 or IPv6 Address
1280 [Documentation] Get address origin list and address for type.
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001281 [Arguments] ${ip_address_type} ${channel_number}=${CHANNEL_NUMBER}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001282
1283 # Description of the argument(s):
Sridevi Rameshed94c692025-09-07 23:41:10 -05001284 # ip_address_type Type of IPv4 or IPv6 address to be checked.
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001285 # channel_number Channel number 1(eth0) or 2(eth1).
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001286
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001287 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${channel_number}']['name']}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001288 @{ip_addresses}= Get From Dictionary ${resp.dict} ${ip_address_type}
1289
1290 ${ip_addressorigin_list}= Create List
1291 ${ip_addr_list}= Create List
1292 FOR ${ip_address} IN @{ip_addresses}
1293 ${ip_addressorigin}= Get From Dictionary ${ip_address} AddressOrigin
1294 Append To List ${ip_addressorigin_list} ${ip_addressorigin}
1295 Append To List ${ip_addr_list} ${ip_address['Address']}
1296 END
1297 RETURN ${ip_addressorigin_list} ${ip_addr_list}
1298
1299
1300Verify All The Addresses Are Intact
1301 [Documentation] Verify all the addresses and address origins remain intact.
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001302 [Arguments] ${channel_number}=${CHANNEL_NUMBER}
1303 ... ${initial_ipv4_addressorigin_list}=${initial_ipv4_addressorigin_list}
1304 ... ${initial_ipv4_addr_list}=${initial_ipv4_addr_list}
1305
1306 # Description of argument(s):
1307 # channel_number Channel number 1(eth0) or 2(eth1).
1308 # initial_ipv4_addressorigin_list Initial IPv4 address origin list.
1309 # initial_ipv4_addr_list Initial IPv4 address list.
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001310
1311 # Verify that it will not impact the IPv4 configuration.
1312 Sleep ${NETWORK_TIMEOUT}
1313 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
1314
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001315 # IPv6 Linklocal address must be present.
1316 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}=
1317 ... Get Address Origin List And Address For Type LinkLocal ${channel_number}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001318
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001319 # IPv4 addresses must remain intact.
1320 ${ipv4_addressorigin_list} ${ipv4_addr_list}=
1321 ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${channel_number}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001322
1323 Should be Equal ${initial_ipv4_addressorigin_list} ${ipv4_addressorigin_list}
1324 Should be Equal ${initial_ipv4_addr_list} ${ipv4_addr_list}
Sweta Potthurif3d188f2025-09-08 07:17:31 -05001325
1326
1327Get Interface ID Of IPv6
1328 [Documentation] Get interface id of IPv6 address.
1329 [Arguments] ${ipv6_address}
1330
1331 # Description of the argument(s):
1332 # ${ipv6_address} IPv6 Address to extract the last 4 hextets.
1333
1334 # Last 64 bits of SLAAC and Linklocal must be the same.
1335 # Sample IPv6 network configurations.
1336 #"IPv6AddressPolicyTable": [],
1337 # "IPv6Addresses": [
1338 # {
1339 # "Address": "fe80::xxxx:xxxx:xxxx:xxxx",
1340 # "AddressOrigin": "LinkLocal",
1341 # "AddressState": null,
1342 # "PrefixLength": xx
1343 # }
1344 # ],
1345 # {
1346 # "Address": "2002:xxxx:xxxx:xxxx:xxxx",
1347 # "AddressOrigin": "SLAAC",
1348 # "PrefixLength": 64
1349 # }
1350 # ],
1351
1352 ${split_ip_address}= Split String ${ipv6_address} :
1353 ${missing_ip}= Evaluate 8 - len(${split_ip_address}) + 1
1354 ${expanded_ip}= Create List
1355
1356 FOR ${hextet} IN @{split_ip_address}
1357 IF '${hextet}' == ''
1358 FOR ${i} IN RANGE ${missing_ip}
1359 Append To List ${expanded_ip} 0000
1360 END
1361 ELSE
1362 Append To List ${expanded_ip} ${hextet}
1363 END
1364 END
1365 ${interface_id}= Evaluate ':'.join(${expanded_ip}[-4:])
1366 RETURN ${interface_id}
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001367
1368
1369Set And Verify SLAAC Property On Both Interfaces
1370 [Documentation] Set and verify SLAAC property on both interfaces.
1371 [Arguments] ${slaac_value_1} ${slaac_value_2}
1372
1373 # Description of the argument(s):
1374 # slaac_value_1 SLAAC value for channel 1.
1375 # slaac_value_2 SLAAC value for channel 2.
1376
1377 Set SLAAC Configuration State And Verify ${slaac_value_1} [${HTTP_OK}] ${1}
1378 Set SLAAC Configuration State And Verify ${slaac_value_2} [${HTTP_OK}] ${2}
1379
1380 Sleep 30s
1381
1382 # Check SLAAC Settings for eth0.
1383 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1384 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${1}
1385 IF "${slaac_value_1}" == "${True}"
1386 Should Not Be Empty ${ipv6_slaac_addr} SLAAC
1387 ELSE
1388 Should Not Contain ${ipv6_addressorigin_list} SLAAC
1389 END
1390
1391 # Check SLAAC Settings for eth1.
1392 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1393 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${2}
1394 IF "${slaac_value_2}" == "${True}"
1395 Should Not Be Empty ${ipv6_slaac_addr} SLAAC
1396 ELSE
1397 Should Not Contain ${ipv6_addressorigin_list} SLAAC
1398 END
1399
1400 Verify All The Addresses Are Intact ${1}
1401 Verify All The Addresses Are Intact ${2}
1402 ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}
1403
Sweta Potthuri425713a2025-10-16 00:28:20 -05001404
1405Set And Verify DHCPv6 Property On Both Interfaces
1406 [Documentation] Set and verify DHCPv6 property on both interfaces.
1407 [Arguments] ${dhcpv6_value_1} ${dhcpv6_value_2}
1408
1409 # Description of the argument(s):
1410 # dhcpv6_value_1 DHCPv6 value for channel 1.
1411 # dhcpv6_value_2 DHCPv6 value for channel 2.
1412
1413 Set And Verify DHCPv6 Property ${dhcpv6_value_1} ${1}
1414 Set And Verify DHCPv6 Property ${dhcpv6_value_2} ${2}
1415
1416 Verify All The Addresses Are Intact ${1}
1417 Verify All The Addresses Are Intact ${2}
1418 ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}
abhijith-121d8322b72025-10-13 02:23:48 -05001419
1420
1421Verify IPv6 Addresses Coexist
1422 [Documentation] Verify IPv6 address type coexist.
1423 [Arguments] ${ipv6_address_type1} ${ipv6_address_type2}
1424
1425 # Description of the argument(s):
1426 # ipv6_address_type1 IPv6 address type.
1427 # ipv6_address_type2 IPv6 address type.
1428 # Valid IPv6 address type (Static, DHCPv6, SLAAC).
1429
1430 IF '${ipv6_address_type1}' == 'Static' and '${ipv6_address_type2}' == 'DHCPv6'
1431 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
1432 Set And Verify DHCPv6 Property Enabled
1433 ELSE IF '${ipv6_address_type1}' == 'DHCPv6' and '${ipv6_address_type2}' == 'SLAAC'
1434 Set And Verify DHCPv6 Property Enabled
1435 Set SLAAC Configuration State And Verify ${True}
1436 ELSE IF '${ipv6_address_type1}' == 'SLAAC' and '${ipv6_address_type2}' == 'Static'
1437 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
1438 Set SLAAC Configuration State And Verify ${True}
1439 ELSE IF '${ipv6_address_type1}' == 'Static' and '${ipv6_address_type2}' == 'Static'
1440 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
1441 Configure IPv6 Address On BMC ${test_ipv6_addr1} ${test_prefix_length}
1442 END
1443
1444 Sleep ${NETWORK_TIMEOUT}s
1445
1446 # Verify coexistence.
1447 Verify The Coexistence Of The Address Type ${ipv6_address_type1} ${ipv6_address_type2}
1448
1449 IF '${ipv6_address_type1}' == 'Static' or '${ipv6_address_type2}' == 'Static'
1450 Delete IPv6 Address ${test_ipv6_addr}
1451 END
1452 IF '${ipv6_address_type1}' == 'Static' and '${ipv6_address_type2}' == 'Static'
1453 Delete IPv6 Address ${test_ipv6_addr1}
1454 END
1455
1456 Set And Verify DHCPv6 Property Disabled
1457 Set SLAAC Configuration State And Verify ${False}