blob: d72b117b3d77af9d7811c82b2556e67698f3308a [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
abhijith-12159fed682025-10-31 00:36:15 -0500186Verify Persistency Of DHCPv6 On BMC Reboot On Eth1
187 [Documentation] Verify persistency of DHCPv6 property and
188 ... all existing n/w configurations on BMC reboot on eth1.
189 [Tags] Verify_Persistency_Of_DHCPv6_On_BMC_Reboot_On_Eth1
190 [Setup] Set And Verify DHCPv6 Property Enabled ${2}
191
192 Redfish OBMC Reboot (off) stack_mode=skip
193
194 Verify DHCPv6 Property Enabled ${2}
195
196 Verify All The Addresses Are Intact ${1}
197 Verify All The Addresses Are Intact ${2}
198 ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}
199
200
Sweta Potthurie05a8dd2025-10-29 08:32:32 -0500201Verify Persistency Of SLAAC On BMC Reboot On Eth0
202 [Documentation] Verify persistency of SLAAC property on reboot on eth0.
203 [Tags] Verify_Persistency_Of_SLAAC_On_BMC_Reboot_On_Eth0
204
205 Set SLAAC Configuration State And Verify ${True} [${HTTP_OK}] ${1} ${False}
206 Redfish OBMC Reboot (off) stack_mode=skip
207 Verify SLAAC Property ${True}
208
209
210Verify Persistency Of SLAAC On BMC Reboot On Eth1
211 [Documentation] Verify persistency of SLAAC property on reboot on eth1.
212 [Tags] Verify_Persistency_Of_SLAAC_On_BMC_Reboot_On_Eth1
213
214 Set SLAAC Configuration State And Verify ${True} [${HTTP_OK}] ${2} ${False}
215 Redfish OBMC Reboot (off) stack_mode=skip
216 Verify SLAAC Property ${True} ${2}
217
218
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500219Configure Invalid Static IPv6 And Verify
220 [Documentation] Configure invalid static IPv6 and verify.
221 [Tags] Configure_Invalid_Static_IPv6_And_Verify
222 [Template] Configure IPv6 Address On BMC
223
kvishal9c6774c2025-09-10 02:14:07 -0500224 #invalid_ipv6 prefix length valid_status_code
225 ${ipv4_hexword_addr} ${test_prefix_length} ${HTTP_BAD_REQUEST}
226 ${invalid_hexadec_ipv6} ${test_prefix_length} ${HTTP_BAD_REQUEST}
227 ${ipv6_multi_short} ${test_prefix_length} ${HTTP_BAD_REQUEST}
228
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500229
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500230Configure IPv6 Static Default Gateway And Verify
231 [Documentation] Configure IPv6 static default gateway and verify.
232 [Tags] Configure_IPv6_Static_Default_Gateway_And_Verify
233 [Template] Configure IPv6 Static Default Gateway On BMC
Sweta Potthuri565318d2025-06-09 06:13:46 -0500234
Sweta Potthuri2edacd32025-07-02 01:04:43 -0500235 # static_def_gw prefix length valid_status_code
236 ${ipv6_gw_addr} ${prefix_length_def} ${HTTP_OK}
237 ${invalid_staticv6_gateway} ${test_prefix_length} ${HTTP_BAD_REQUEST}
Sweta Potthuri565318d2025-06-09 06:13:46 -0500238
Sweta Potthuricb61ff02025-04-09 05:16:09 -0500239
Sweta Potthuri4b0083f2025-07-09 11:34:40 -0500240Modify Static Default Gateway And Verify
241 [Documentation] Modify static default gateway and verify.
242 [Tags] Modify_Static_Default_Gateway_And_Verify
243 [Setup] Configure IPv6 Static Default Gateway On BMC ${ipv6_gw_addr} ${prefix_length_def}
244
245 Modify IPv6 Static Default Gateway On BMC ${test_ipv6_addr1} ${prefix_length_def} ${HTTP_OK} ${ipv6_gw_addr}
246
247
Sweta Potthuri2d085732025-07-16 09:10:08 -0500248Delete IPv6 Static Default Gateway And Verify
249 [Documentation] Delete IPv6 static default gateway and verify.
250 [Tags] Delete_IPv6_Static_Default_Gateway_And_Verify
251 [Setup] Configure IPv6 Static Default Gateway On BMC ${ipv6_gw_addr} ${prefix_length_def}
252
253 Delete IPv6 Static Default Gateway ${ipv6_gw_addr}
254
255
Sweta Potthuri35c503b2025-07-27 23:36:20 -0500256Verify Coexistence Of Linklocalv6 And Static IPv6 On BMC
257 [Documentation] Verify linklocalv6 And static IPv6 both exist.
258 [Tags] Verify_Coexistence_Of_Linklocalv6_And_Static_IPv6_On_BMC
Anvesh-Kumar_Rayankula019d9362025-09-03 22:55:12 -0500259 [Setup] Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
260 [Teardown] Delete IPv6 Address ${test_ipv6_addr}
Sweta Potthuri35c503b2025-07-27 23:36:20 -0500261
262 Check Coexistence Of Linklocalv6 And Static IPv6
263
264
George Keishingbadb4c62025-09-18 16:14:12 +0530265Verify IPv6 Linklocal Address Is In Correct Format
266 [Documentation] Verify linklocal address has network part as fe80 and
267 ... host part as EUI64.
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -0500268 [Tags] Verify_IPv6_Linklocal_Address_Is_In_Correct_Format
269
270 Check If Linklocal Address Is In Correct Format
271
272
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500273Verify BMC Gets SLAAC Address On Enabling SLAAC
274 [Documentation] On enabling SLAAC verify SLAAC address comes up.
275 [Tags] Verify_BMC_Gets_SLAAC_Address_On_Enabling_SLAAC
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500276 [Setup] Set SLAAC Configuration State And Verify ${False}
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500277
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500278 Set SLAAC Configuration State And Verify ${True}
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500279 Sleep ${NETWORK_TIMEOUT}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500280 Check BMC Gets SLAAC Address
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -0500281
282
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500283Verify Enable And Disable SLAAC On Both Interfaces
284 [Documentation] Verify enable and disable SLAAC on both the interfaces.
285 [Tags] Verify_Enable_And_Disable_SLAAC_On_Both_Interfaces
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500286 [Setup] Get The Initial SLAAC Settings
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500287 [Template] Set And Verify SLAAC Property On Both Interfaces
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500288 [Teardown] Run Keywords Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1}
289 ... AND Set SLAAC Configuration State And Verify ${slaac_channel_2} [${HTTP_OK}] ${2}
290
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500291 # slaac_eth0 slaac_eth1
292 ${True} ${True}
293 ${True} ${False}
294 ${False} ${True}
295 ${False} ${False}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500296
297
Sweta Potthuri425713a2025-10-16 00:28:20 -0500298Configure And Validate DHCPv6 Settings On Both Network Interfaces
299 [Documentation] Configure and validate the DHCPv6 enable/disable settings
300 ... on both network interfaces.
301 [Tags] Configure_And_Validate_DHCPv6_Settings_On_Both_Network_Interfaces
302 [Setup] Get The Initial DHCPv6 Settings
303 [Template] Set And Verify DHCPv6 Property On Both Interfaces
304 [Teardown] Run Keywords Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1} AND
305 ... Set And Verify DHCPv6 Property ${dhcpv6_channel_2} ${2}
306
307 # DHCPv6_eth0 DHCPv6_eth1
308 Enabled Enabled
309 Enabled Disabled
310 Disabled Enabled
311 Disabled Disabled
312
313
abhijith-1213a645902025-09-08 01:12:34 -0500314Verify Autoconfig Is Present On Ethernet Interface
315 [Documentation] Verify autoconfig is present on ethernet interface.
316 [Tags] Verify_Autoconfig_Is_Present_On_Ethernet_Interface
317
318 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
319 Should Contain ${resp.dict} StatelessAddressAutoConfig
320
321
Sweta Potthurif3d188f2025-09-08 07:17:31 -0500322Verify Interface ID Of SLAAC And LinkLocal Addresses Are Same
323 [Documentation] Validate interface id of SLAAC and link-local addresses are same.
324 [Tags] Verify_Interface_ID_Of_SLAAC_And_LinkLocal_Addresses_Are_Same
325
326 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
327 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= Get Address Origin List And Address For Type SLAAC
328
329 ${linklocal_interface_id}= Get Interface ID Of IPv6 ${ipv6_linklocal_addr}
330 ${slaac_interface_id}= Get Interface ID Of IPv6 ${ipv6_slaac_addr}
331
332 Should Be Equal ${linklocal_interface_id} ${slaac_interface_id}
333
334
abhijith-121c3e96d72025-09-09 11:35:09 -0500335Verify Persistency Of Link Local IPv6 On BMC Reboot
336 [Documentation] Verify persistency of link local on BMC reboot.
337 [Tags] Verify_Persistency_Of_Link_Local_IPv6_On_BMC_Reboot
338
339 # Capturing the linklocal before reboot.
340 @{ipv6_address_origin_list} ${linklocal_addr_before_reboot}=
341 ... Get Address Origin List And Address For Type LinkLocal
342
343 # Rebooting BMC.
344 Redfish OBMC Reboot (off) stack_mode=skip
345
346 @{ipv6_address_origin_list} ${linklocal_addr_after_reboot}=
347 ... Get Address Origin List And Address For Type LinkLocal
348
349 # Verifying the linklocal must be the same before and after reboot.
350 Should Be Equal ${linklocal_addr_before_reboot} ${linklocal_addr_after_reboot}
351 ... msg=IPv6 Linklocal address has changed after reboot.
352
353
Sweta Potthuri2f3fbb52025-09-19 00:50:47 -0500354Modify MAC and Verify BMC Reinitializing Linklocal
355 [Documentation] Modify MAC and verify BMC reinitializing linklocal.
356 [Tags] Modify_MAC_and_Verify_BMC_Reinitializing_Linklocal
357 [Teardown] Configure MAC Settings ${original_address}
358
359 ${original_address}= Get BMC MAC Address
360 @{ipv6_addressorigin_list} ${ipv6_before_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
361
362 # Modify MAC Address Of Ethernet Interface.
363 Configure MAC Settings ${new_mac_addr}
364 Sleep 30s
365 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
366 @{ipv6_addressorigin_list} ${ipv6_linklocal_after_addr}= Get Address Origin List And Address For Type LinkLocal
367
368 # Verify whether the linklocal has changed and is in the the correct format.
369 Check If Linklocal Address Is In Correct Format
370 Should Not Be Equal ${ipv6_before_linklocal_addr} ${ipv6_linklocal_after_addr}
371
372
abhijith-121bfbd03a2025-09-15 01:40:35 -0500373Add Multiple IPv6 Address And Verify
374 [Documentation] Add multiple IPv6 address and verify.
375 [Tags] Add_Multiple_IPv6_Address_And_Verify
376 [Teardown] Run Keywords
377 ... Delete IPv6 Address ${test_ipv6_addr} AND Delete IPv6 Address ${test_ipv6_addr1}
378 ... AND Test Teardown Execution
379
380 Configure Multiple IPv6 Address on BMC ${test_prefix_length}
381
382
abhijith-12197078c52025-09-25 01:13:00 -0500383Verify Coexistence Of Static IPv6 And SLAAC On BMC
abhijith-1214dc01a02025-09-24 11:29:55 -0500384 [Documentation] Verify static IPv6 And SLAAC both coexist.
abhijith-12197078c52025-09-25 01:13:00 -0500385 [Tags] Verify_Coexistence_Of_Static_IPv6_And_SLAAC_On_BMC
386 [Setup] Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
387 Set SLAAC Configuration State And Verify ${True}
388 [Teardown] Delete IPv6 Address ${test_ipv6_addr}
389
390 Sleep ${NETWORK_TIMEOUT}s
391
392 Check Coexistence Of Static IPv6 And SLAAC
393
394
abhijith-1218ff5db42025-09-24 06:24:03 -0500395Verify Coexistence Of Link Local And DHCPv6 On BMC
396 [Documentation] Verify link local And dhcpv6 both coexist.
397 [Tags] Verify_Coexistence_Of_Link_Local_And_DHCPv6_On_BMC
398 [Setup] Set DHCPv6 Property Enabled ${2}
399
400 Sleep ${NETWORK_TIMEOUT}s
401
402 Check Coexistence Of Link Local And DHCPv6
403
404
abhijith-1214dc01a02025-09-24 11:29:55 -0500405Verify Coexistence Of Link Local And SLAAC On BMC
406 [Documentation] Verify link local And SLAAC both coexist.
407 [Tags] Verify_Coexistence_Of_Link_Local_And_SLAAC_On_BMC
408 [Setup] Set SLAAC Configuration State And Verify ${True}
409
410 Sleep ${NETWORK_TIMEOUT}s
411
412 Check Coexistence Of Link Local And SLAAC
413
414
abhijith-121ffea1912025-10-06 02:39:22 -0500415Verify Coexistence Of All IPv6 Type Addresses On BMC
416 [Documentation] Verify coexistence of link local, static, DHCPv6 and SLAAC ipv6 addresses.
417 [Tags] Verify_Coexistence_Of_All_IPv6_Type_Addresses_On_BMC
418 [Setup] Run Keywords Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
419 ... AND Get The Initial DHCPv6 Setting On Each Interface ${1}
420 ... AND Set And Verify DHCPv6 Property Enabled
421 ... AND Get The Initial SLAAC Setting On Each Interface ${1}
422 ... AND Set SLAAC Configuration State And Verify ${True}
423 [Teardown] Run Keywords Delete IPv6 Address ${test_ipv6_addr}
424 ... AND Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1}
425 ... AND Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1}
426
427 Sleep ${NETWORK_TIMEOUT}s
428
429 # Verify link local, static, DHCPv6 and SLAAC ipv6 addresses coexist.
430 Verify The Coexistence Of The Address Type LinkLocal Static DHCPv6 SLAAC
431
432
abhijith-1219e190dd2025-10-15 03:35:06 -0500433Configure Link Local IPv6 Address And Verify
434 [Documentation] Configure link local IPv6 address and verify.
435 [Tags] Configure_Link_Local_IPv6_Address_And_Verify
436
437 Configure IPv6 Address On BMC ${link_local_addr} ${link_local_prefix_len}
438
439 # Verify the address origin contains link local.
440 @{ipv6_address_origin_list} ${ipv6_link_local_addr}=
441 ... Get Address Origin List And Address For Type LinkLocal
442
443 ${count}= Evaluate ${ipv6_address_origin_list}.count("LinkLocal")
444
445 Should Be Equal As Integers ${count} 2
446
447
abhijith-1215f0aa202025-10-24 02:53:53 -0500448Configure Valid IPv6 Address And Verify
449 [Documentation] Configure valid IPv6 address and verify it is getting added as expected format.
450 [Tags] Configure_Valid_IPv6_Address_And_Verify
abhijith-121b9fc2742025-10-14 09:46:43 -0500451 [Teardown] Run Keywords
abhijith-1215f0aa202025-10-24 02:53:53 -0500452 ... Delete IPv6 Address ${ipv6_zero_compression}
453 ... AND Delete IPv6 Address ${ipv6_eliminate_zero}
454 ... AND Delete IPv6 Address ${ipv6_eliminate_zero1}
455 ... AND Test Teardown Execution
456 [Template] Configure IPv6 Address On BMC
abhijith-121b9fc2742025-10-14 09:46:43 -0500457
abhijith-1215f0aa202025-10-24 02:53:53 -0500458 # IPv6 address prefix length IPv6 address verified.
459 ${ipv6_contigeous_zero} ${test_prefix_length} ${ipv6_zero_compression}
460 ${ipv6_firsthextet_zero} ${test_prefix_length} ${ipv6_eliminate_zero1}
461 ${ipv6_leading_zero} ${test_prefix_length} ${ipv6_eliminate_zero}
abhijith-121b9fc2742025-10-14 09:46:43 -0500462
463
abhijith-121d8322b72025-10-13 02:23:48 -0500464Verify Coexistence Of IPv6 Addresses Type Combination On BMC
465 [Documentation] Verify coexistence of IPv6 addresses type combination on BMC.
466 [Tags] Verify_Coexistence_Of_IPv6_Addresses_Type_Combination_On_BMC
467 [Setup] Run Keywords
468 ... Get The Initial DHCPv6 Setting On Each Interface ${1}
469 ... AND Get The Initial SLAAC Setting On Each Interface ${1}
470 [Teardown] Run Keywords
471 ... Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1}
472 ... AND Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1}
473 [Template] Verify IPv6 Addresses Coexist
474
475 # type1 type2.
476 Static DHCPv6
477 DHCPv6 SLAAC
478 SLAAC Static
479 Static Static
480
481
abhijith-121cd9edf62025-11-03 02:25:25 -0600482Verify Eth0 Static IPv4 Functions Properly In The Presence Of DHCPv6
483 [Documentation] Verify eth0 static IPv4 functions properly in the presence of DHCPv6.
484 [Tags] Verify_Eth0_Static_IPv4_Functions_Properly_In_The_Presence_Of_DHCPv6
485 [Setup] Set And Verify DHCPv6 Property Enabled
486
487 # Verify that on enabling DHCPv6 other configurations are not impacted.
488 Sleep ${NETWORK_TIMEOUT}
489 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
490
491 Verify All The Addresses Are Intact ${1}
492 Verify All The Addresses Are Intact ${2}
493 ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}
494
495
abhijith-121f037d8b2025-10-31 05:13:42 -0500496Disable And Verify AutoConfig On Both Interfaces When AutoConfig Enabled
497 [Documentation] Enable and then disable both eth0 & eth1 with auto-config and
498 ... check both interfaces gets disabled with SLAAC.
499 [Tags] Disable_And_Verify_AutoConfig_On_Both_Interfaces_When_AutoConfig_Enabled
500 [Setup] Set And Verify SLAAC Property On Both Interfaces ${True} ${True}
501 [Template] Set And Verify SLAAC Property On Both Interfaces
502
503 # slaac_eth0 slaac_eth1.
504 ${False} ${False}
505
506
abhijith-121dc17d422025-11-14 04:19:28 -0600507Verify Eth1 DHCPv4 Functions Properly In The Presence Of Static IPv6
508 [Documentation] Verify eth1 dhcpv4 functions properly in the presence of Static IPv6.
509 [Tags] Verify_Eth1_DHCPv4_Functions_Properly_In_The_Presence_Of_Static_IPv6
510 [Setup] Run Keywords
511 ... Set DHCPEnabled To Enable Or Disable True eth1
512 ... AND Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} ${None} ${2}
513
514 # Verify presence of static IPv6 address and origin.
515 @{ipv6_address_origin_list} ${static_ipv6_addr}=
516 ... Get Address Origin List And Address For Type Static ${2}
517 Should Contain ${ipv6_address_origin_list} Static
518 Should Not Be Empty ${static_ipv6_addr} msg=${test_ipv6_addr} address is not present
519
520 # Verify eth1 DHCPv4 is enabled.
521 ${DHCPEnabled}= Get IPv4 DHCP Enabled Status ${2}
522 Should Be Equal ${DHCPEnabled} ${True}
523
524 # Verify presence of DHCPv4 address origin.
525 @{ipv4_addressorigin_list} ${ipv4_addr_list}=
526 ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${2}
527 ${ipv4_addressorigin_list}= Evaluate sum(${ipv4_addressorigin_list}, [])
528 Should Contain ${ipv4_addressorigin_list} DHCP
529
530 # Verify static is not present in address origin when DHPCv4 enabled.
531 List Should Not Contain Value ${ipv4_addressorigin_list} Static
532
533
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600534*** Keywords ***
535
Prashanth Katti3270fd02021-06-11 08:02:22 -0500536Suite Setup Execution
537 [Documentation] Do suite setup execution.
538
Anvesh-Kumar_Rayankula019d9362025-09-03 22:55:12 -0500539 Redfish.Login
Prashanth Katti3270fd02021-06-11 08:02:22 -0500540 ${active_channel_config}= Get Active Channel Config
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -0500541 Set Suite Variable ${active_channel_config}
542
Prashanth Katti3270fd02021-06-11 08:02:22 -0500543 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
544
545 Set Suite variable ${ethernet_interface}
546
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500547 # Get initial IPv4 and IPv6 addresses and address origins for eth0.
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500548 ${initial_ipv4_addressorigin_list} ${initial_ipv4_addr_list}= Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses
549 ${initial_ipv6_addressorigin_list} ${initial_ipv6_addr_list}= Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses
550
551 Set Suite Variable ${initial_ipv4_addressorigin_list}
552 Set Suite Variable ${initial_ipv4_addr_list}
553 Set Suite Variable ${initial_ipv6_addressorigin_list}
554 Set Suite Variable ${initial_ipv6_addr_list}
555
Sweta Potthuri6370afd2025-10-08 00:07:46 -0500556 # Get initial IPv4 and IPv6 addresses and address origins for eth1.
557 ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}=
558 ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${2}
559 ${eth1_initial_ipv6_addressorigin_list} ${eth1_initial_ipv6_addr_list}=
560 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${2}
561 Set Suite Variable ${eth1_initial_ipv4_addressorigin_list}
562 Set Suite Variable ${eth1_initial_ipv4_addr_list}
563 Set Suite Variable ${eth1_initial_ipv6_addressorigin_list}
564 Set Suite Variable ${eth1_initial_ipv6_addr_list}
565
Prashanth Katti3270fd02021-06-11 08:02:22 -0500566
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600567Test Setup Execution
568 [Documentation] Test setup execution.
569
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600570 @{ipv6_network_configurations}= Get IPv6 Network Configuration
571 Set Test Variable @{ipv6_network_configurations}
572
573 # Get BMC IPv6 address and prefix length.
574 ${ipv6_data}= Get BMC IPv6 Info
575 Set Test Variable ${ipv6_data}
576
577
578Test Teardown Execution
579 [Documentation] Test teardown execution.
580
581 FFDC On Test Case Fail
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600582
583
584Get IPv6 Network Configuration
585 [Documentation] Get Ipv6 network configuration.
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500586 [Arguments] ${channel_number}=${CHANNEL_NUMBER}
587
588 # Description of argument(s):
589 # channel_number Channel number (1 - eth0 and 2 - eth1).
590
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600591 # Sample output:
592 # {
ganesanb4d430282023-04-27 14:33:23 +0000593 # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0",
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600594 # "@odata.type": "#EthernetInterface.v1_4_1.EthernetInterface",
595 # "DHCPv4": {
596 # "DHCPEnabled": false,
597 # "UseDNSServers": false,
598 # "UseDomainName": true,
599 # "UseNTPServers": false
600 # },
601 # "DHCPv6": {
602 # "OperatingMode": "Disabled",
603 # "UseDNSServers": false,
604 # "UseDomainName": true,
605 # "UseNTPServers": false
606 # },
607 # "Description": "Management Network Interface",
608 # "FQDN": "localhost",
609 # "HostName": "localhost",
610 # "IPv4Addresses": [
611 # {
612 # "Address": "xx.xx.xx.xx",
613 # "AddressOrigin": "Static",
614 # "Gateway": "xx.xx.xx.1",
615 # "SubnetMask": "xx.xx.xx.0"
616 # },
617 # {
618 # "Address": "169.254.xx.xx",
619 # "AddressOrigin": "IPv4LinkLocal",
620 # "Gateway": "0.0.0.0",
621 # "SubnetMask": "xx.xx.0.0"
622 # },
623 # ],
624 # "IPv4StaticAddresses": [
625 # {
626 # "Address": "xx.xx.xx.xx",
627 # "AddressOrigin": "Static",
628 # "Gateway": "xx.xx.xx.1",
629 # "SubnetMask": "xx.xx.0.0"
630 # }
631 # }
632 # ],
633 # "IPv6AddressPolicyTable": [],
634 # "IPv6Addresses": [
635 # {
636 # "Address": "fe80::xxxx:xxxx:xxxx:xxxx",
637 # "AddressOrigin": "LinkLocal",
638 # "AddressState": null,
639 # "PrefixLength": xx
640 # }
641 # ],
642 # "IPv6DefaultGateway": "",
643 # "IPv6StaticAddresses": [
644 # { "Address": "xxxx:xxxx:xxxx:xxxx::xxxx",
645 # "AddressOrigin": "Static",
646 # "AddressState": null,
647 # "PrefixLength": xxx
648 # }
649 # ],
650 # "Id": "eth0",
651 # "InterfaceEnabled": true,
652 # "LinkStatus": "LinkUp",
653 # "MACAddress": "xx:xx:xx:xx:xx:xx",
654 # "Name": "Manager Ethernet Interface",
655 # "NameServers": [],
656 # "SpeedMbps": 0,
657 # "StaticNameServers": [],
658 # "Status": {
659 # "Health": "OK",
660 # "HealthRollup": "OK",
661 # "State": "Enabled"
662 # },
663 # "VLANs": {
ganesanb4d430282023-04-27 14:33:23 +0000664 # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0/VLANs"
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600665
666
667 ${active_channel_config}= Get Active Channel Config
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500668 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${channel_number}']['name']}
Prashanth Katti8abbb4d2021-01-29 02:17:45 -0600669
670 @{ipv6_network_configurations}= Get From Dictionary ${resp.dict} IPv6StaticAddresses
George Keishing409df052024-01-17 22:36:14 +0530671 RETURN @{ipv6_network_configurations}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500672
673
674Verify IPv6 And PrefixLength
675 [Documentation] Verify IPv6 address and prefix length on BMC.
676 [Arguments] ${ipv6_addr} ${prefix_len}
677
678 # Description of the argument(s):
679 # ipv6_addr IPv6 address to be verified.
680 # prefix_len PrefixLength value to be verified.
681
682 # Catenate IPv6 address and its prefix length.
683 ${ipv6_with_prefix}= Catenate ${ipv6_addr}/${prefix_len}
684
685 # Get IPv6 address details on BMC using IP command.
686 @{ip_data}= Get BMC IPv6 Info
687
688 # Verify if IPv6 and prefix length is configured on BMC.
689
690 Should Contain ${ip_data} ${ipv6_with_prefix}
691 ... msg=IPv6 and prefix length pair does not exist.
692
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500693Configure IPv6 Address On BMC
694 [Documentation] Add IPv6 Address on BMC.
abhijith-121b9fc2742025-10-14 09:46:43 -0500695 [Arguments] ${ipv6_addr1} ${prefix_len} ${ipv6_addr2}=${None}
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500696 ... ${channel_number}=${CHANNEL_NUMBER}
697 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_NO_CONTENT}]
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500698
699 # Description of argument(s):
abhijith-121b9fc2742025-10-14 09:46:43 -0500700 # ipv6_addr1 IPv6 address to be added (e.g. "2001:0022:0033::0111").
701 # ipv6_addr2 IPv6 address to be Verified (e.g. "2001:22:33::111").
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500702 # prefix_len Prefix length for the IPv6 to be added
703 # (e.g. "64").
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500704 # channel_number Channel number (1 - eth0 and 2 - eth1).
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500705 # valid_status_codes Expected return code from patch operation
706 # (e.g. "200").
707
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500708 ${prefix_length}= Convert To Integer ${prefix_len}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500709 ${empty_dict}= Create Dictionary
abhijith-121b9fc2742025-10-14 09:46:43 -0500710 ${ipv6_data}= Create Dictionary Address=${ipv6_addr1}
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500711 ... PrefixLength=${prefix_length}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500712
713 ${patch_list}= Create List
714
715 # Get existing static IPv6 configurations on BMC.
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500716 ${ipv6_network_configurations}= Get IPv6 Network Configuration ${channel_number}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500717 ${num_entries}= Get Length ${ipv6_network_configurations}
718
719 FOR ${INDEX} IN RANGE 0 ${num_entries}
720 Append To List ${patch_list} ${empty_dict}
721 END
722
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500723 # We need not check for existence of IPv6 on BMC while adding.
724 Append To List ${patch_list} ${ipv6_data}
725 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
726
727 ${active_channel_config}= Get Active Channel Config
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500728 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500729
730 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
abhijith-121b9fc2742025-10-14 09:46:43 -0500731 ... valid_status_codes=${valid_status_codes}
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500732
abhijith-121b9fc2742025-10-14 09:46:43 -0500733 IF ${valid_status_codes} != [${HTTP_OK}, ${HTTP_NO_CONTENT}]
734 Fail msg=Static address not added correctly
735 END
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500736
737 # Note: Network restart takes around 15-18s after patch request processing.
738 Sleep ${NETWORK_TIMEOUT}s
739 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
740
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500741 # Verify ip address on CLI.
abhijith-121b9fc2742025-10-14 09:46:43 -0500742 IF '${ipv6_addr2}' != '${None}'
743 Verify IPv6 And PrefixLength ${ipv6_addr2} ${prefix_len}
744 ELSE
745 Verify IPv6 And PrefixLength ${ipv6_addr1} ${prefix_len}
746 END
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500747
748 # Verify if existing static IPv6 addresses still exist.
749 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
750 Verify IPv6 On BMC ${ipv6_network_configuration['Address']}
751 END
752
abhijith-121b9fc2742025-10-14 09:46:43 -0500753 #Verify redfish and CLI data matches.
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500754 Validate IPv6 Network Config On BMC
755
756
abhijith-121bfbd03a2025-09-15 01:40:35 -0500757Configure Multiple IPv6 Address on BMC
758 [Documentation] Add multiple IPv6 address on BMC.
759 [Arguments] ${prefix_len}
760 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_NO_CONTENT}]
761
762 # Description of argument(s):
763 # prefix_len Prefix length for the IPv6 to be added
764 # (e.g. "64").
765 # valid_status_codes Expected return code from patch operation
766 # (e.g. "200").
767
768 ${ipv6_list}= Create List ${test_ipv6_addr} ${test_ipv6_addr1}
769 ${prefix_length}= Convert To Integer ${prefix_len}
770 ${empty_dict}= Create Dictionary
771 ${patch_list}= Create List
772
773 # Get existing static IPv6 configurations on BMC.
774 ${ipv6_network_configurations}= Get IPv6 Network Configuration
775 ${num_entries}= Get Length ${ipv6_network_configurations}
776
777 FOR ${INDEX} IN RANGE 0 ${num_entries}
778 Append To List ${patch_list} ${empty_dict}
779 END
780
781 # We need not check for existence of IPv6 on BMC while adding.
782 FOR ${ipv6_addr} IN @{ipv6_list}
783 ${ipv6_data}= Create Dictionary Address=${ipv6_addr} PrefixLength=${prefix_length}
784 Append To List ${patch_list} ${ipv6_data}
785 END
786 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
787
788 ${active_channel_config}= Get Active Channel Config
789 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
790
791 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
792 ... valid_status_codes=${valid_status_codes}
793
794 IF ${valid_status_codes} != [${HTTP_OK}, ${HTTP_NO_CONTENT}]
795 Fail msg=Static address not added correctly
796 END
797
798 # Note: Network restart takes around 15-18s after patch request processing.
799 Sleep ${NETWORK_TIMEOUT}s
800 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
801
802 # Verify newly added ip address on CLI.
803 FOR ${ipv6_addr} IN @{ipv6_list}
804 Verify IPv6 And PrefixLength ${ipv6_addr} ${prefix_len}
805 END
806
807 # Verify if existing static IPv6 addresses still exist.
808 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
809 Verify IPv6 On BMC ${ipv6_network_configuration['Address']}
810 END
811
812 # Get the latest ipv6 network configurations.
813 @{ipv6_network_configurations}= Get IPv6 Network Configuration
814
815 # Verify newly added ip address on BMC.
816 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
817 Should Contain Match ${ipv6_list} ${ipv6_network_configuration['Address']}
818 END
819
820 Validate IPv6 Network Config On BMC
821
822
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500823Validate IPv6 Network Config On BMC
824 [Documentation] Check that IPv6 network info obtained via redfish matches info
825 ... obtained via CLI.
Sridevi Rameshed94c692025-09-07 23:41:10 -0500826
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500827 @{ipv6_network_configurations}= Get IPv6 Network Configuration
Prashanth Kattic1d2daa2022-07-26 03:53:06 -0500828 ${ipv6_data}= Get BMC IPv6 Info
829 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
830 Should Contain Match ${ipv6_data} ${ipv6_network_configuration['Address']}/*
831 ... msg=IPv6 address does not exist.
832 END
833
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500834
835Delete IPv6 Address
836 [Documentation] Delete IPv6 address of BMC.
Prashanth Kattibcb9dab2025-04-01 12:58:37 -0500837 [Arguments] ${ipv6_addr}
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500838 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]
839 ... ${channel_number}=${CHANNEL_NUMBER}
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500840
841 # Description of argument(s):
842 # ipv6_addr IPv6 address to be deleted (e.g. "2001:1234:1234:1234::1234").
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500843 # channel_number Channel number (1 - eth0 and 2 - eth1).
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500844 # valid_status_codes Expected return code from patch operation
845 # (e.g. "200"). See prolog of rest_request
846 # method in redfish_plus.py for details.
847
848 ${empty_dict}= Create Dictionary
849 ${patch_list}= Create List
850
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500851 @{ipv6_network_configurations}= Get IPv6 Network Configuration ${channel_number}
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500852 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
853 IF '${ipv6_network_configuration['Address']}' == '${ipv6_addr}'
854 Append To List ${patch_list} ${null}
855 ELSE
856 Append To List ${patch_list} ${empty_dict}
857 END
858 END
859
860 ${ip_found}= Run Keyword And Return Status List Should Contain Value
861 ... ${patch_list} ${null} msg=${ipv6_addr} does not exist on BMC
862 Pass Execution If ${ip_found} == ${False} ${ipv6_addr} does not exist on BMC
863
864 # Run patch command only if given IP is found on BMC
865 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
866
867 ${active_channel_config}= Get Active Channel Config
Sweta Potthuri3b2b9cd2025-10-22 06:41:54 -0500868 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500869
870 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
Sweta Potthuria1981612025-05-09 05:41:10 -0500871 ... valid_status_codes=${valid_status_codes}
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500872
873 # Note: Network restart takes around 15-18s after patch request processing
874 Sleep ${NETWORK_TIMEOUT}s
875 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
876
877 # IPv6 address that is deleted should not be there on BMC.
878 ${delete_status}= Run Keyword And Return Status Verify IPv6 On BMC ${ipv6_addr}
Anvesh-Kumar_Rayankula3a26c662025-04-16 01:19:26 -0500879 IF '${valid_status_codes}' == '[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]'
Prashanth Katti12ed4b72023-05-16 05:24:00 -0500880 Should Be True '${delete_status}' == '${False}'
881 ELSE
882 Should Be True '${delete_status}' == '${True}'
883 END
884
885 Validate IPv6 Network Config On BMC
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500886
887
888Modify IPv6 Address
889 [Documentation] Modify and verify IPv6 address of BMC.
890 [Arguments] ${ipv6} ${new_ipv6} ${prefix_len}
891 ... ${valid_status_codes}=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
892
893 # Description of argument(s):
894 # ipv6 IPv6 address to be replaced (e.g. "2001:AABB:CCDD::AAFF").
895 # new_ipv6 New IPv6 address to be configured.
896 # prefix_len Prefix length value (Range 1 to 128).
897 # valid_status_codes Expected return code from patch operation
898 # (e.g. "200", "201").
899
900 ${empty_dict}= Create Dictionary
901 ${patch_list}= Create List
902 ${prefix_length}= Convert To Integer ${prefix_len}
903 ${ipv6_data}= Create Dictionary
904 ... Address=${new_ipv6} PrefixLength=${prefix_length}
905
906 # Sample IPv6 network configurations:
907 # "IPv6AddressPolicyTable": [],
908 # "IPv6Addresses": [
909 # {
910 # "Address": "X002:db8:0:2::XX0",
911 # "AddressOrigin": "DHCPv6",
912 # "PrefixLength": 128
913 # },
914 # {
915 # "Address": “X002:db8:0:2:a94:XXff:fe82:XXXX",
916 # "AddressOrigin": "SLAAC",
917 # "PrefixLength": 64
918 # },
919 # {
920 # "Address": “Y002:db8:0:2:a94:efff:fe82:5000",
921 # "AddressOrigin": "Static",
922 # "PrefixLength": 56
923 # },
924 # {
925 # "Address": “Z002:db8:0:2:a94:efff:fe82:5000",
926 # "AddressOrigin": "Static",
927 # "PrefixLength": 56
928 # },
929 # {
930 # "Address": “Xe80::a94:efff:YYYY:XXXX",
931 # "AddressOrigin": "LinkLocal",
932 # "PrefixLength": 64
933 # },
934 # {
935 # "Address": “X002:db8:1:2:eff:233:fee:546",
936 # "AddressOrigin": "Static",
937 # "PrefixLength": 56
938 # }
939 # ],
940 # "IPv6DefaultGateway": “XXXX::ab2e:80fe:87df:XXXX”,
941 # "IPv6StaticAddresses": [
942 # {
943 # "Address": “X002:db8:0:2:a94:efff:fe82:5000",
944 # "PrefixLength": 56
945 # },
946 # {
947 # "Address": “Y002:db8:0:2:a94:efff:fe82:5000",
948 # "PrefixLength": 56
949 # },
950 # {
951 # "Address": “Z002:db8:1:2:eff:233:fee:546",
952 # "PrefixLength": 56
953 # }
954 # ],
955 # "IPv6StaticDefaultGateways": [],
956
957 # Find the position of IPv6 address to be modified.
958 @{ipv6_network_configurations}= Get IPv6 Network Configuration
959 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
George Keishinge6e161e2025-05-08 10:18:30 +0530960 IF '${ipv6_network_configuration['Address']}' == '${ipv6}'
961 Append To List ${patch_list} ${ipv6_data}
962 ELSE
963 Append To List ${patch_list} ${empty_dict}
964 END
Prashanth Katti5f7d2e42023-05-22 03:17:25 -0500965 END
966
967 # Modify the IPv6 address only if given IPv6 is found
968 ${ip_found}= Run Keyword And Return Status List Should Contain Value
969 ... ${patch_list} ${ipv6_data} msg=${ipv6} does not exist on BMC
970 Pass Execution If ${ip_found} == ${False} ${ipv6} does not exist on BMC
971
972 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
973
974 ${active_channel_config}= Get Active Channel Config
975 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
976
977 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
978 ... body=&{data} valid_status_codes=${valid_status_codes}
979
980 # Note: Network restart takes around 15-18s after patch request processing.
981 Sleep ${NETWORK_TIMEOUT}s
982 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
983
984 # Verify if new IPv6 address is configured on BMC.
985 Verify IPv6 On BMC ${new_ipv6}
986
987 # Verify if old IPv6 address is erased.
988 ${cmd_status}= Run Keyword And Return Status
989 ... Verify IPv6 On BMC ${ipv6}
990 Should Be Equal ${cmd_status} ${False} msg=Old IPv6 address is not deleted.
991
992 Validate IPv6 Network Config On BMC
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500993
994
Sweta Potthuriabbbeae2025-08-21 00:06:26 -0500995Set SLAAC Configuration State And Verify
Sweta Potthurie05a8dd2025-10-29 08:32:32 -0500996 [Documentation] Set SLAAC configuration state.
Sridevi Rameshed94c692025-09-07 23:41:10 -0500997 [Arguments] ${slaac_state} ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]
Sweta Potthurie05a8dd2025-10-29 08:32:32 -0500998 ... ${channel_number}=${CHANNEL_NUMBER} ${is_slaac_verify_state}=${True}
Sweta Potthuri8ba74322025-03-19 12:29:06 -0500999
1000 # Description of argument(s):
Sweta Potthurie05a8dd2025-10-29 08:32:32 -05001001 # slaac_state SLAAC state('True' or 'False').
1002 # valid_status_code Expected valid status codes.
1003 # channel_number Channel number 1(eth0) or 2(eth1).
1004 # is_slaac_verify_state Flag to check verification is required.
Sweta Potthuri8ba74322025-03-19 12:29:06 -05001005
1006 ${active_channel_config}= Get Active Channel Config
1007 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
1008
1009 ${data}= Set Variable If ${slaac_state} == ${False} ${DISABLE_SLAAC} ${ENABLE_SLAAC}
1010 ${resp}= Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
Sweta Potthuri610f86f2025-05-30 00:47:23 -05001011 ... body=${data} valid_status_codes=${valid_status_codes}
Sweta Potthurie05a8dd2025-10-29 08:32:32 -05001012 IF ${is_slaac_verify_state}
1013 Verify SLAAC Property ${slaac_state} ${channel_number}
1014 END
1015
1016
1017Verify SLAAC Property
1018 [Documentation] Verify SLAAC property.
1019 [Arguments] ${slaac_state} ${channel_number}=${CHANNEL_NUMBER}
1020
1021 # Description of argument(s):
1022 # slaac_state SLAAC state('True' or 'False').
1023 # channel_number Channel number 1(eth0) or 2(eth1).
Sweta Potthuri8ba74322025-03-19 12:29:06 -05001024
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001025 # Verify SLAAC is set correctly.
Sweta Potthuri8ba74322025-03-19 12:29:06 -05001026 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1027 ${slaac_verify}= Get From Dictionary ${resp.dict} StatelessAddressAutoConfig
1028
George Keishinge6e161e2025-05-08 10:18:30 +05301029 IF '${slaac_verify['IPv6AutoConfigEnabled']}' != '${slaac_state}'
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001030 Fail msg=SLAAC not set properly.
George Keishinge6e161e2025-05-08 10:18:30 +05301031 END
Sweta Potthuri0df4a862025-03-24 12:05:09 -05001032
Sweta Potthurie05a8dd2025-10-29 08:32:32 -05001033
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001034Set And Verify DHCPv6 Property
1035 [Documentation] Set DHCPv6 property and verify.
1036 [Arguments] ${dhcpv6_operating_mode}=${Disabled} ${channel_number}=${CHANNEL_NUMBER}
Sweta Potthuri0df4a862025-03-24 12:05:09 -05001037
1038 # Description of argument(s):
1039 # dhcpv6_operating_mode Enabled if user wants to enable DHCPv6('Enabled' or 'Disabled').
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001040 # channel_number Channel number 1 or 2.
1041
1042 Set DHCPv6 Property ${dhcpv6_operating_mode} ${channel_number}
1043 Verify DHCPv6 Property ${dhcpv6_operating_mode} ${channel_number}
1044
1045
1046Set DHCPv6 Property
1047 [Documentation] Set DHCPv6 attribute is enables or disabled.
1048 [Arguments] ${dhcpv6_operating_mode}=${Disabled} ${channel_number}=${CHANNEL_NUMBER}
1049
1050 # Description of argument(s):
1051 # dhcpv6_operating_mode Enabled if user wants to enable DHCPv6('Enabled' or 'Disabled').
1052 # channel_number Channel number 1 or 2.
Sweta Potthuri0df4a862025-03-24 12:05:09 -05001053
1054 ${data}= Set Variable If '${dhcpv6_operating_mode}' == 'Disabled' ${DISABLE_DHCPv6} ${ENABLE_DHCPv6}
Sweta Potthuri0df4a862025-03-24 12:05:09 -05001055 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
1056
1057 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1058 ... body=${data} valid_status_codes=[${HTTP_OK},${HTTP_NO_CONTENT}]
1059
kvishalbd04bd62025-08-05 03:57:53 -05001060
1061Verify DHCPv6 Property
1062 [Documentation] Verify DHCPv6 settings is enabled or disabled.
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001063 [Arguments] ${dhcpv6_operating_mode} ${channel_number}=${CHANNEL_NUMBER}
kvishalbd04bd62025-08-05 03:57:53 -05001064
1065 # Description of Argument(s):
1066 # dhcpv6_operating_mode Enable/ Disable DHCPv6.
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001067 # channel_number Channel number 1 or 2.
1068
Sweta Potthuri425713a2025-10-16 00:28:20 -05001069 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
kvishalbd04bd62025-08-05 03:57:53 -05001070
Sweta Potthuri0df4a862025-03-24 12:05:09 -05001071 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1072 ${dhcpv6_verify}= Get From Dictionary ${resp.dict} DHCPv6
1073
1074 Should Be Equal '${dhcpv6_verify['OperatingMode']}' '${dhcpv6_operating_mode}'
Sweta Potthuricb61ff02025-04-09 05:16:09 -05001075
Sweta Potthuri425713a2025-10-16 00:28:20 -05001076 Sleep 30s
1077
1078 @{ipv6_addressorigin_list} ${ipv6_dhcpv6_addr}=
1079 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${channel_number}
1080
1081 IF "${dhcpv6_operating_mode}" == "Enabled"
1082 @{ipv6_addressorigin_list} ${ipv6_dhcpv6_addr}=
1083 ... Get Address Origin List And Address For Type DHCPv6 ${channel_number}
1084 Should Not Be Empty ${ipv6_dhcpv6_addr} msg=DHCPv6 must be present.
1085 ELSE
1086 Should Not Contain ${ipv6_addressorigin_list} DHCPv6
1087 END
1088
1089
Sweta Potthuri2edacd32025-07-02 01:04:43 -05001090
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001091Get IPv6 Static Default Gateway
1092 [Documentation] Get IPv6 static default gateway.
1093
1094 ${active_channel_config}= Get Active Channel Config
1095 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${CHANNEL_NUMBER}']['name']}
1096
1097 @{ipv6_static_defgw_configurations}= Get From Dictionary ${resp.dict} IPv6StaticDefaultGateways
1098 RETURN @{ipv6_static_defgw_configurations}
1099
Sweta Potthuri2d085732025-07-16 09:10:08 -05001100
Sweta Potthuri2edacd32025-07-02 01:04:43 -05001101Configure IPv6 Static Default Gateway On BMC
1102 [Documentation] Configure IPv6 static default gateway on BMC.
1103 [Arguments] ${ipv6_gw_addr} ${prefix_length_def}
1104 ... ${valid_status_codes}=${HTTP_OK}
Sridevi Rameshed94c692025-09-07 23:41:10 -05001105
Sweta Potthuri2edacd32025-07-02 01:04:43 -05001106 # Description of argument(s):
1107 # ipv6_gw_addr IPv6 Static Default Gateway address to be configured.
1108 # prefix_len_def Prefix length value (Range 1 to 128).
1109 # valid_status_codes Expected return code from patch operation
1110 # (e.g. "200", "204".)
1111
1112 # Prefix Length is passed as None.
1113 IF '${prefix_length_def}' == '${None}'
1114 ${ipv6_gw}= Create Dictionary Address=${ipv6_gw_addr}
1115 ELSE
1116 ${ipv6_gw}= Create Dictionary Address=${ipv6_gw_addr} Prefix Length=${prefix_length_def}
1117 END
1118
1119 ${ipv6_static_def_gw}= Get IPv6 Static Default Gateway
1120
1121 ${num_entries}= Get Length ${ipv6_static_def_gw}
1122
1123 ${patch_list}= Create List
1124 ${empty_dict}= Create Dictionary
1125
1126 FOR ${INDEX} IN RANGE 0 ${num_entries}
1127 Append To List ${patch_list} ${empty_dict}
1128 END
1129
1130 ${valid_status_codes}= Set Variable If '${valid_status_codes}' == '${HTTP_OK}'
1131 ... ${HTTP_OK},${HTTP_NO_CONTENT}
1132 ... ${valid_status_codes}
1133
1134 Append To List ${patch_list} ${ipv6_gw}
1135 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
1136
1137 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1138 ... body=${data} valid_status_codes=[${valid_status_codes}]
1139
1140 # Verify the added static default gateway is present in Redfish Get Output.
1141 ${ipv6_staticdef_gateway}= Get IPv6 Static Default Gateway
1142
1143 ${ipv6_static_def_gw_list}= Create List
1144 FOR ${ipv6_staticdef_gateway} IN @{ipv6_staticdef_gateway}
1145 ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address
1146 Append To List ${ipv6_static_def_gw_list} ${value}
1147 END
1148
1149 IF '${valid_status_codes}' != '${HTTP_OK},${HTTP_NO_CONTENT}'
1150 Should Not Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr}
1151 ELSE
1152 Should Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr}
1153 END
1154
Sweta Potthuri2d085732025-07-16 09:10:08 -05001155
Anvesh-Kumar_Rayankula019d9362025-09-03 22:55:12 -05001156Modify IPv6 Static Default Gateway On BMC
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001157 [Documentation] Modify and verify IPv6 address of BMC.
1158 [Arguments] ${ipv6_gw_addr} ${new_static_def_gw} ${prefix_length}
1159 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED}]
Sweta Potthuri2edacd32025-07-02 01:04:43 -05001160
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001161 # Description of argument(s):
1162 # ipv6_gw_addr IPv6 static default gateway address to be replaced (e.g. "2001:AABB:CCDD::AAFF").
1163 # new_static_def_gw New static default gateway address to be configured.
Sridevi Rameshed94c692025-09-07 23:41:10 -05001164 # prefix_length Prefix length value (Range 1 to 128).
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001165 # valid_status_codes Expected return code from patch operation
1166 # (e.g. "200", "204").
Sweta Potthuri2edacd32025-07-02 01:04:43 -05001167
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001168 ${empty_dict}= Create Dictionary
1169 ${patch_list}= Create List
1170 # Prefix Length is passed as None.
1171 IF '${prefix_length_def}' == '${None}'
1172 ${modified_ipv6_gw_addripv6_data}= Create Dictionary Address=${new_static_def_gw}
1173 ELSE
1174 ${modified_ipv6_gw_addripv6_data}= Create Dictionary Address=${new_static_def_gw} Prefix Length=${prefix_length_def}
1175 END
Sweta Potthuri2edacd32025-07-02 01:04:43 -05001176
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001177 @{ipv6_static_def_gw_list}= Get IPv6 Static Default Gateway
1178
1179 FOR ${ipv6_static_def_gw} IN @{ipv6_static_def_gw_list}
1180 IF '${ipv6_static_def_gw['Address']}' == '${ipv6_gw_addr}'
1181 Append To List ${patch_list} ${modified_ipv6_gw_addripv6_data}
1182 ELSE
1183 Append To List ${patch_list} ${empty_dict}
1184 END
1185 END
1186
1187 # Modify the IPv6 address only if given IPv6 static default gateway is found.
1188 ${ip_static_def_gw_found}= Run Keyword And Return Status List Should Contain Value
1189 ... ${patch_list} ${modified_ipv6_gw_addripv6_data} msg=${ipv6_gw_addr} does not exist on BMC
1190 Pass Execution If ${ip_static_def_gw_found} == ${False} ${ipv6_gw_addr} does not exist on BMC
1191
1192 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
1193
1194 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1195 ... body=&{data} valid_status_codes=${valid_status_codes}
1196
1197 ${ipv6_staticdef_gateway}= Get IPv6 Static Default Gateway
1198
1199 ${ipv6_static_def_gw_list}= Create List
1200 FOR ${ipv6_staticdef_gateway} IN @{ipv6_staticdef_gateway}
Sweta Potthuri2d085732025-07-16 09:10:08 -05001201 ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address
Sweta Potthuri4b0083f2025-07-09 11:34:40 -05001202 Append To List ${ipv6_static_def_gw_list} ${value}
1203 END
1204
1205 Should Contain ${ipv6_static_def_gw_list} ${new_static_def_gw}
1206 # Verify if old static default gateway address is erased.
1207 Should Not Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr}
1208
Sweta Potthuri2d085732025-07-16 09:10:08 -05001209
1210Delete IPv6 Static Default Gateway
1211 [Documentation] Delete IPv6 static default gateway on BMC.
1212 [Arguments] ${ipv6_gw_addr}
1213 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]
1214
1215 # Description of argument(s):
1216 # ipv6_gw_addr IPv6 Static Default Gateway address to be deleted.
1217 # valid_status_codes Expected return code from patch operation
1218 # (e.g. "200").
1219
1220 ${patch_list}= Create List
1221 ${empty_dict}= Create Dictionary
1222
1223 ${ipv6_static_def_gw_list}= Create List
1224 @{ipv6_static_defgw_configurations}= Get IPv6 Static Default Gateway
1225
1226 FOR ${ipv6_staticdef_gateway} IN @{ipv6_static_defgw_configurations}
1227 ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address
1228 Append To List ${ipv6_static_def_gw_list} ${value}
1229 END
1230
1231 ${defgw_found}= Run Keyword And Return Status List Should Contain Value
1232 ... ${ipv6_static_def_gw_list} ${ipv6_gw_addr} msg=${ipv6_gw_addr} does not exist on BMC
1233 Skip If ${defgw_found} == ${False} ${ipv6_gw_addr} does not exist on BMC
1234
1235 FOR ${ipv6_static_def_gw} IN @{ipv6_static_defgw_configurations}
1236 IF '${ipv6_static_def_gw['Address']}' == '${ipv6_gw_addr}'
1237 Append To List ${patch_list} ${null}
1238 ELSE
1239 Append To List ${patch_list} ${empty_dict}
1240 END
1241 END
1242
1243 # Run patch command only if given IP is found on BMC.
1244 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
1245
1246 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
1247 ... valid_status_codes=${valid_status_codes}
1248
1249 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list}
1250
1251 @{ipv6_static_defgw_configurations}= Get IPv6 Static Default Gateway
1252 Should Not Contain Match ${ipv6_static_defgw_configurations} ${ipv6_gw_addr}
1253 ... msg=IPv6 Static default gateway does not exist.
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001254
1255
1256Check Coexistence Of Linklocalv6 And Static IPv6
1257 [Documentation] Verify both linklocalv6 and static IPv6 exist.
1258
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001259 # Verify the address origin contains static and linklocal.
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001260 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001261
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001262 Should Match Regexp ${ipv6_linklocal_addr} ${linklocal_addr_format}
Sweta Potthuri35c503b2025-07-27 23:36:20 -05001263 Should Contain ${ipv6_addressorigin_list} Static
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -05001264
1265
abhijith-12197078c52025-09-25 01:13:00 -05001266Check Coexistence Of Static IPv6 And SLAAC
abhijith-1214dc01a02025-09-24 11:29:55 -05001267 [Documentation] Verify both static IPv6 and SLAAC coexist.
abhijith-12197078c52025-09-25 01:13:00 -05001268
1269 # Verify the address origin contains static and slaac.
1270 @{ipv6_addressorigin_list} ${ipv6_static_addr}=
1271 ... Get Address Origin List And Address For Type Static
1272
1273 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1274 ... Get Address Origin List And Address For Type SLAAC
1275
1276
abhijith-1214dc01a02025-09-24 11:29:55 -05001277Check Coexistence Of Link Local And SLAAC
1278 [Documentation] Verify both link local and SLAAC coexist.
1279
1280 # Verify the address origin contains SLAAC and link local.
1281 @{ipv6_addressorigin_list} ${ipv6_link_local_addr}=
1282 ... Get Address Origin List And Address For Type LinkLocal
1283
1284 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1285 ... Get Address Origin List And Address For Type SLAAC
1286
1287 Should Match Regexp ${ipv6_link_local_addr} ${linklocal_addr_format}
1288
1289
abhijith-1218ff5db42025-09-24 06:24:03 -05001290Check Coexistence Of Link Local And DHCPv6
1291 [Documentation] Verify both link local and dhcpv6 coexist.
1292
1293 # Verify the address origin contains dhcpv6 and link local.
1294 @{ipv6_address_origin_list} ${ipv6_link_local_addr}=
1295 ... Get Address Origin List And Address For Type LinkLocal
1296
1297 @{ipv6_address_origin_list} ${ipv6_dhcpv6_addr}=
1298 ... Get Address Origin List And Address For Type DHCPv6
1299
1300 Should Match Regexp ${ipv6_link_local_addr} ${linklocal_addr_format}
1301
1302
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -05001303Check If Linklocal Address Is In Correct Format
1304 [Documentation] Linklocal address has network part fe80 and host part EUI64.
1305
1306 # Fetch the linklocal address.
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001307 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal
Sweta Potthuri3c6f97d2025-08-06 00:30:19 -05001308
1309 # Follow EUI64 from MAC.
1310 ${system_mac}= Get BMC MAC Address
1311 ${split_octets}= Split String ${system_mac} :
1312 ${first_octet}= Evaluate int('${split_octets[0]}', 16)
1313 ${flipped_hex}= Evaluate format(${first_octet} ^ 2, '02x')
1314 ${grp1}= Evaluate re.sub(r'^0+', '', '${flipped_hex}${split_octets[1]}') modules=re
1315 ${grp2}= Evaluate re.sub(r'^0+', '', '${split_octets[2]}ff') modules=re
1316 ${grp3}= Evaluate re.sub(r'^0+', '', '${split_octets[4]}${split_octets[5]}') modules=re
1317 ${linklocal}= Set Variable fe80::${grp1}:${grp2}:fe${split_octets[3]}:${grp3}
1318
1319 # Verify the linklocal obtained is the same as on the machine.
1320 Should Be Equal ${linklocal} ${ipv6_linklocal_addr}
1321
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001322
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001323Check BMC Gets SLAAC Address
1324 [Documentation] Check BMC gets slaac address.
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001325
1326 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= Get Address Origin List And Address For Type SLAAC
1327
Sweta Potthuri71f7bdc2025-08-10 03:08:10 -05001328
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001329Get The Initial DHCPv6 Setting On Each Interface
1330 [Documentation] Get the initial DHCPv6 setting of each interface.
1331 [Arguments] ${channel_number}
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001332
1333 # Description of the argument(s):
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001334 # channel_number Channel number 1 or 2.
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001335
1336 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
1337 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1338 ${initial_dhcpv6_iface}= Get From Dictionary ${resp.dict} DHCPv6
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001339 IF ${channel_number}==${1}
1340 Set Test Variable ${dhcpv6_channel_1} ${initial_dhcpv6_iface['OperatingMode']}
1341 ELSE
1342 Set Test Variable ${dhcpv6_channel_2} ${initial_dhcpv6_iface['OperatingMode']}
1343 END
1344
1345
1346Get The Initial DHCPv6 Settings
1347 [Documentation] Get the initial DHCPv6 settings of both the interfaces.
1348
1349 Get The Initial DHCPv6 Setting On Each Interface ${1}
1350 Get The Initial DHCPv6 Setting On Each Interface ${2}
1351
1352
1353Get The Initial SLAAC Settings
1354 [Documentation] Get the initial SLAAC settings of both the interfaces.
1355
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001356 Get The Initial SLAAC Setting On Each Interface ${1}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001357 Get The Initial SLAAC Setting On Each Interface ${2}
1358
1359
1360Get The Initial SLAAC Setting On Each Interface
1361 [Documentation] Get the initial SLAAC setting of the interface.
1362 [Arguments] ${channel_number}
1363
1364 # Description of the argument(s):
1365 # channel_number Channel number 1 or 2.
1366
1367 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
1368 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
1369 ${initial_slaac_iface}= Get From Dictionary ${resp.dict} StatelessAddressAutoConfig
1370 IF ${channel_number}==${1}
1371 Set Test Variable ${slaac_channel_1} ${initial_slaac_iface['IPv6AutoConfigEnabled']}
1372 ELSE
1373 Set Test Variable ${slaac_channel_2} ${initial_slaac_iface['IPv6AutoConfigEnabled']}
1374 END
Sweta Potthuridb4a6d62025-08-18 11:29:16 -05001375
1376
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001377Get Address Origin List And IPv4 or IPv6 Address
1378 [Documentation] Get address origin list and address for type.
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001379 [Arguments] ${ip_address_type} ${channel_number}=${CHANNEL_NUMBER}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001380
1381 # Description of the argument(s):
Sridevi Rameshed94c692025-09-07 23:41:10 -05001382 # ip_address_type Type of IPv4 or IPv6 address to be checked.
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001383 # channel_number Channel number 1(eth0) or 2(eth1).
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001384
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001385 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${channel_number}']['name']}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001386 @{ip_addresses}= Get From Dictionary ${resp.dict} ${ip_address_type}
1387
1388 ${ip_addressorigin_list}= Create List
1389 ${ip_addr_list}= Create List
1390 FOR ${ip_address} IN @{ip_addresses}
1391 ${ip_addressorigin}= Get From Dictionary ${ip_address} AddressOrigin
1392 Append To List ${ip_addressorigin_list} ${ip_addressorigin}
1393 Append To List ${ip_addr_list} ${ip_address['Address']}
1394 END
1395 RETURN ${ip_addressorigin_list} ${ip_addr_list}
1396
1397
1398Verify All The Addresses Are Intact
1399 [Documentation] Verify all the addresses and address origins remain intact.
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001400 [Arguments] ${channel_number}=${CHANNEL_NUMBER}
1401 ... ${initial_ipv4_addressorigin_list}=${initial_ipv4_addressorigin_list}
1402 ... ${initial_ipv4_addr_list}=${initial_ipv4_addr_list}
1403
1404 # Description of argument(s):
1405 # channel_number Channel number 1(eth0) or 2(eth1).
1406 # initial_ipv4_addressorigin_list Initial IPv4 address origin list.
1407 # initial_ipv4_addr_list Initial IPv4 address list.
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001408
1409 # Verify that it will not impact the IPv4 configuration.
1410 Sleep ${NETWORK_TIMEOUT}
1411 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
1412
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001413 # IPv6 Linklocal address must be present.
1414 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}=
1415 ... Get Address Origin List And Address For Type LinkLocal ${channel_number}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001416
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001417 # IPv4 addresses must remain intact.
1418 ${ipv4_addressorigin_list} ${ipv4_addr_list}=
1419 ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${channel_number}
Sweta Potthuriabbbeae2025-08-21 00:06:26 -05001420
1421 Should be Equal ${initial_ipv4_addressorigin_list} ${ipv4_addressorigin_list}
1422 Should be Equal ${initial_ipv4_addr_list} ${ipv4_addr_list}
Sweta Potthurif3d188f2025-09-08 07:17:31 -05001423
1424
1425Get Interface ID Of IPv6
1426 [Documentation] Get interface id of IPv6 address.
1427 [Arguments] ${ipv6_address}
1428
1429 # Description of the argument(s):
1430 # ${ipv6_address} IPv6 Address to extract the last 4 hextets.
1431
1432 # Last 64 bits of SLAAC and Linklocal must be the same.
1433 # Sample IPv6 network configurations.
1434 #"IPv6AddressPolicyTable": [],
1435 # "IPv6Addresses": [
1436 # {
1437 # "Address": "fe80::xxxx:xxxx:xxxx:xxxx",
1438 # "AddressOrigin": "LinkLocal",
1439 # "AddressState": null,
1440 # "PrefixLength": xx
1441 # }
1442 # ],
1443 # {
1444 # "Address": "2002:xxxx:xxxx:xxxx:xxxx",
1445 # "AddressOrigin": "SLAAC",
1446 # "PrefixLength": 64
1447 # }
1448 # ],
1449
1450 ${split_ip_address}= Split String ${ipv6_address} :
1451 ${missing_ip}= Evaluate 8 - len(${split_ip_address}) + 1
1452 ${expanded_ip}= Create List
1453
1454 FOR ${hextet} IN @{split_ip_address}
1455 IF '${hextet}' == ''
1456 FOR ${i} IN RANGE ${missing_ip}
1457 Append To List ${expanded_ip} 0000
1458 END
1459 ELSE
1460 Append To List ${expanded_ip} ${hextet}
1461 END
1462 END
1463 ${interface_id}= Evaluate ':'.join(${expanded_ip}[-4:])
1464 RETURN ${interface_id}
Sweta Potthuri6370afd2025-10-08 00:07:46 -05001465
1466
1467Set And Verify SLAAC Property On Both Interfaces
1468 [Documentation] Set and verify SLAAC property on both interfaces.
1469 [Arguments] ${slaac_value_1} ${slaac_value_2}
1470
1471 # Description of the argument(s):
1472 # slaac_value_1 SLAAC value for channel 1.
1473 # slaac_value_2 SLAAC value for channel 2.
1474
1475 Set SLAAC Configuration State And Verify ${slaac_value_1} [${HTTP_OK}] ${1}
1476 Set SLAAC Configuration State And Verify ${slaac_value_2} [${HTTP_OK}] ${2}
1477
1478 Sleep 30s
1479
1480 # Check SLAAC Settings for eth0.
1481 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1482 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${1}
1483 IF "${slaac_value_1}" == "${True}"
1484 Should Not Be Empty ${ipv6_slaac_addr} SLAAC
1485 ELSE
1486 Should Not Contain ${ipv6_addressorigin_list} SLAAC
1487 END
1488
1489 # Check SLAAC Settings for eth1.
1490 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}=
1491 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${2}
1492 IF "${slaac_value_2}" == "${True}"
1493 Should Not Be Empty ${ipv6_slaac_addr} SLAAC
1494 ELSE
1495 Should Not Contain ${ipv6_addressorigin_list} SLAAC
1496 END
1497
1498 Verify All The Addresses Are Intact ${1}
1499 Verify All The Addresses Are Intact ${2}
1500 ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}
1501
Sweta Potthuri425713a2025-10-16 00:28:20 -05001502
1503Set And Verify DHCPv6 Property On Both Interfaces
1504 [Documentation] Set and verify DHCPv6 property on both interfaces.
1505 [Arguments] ${dhcpv6_value_1} ${dhcpv6_value_2}
1506
1507 # Description of the argument(s):
1508 # dhcpv6_value_1 DHCPv6 value for channel 1.
1509 # dhcpv6_value_2 DHCPv6 value for channel 2.
1510
1511 Set And Verify DHCPv6 Property ${dhcpv6_value_1} ${1}
1512 Set And Verify DHCPv6 Property ${dhcpv6_value_2} ${2}
1513
1514 Verify All The Addresses Are Intact ${1}
1515 Verify All The Addresses Are Intact ${2}
1516 ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}
abhijith-121d8322b72025-10-13 02:23:48 -05001517
1518
1519Verify IPv6 Addresses Coexist
1520 [Documentation] Verify IPv6 address type coexist.
1521 [Arguments] ${ipv6_address_type1} ${ipv6_address_type2}
1522
1523 # Description of the argument(s):
1524 # ipv6_address_type1 IPv6 address type.
1525 # ipv6_address_type2 IPv6 address type.
1526 # Valid IPv6 address type (Static, DHCPv6, SLAAC).
1527
1528 IF '${ipv6_address_type1}' == 'Static' and '${ipv6_address_type2}' == 'DHCPv6'
1529 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
1530 Set And Verify DHCPv6 Property Enabled
1531 ELSE IF '${ipv6_address_type1}' == 'DHCPv6' and '${ipv6_address_type2}' == 'SLAAC'
1532 Set And Verify DHCPv6 Property Enabled
1533 Set SLAAC Configuration State And Verify ${True}
1534 ELSE IF '${ipv6_address_type1}' == 'SLAAC' and '${ipv6_address_type2}' == 'Static'
1535 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
1536 Set SLAAC Configuration State And Verify ${True}
1537 ELSE IF '${ipv6_address_type1}' == 'Static' and '${ipv6_address_type2}' == 'Static'
1538 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length}
1539 Configure IPv6 Address On BMC ${test_ipv6_addr1} ${test_prefix_length}
1540 END
1541
1542 Sleep ${NETWORK_TIMEOUT}s
1543
1544 # Verify coexistence.
1545 Verify The Coexistence Of The Address Type ${ipv6_address_type1} ${ipv6_address_type2}
1546
1547 IF '${ipv6_address_type1}' == 'Static' or '${ipv6_address_type2}' == 'Static'
1548 Delete IPv6 Address ${test_ipv6_addr}
1549 END
1550 IF '${ipv6_address_type1}' == 'Static' and '${ipv6_address_type2}' == 'Static'
1551 Delete IPv6 Address ${test_ipv6_addr1}
1552 END
1553
1554 Set And Verify DHCPv6 Property Disabled
1555 Set SLAAC Configuration State And Verify ${False}