Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Network interface IPv6 configuration and verification |
| 3 | ... tests. |
| 4 | |
| 5 | Resource ../../lib/bmc_redfish_resource.robot |
| 6 | Resource ../../lib/openbmc_ffdc.robot |
| 7 | Resource ../../lib/bmc_ipv6_utils.robot |
Sweta Potthuri | 8ba7432 | 2025-03-19 12:29:06 -0500 | [diff] [blame] | 8 | Resource ../../lib/external_intf/vmi_utils.robot |
Sweta Potthuri | 2f3fbb5 | 2025-09-19 00:50:47 -0500 | [diff] [blame] | 9 | Resource ../../lib/bmc_network_utils.robot |
Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 10 | Library ../../lib/bmc_network_utils.py |
| 11 | Library Collections |
Sweta Potthuri | 35c503b | 2025-07-27 23:36:20 -0500 | [diff] [blame] | 12 | Library Process |
Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 13 | |
Anvesh-Kumar_Rayankula | 019d936 | 2025-09-03 22:55:12 -0500 | [diff] [blame] | 14 | Test Setup Test Setup Execution |
| 15 | Test Teardown Test Teardown Execution |
| 16 | Suite Setup Suite Setup Execution |
| 17 | Suite Teardown Redfish.Logout |
Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 18 | |
Matt Fischer | 6fb70d9 | 2023-10-24 19:06:33 -0600 | [diff] [blame] | 19 | Test Tags BMC_IPv6 |
Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 20 | |
| 21 | *** Variables *** |
Sweta Potthuri | 2edacd3 | 2025-07-02 01:04:43 -0500 | [diff] [blame] | 22 | ${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 |
kvishal | 9c6774c | 2025-09-10 02:14:07 -0500 | [diff] [blame] | 25 | ${invalid_hexadec_ipv6} x:x:x:x:x:x:10.5.5.6 |
| 26 | ${ipv6_multi_short} 2001::33::111 |
George Keishing | e16f158 | 2022-12-15 07:32:21 -0600 | [diff] [blame] | 27 | # Valid prefix length is a integer ranges from 1 to 128. |
Sweta Potthuri | 2edacd3 | 2025-07-02 01:04:43 -0500 | [diff] [blame] | 28 | ${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 Potthuri | 35c503b | 2025-07-27 23:36:20 -0500 | [diff] [blame] | 32 | ${linklocal_addr_format} fe80::[0-9a-f:]+$ |
Sweta Potthuri | 2f3fbb5 | 2025-09-19 00:50:47 -0500 | [diff] [blame] | 33 | ${new_mac_addr} AA:E2:84:14:28:79 |
Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 34 | |
| 35 | *** Test Cases *** |
| 36 | |
| 37 | Get IPv6 Address And Verify |
| 38 | [Documentation] Get IPv6 Address And Verify. |
| 39 | [Tags] Get_IPv6_Address_And_Verify |
| 40 | |
| 41 | FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} |
| 42 | Verify IPv6 On BMC ${ipv6_network_configuration['Address']} |
| 43 | END |
| 44 | |
| 45 | |
Prashanth Katti | 2c73abc | 2021-03-17 07:42:25 -0500 | [diff] [blame] | 46 | Get PrefixLength And Verify |
| 47 | [Documentation] Get IPv6 prefix length and verify. |
| 48 | [Tags] Get_PrefixLength_And_Verify |
| 49 | |
| 50 | FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} |
| 51 | Verify IPv6 On BMC ${ipv6_network_configuration['PrefixLength']} |
| 52 | END |
| 53 | |
| 54 | |
| 55 | Get IPv6 Default Gateway And Verify |
George Keishing | 9614383 | 2021-03-23 07:55:08 -0500 | [diff] [blame] | 56 | [Documentation] Get IPv6 default gateway and verify. |
George Keishing | ade6ab4 | 2022-07-19 11:41:03 -0500 | [diff] [blame] | 57 | [Tags] Get_IPv6_Default_Gateway_And_Verify |
Prashanth Katti | 2c73abc | 2021-03-17 07:42:25 -0500 | [diff] [blame] | 58 | |
| 59 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 60 | ${ipv6_gateway}= Get From Dictionary ${resp.dict} IPv6DefaultGateway |
| 61 | Verify IPv6 Default Gateway On BMC ${ipv6_gateway} |
| 62 | |
| 63 | |
Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 64 | Verify All Configured IPv6 And PrefixLength On BMC |
| 65 | [Documentation] Verify IPv6 address and its prefix length on BMC. |
| 66 | [Tags] Verify_All_Configured_IPv6_And_PrefixLength_On_BMC |
| 67 | |
| 68 | FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} |
George Keishing | f02ca2b | 2023-04-05 22:11:03 +0530 | [diff] [blame] | 69 | Verify IPv6 And PrefixLength ${ipv6_network_configuration['Address']} |
Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 70 | ... ${ipv6_network_configuration['PrefixLength']} |
| 71 | END |
| 72 | |
| 73 | |
| 74 | Configure IPv6 Address And Verify |
| 75 | [Documentation] Configure IPv6 address and verify. |
| 76 | [Tags] Configure_IPv6_Address_And_Verify |
Anvesh-Kumar_Rayankula | 3a26c66 | 2025-04-16 01:19:26 -0500 | [diff] [blame] | 77 | [Teardown] Run Keywords |
| 78 | ... Delete IPv6 Address ${test_ipv6_addr} AND Test Teardown Execution |
Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 79 | [Template] Configure IPv6 Address On BMC |
| 80 | |
| 81 | |
| 82 | # IPv6 address Prefix length |
| 83 | ${test_ipv6_addr} ${test_prefix_length} |
| 84 | |
| 85 | |
Prashanth Katti | 12ed4b7 | 2023-05-16 05:24:00 -0500 | [diff] [blame] | 86 | Delete IPv6 Address And Verify |
| 87 | [Documentation] Delete IPv6 address and verify. |
| 88 | [Tags] Delete_IPv6_Address_And_Verify |
| 89 | |
| 90 | Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} |
| 91 | |
| 92 | Delete IPv6 Address ${test_ipv6_addr} |
| 93 | |
| 94 | |
George Keishing | cc28831 | 2024-10-22 10:13:12 +0530 | [diff] [blame] | 95 | Modify IPv6 Address And Verify |
Prashanth Katti | 5f7d2e4 | 2023-05-22 03:17:25 -0500 | [diff] [blame] | 96 | [Documentation] Modify IPv6 address and verify. |
| 97 | [Tags] Modify_IPv6_Address_And_Verify |
kvishal | 88de8c4 | 2025-03-04 01:45:10 -0600 | [diff] [blame] | 98 | [Teardown] Run Keywords |
George Keishing | cfdd099 | 2025-03-17 11:59:20 +0530 | [diff] [blame] | 99 | ... Delete IPv6 Address ${test_ipv6_addr1} AND Test Teardown Execution |
Prashanth Katti | 5f7d2e4 | 2023-05-22 03:17:25 -0500 | [diff] [blame] | 100 | |
| 101 | Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} |
| 102 | |
| 103 | Modify IPv6 Address ${test_ipv6_addr} ${test_ipv6_addr1} ${test_prefix_length} |
| 104 | |
| 105 | |
Sweta Potthuri | afe858e | 2025-02-25 23:52:51 -0600 | [diff] [blame] | 106 | Verify Persistency Of IPv6 After BMC Reboot |
| 107 | [Documentation] Verify persistency of IPv6 after BMC reboot. |
| 108 | [Tags] Verify_Persistency_Of_IPv6_After_BMC_Reboot |
| 109 | [Teardown] Run Keywords |
| 110 | ... Delete IPv6 Address ${test_ipv6_addr} AND Test Teardown Execution |
| 111 | |
| 112 | Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} |
| 113 | |
| 114 | Redfish OBMC Reboot (off) stack_mode=skip |
| 115 | |
| 116 | # Verifying persistency of IPv6. |
| 117 | Verify IPv6 On BMC ${test_ipv6_addr} |
| 118 | |
| 119 | |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 120 | Enable SLAAC On BMC And Verify |
| 121 | [Documentation] Enable SLAAC on BMC and verify. |
| 122 | [Tags] Enable_SLAAC_On_BMC_And_Verify |
Sweta Potthuri | 8ba7432 | 2025-03-19 12:29:06 -0500 | [diff] [blame] | 123 | |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 124 | Set SLAAC Configuration State And Verify ${True} |
Sweta Potthuri | 8ba7432 | 2025-03-19 12:29:06 -0500 | [diff] [blame] | 125 | |
| 126 | |
Sweta Potthuri | 0df4a86 | 2025-03-24 12:05:09 -0500 | [diff] [blame] | 127 | Enable DHCPv6 Property On BMC And Verify |
| 128 | [Documentation] Enable DHCPv6 property on BMC and verify. |
| 129 | [Tags] Enable_DHCPv6_Property_On_BMC_And_Verify |
| 130 | |
Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 131 | Set And Verify DHCPv6 Property Enabled |
Sweta Potthuri | 0df4a86 | 2025-03-24 12:05:09 -0500 | [diff] [blame] | 132 | |
Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 133 | |
kvishal | 0d199a9 | 2025-05-29 02:35:18 -0500 | [diff] [blame] | 134 | Disable DHCPv6 Property On BMC And Verify |
| 135 | [Documentation] Disable DHCPv6 property on BMC and verify. |
| 136 | [Tags] Disable_DHCPv6_Property_On_BMC_And_Verify |
| 137 | |
Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 138 | Set And Verify DHCPv6 Property Disabled |
kvishal | bd04bd6 | 2025-08-05 03:57:53 -0500 | [diff] [blame] | 139 | |
| 140 | |
| 141 | Verify Persistency Of DHCPv6 On Reboot |
| 142 | [Documentation] Verify persistency of DHCPv6 property on reboot. |
| 143 | [Tags] Verify_Persistency_Of_DHCPv6_On_Reboot |
| 144 | |
Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 145 | Set And Verify DHCPv6 Property Enabled |
| 146 | Redfish OBMC Reboot (off) stack_mode=skip |
| 147 | Verify DHCPv6 Property Enabled |
Sweta Potthuri | 0df4a86 | 2025-03-24 12:05:09 -0500 | [diff] [blame] | 148 | |
Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 149 | |
Sweta Potthuri | cb61ff0 | 2025-04-09 05:16:09 -0500 | [diff] [blame] | 150 | Configure Invalid Static IPv6 And Verify |
| 151 | [Documentation] Configure invalid static IPv6 and verify. |
| 152 | [Tags] Configure_Invalid_Static_IPv6_And_Verify |
| 153 | [Template] Configure IPv6 Address On BMC |
| 154 | |
kvishal | 9c6774c | 2025-09-10 02:14:07 -0500 | [diff] [blame] | 155 | #invalid_ipv6 prefix length valid_status_code |
| 156 | ${ipv4_hexword_addr} ${test_prefix_length} ${HTTP_BAD_REQUEST} |
| 157 | ${invalid_hexadec_ipv6} ${test_prefix_length} ${HTTP_BAD_REQUEST} |
| 158 | ${ipv6_multi_short} ${test_prefix_length} ${HTTP_BAD_REQUEST} |
| 159 | |
Sweta Potthuri | cb61ff0 | 2025-04-09 05:16:09 -0500 | [diff] [blame] | 160 | |
Sweta Potthuri | 565318d | 2025-06-09 06:13:46 -0500 | [diff] [blame] | 161 | |
Sweta Potthuri | 2edacd3 | 2025-07-02 01:04:43 -0500 | [diff] [blame] | 162 | Configure IPv6 Static Default Gateway And Verify |
| 163 | [Documentation] Configure IPv6 static default gateway and verify. |
| 164 | [Tags] Configure_IPv6_Static_Default_Gateway_And_Verify |
| 165 | [Template] Configure IPv6 Static Default Gateway On BMC |
Sweta Potthuri | 565318d | 2025-06-09 06:13:46 -0500 | [diff] [blame] | 166 | |
Sweta Potthuri | 2edacd3 | 2025-07-02 01:04:43 -0500 | [diff] [blame] | 167 | # static_def_gw prefix length valid_status_code |
| 168 | ${ipv6_gw_addr} ${prefix_length_def} ${HTTP_OK} |
| 169 | ${invalid_staticv6_gateway} ${test_prefix_length} ${HTTP_BAD_REQUEST} |
Sweta Potthuri | 565318d | 2025-06-09 06:13:46 -0500 | [diff] [blame] | 170 | |
Sweta Potthuri | cb61ff0 | 2025-04-09 05:16:09 -0500 | [diff] [blame] | 171 | |
Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 172 | Modify Static Default Gateway And Verify |
| 173 | [Documentation] Modify static default gateway and verify. |
| 174 | [Tags] Modify_Static_Default_Gateway_And_Verify |
| 175 | [Setup] Configure IPv6 Static Default Gateway On BMC ${ipv6_gw_addr} ${prefix_length_def} |
| 176 | |
| 177 | Modify IPv6 Static Default Gateway On BMC ${test_ipv6_addr1} ${prefix_length_def} ${HTTP_OK} ${ipv6_gw_addr} |
| 178 | |
| 179 | |
Sweta Potthuri | 2d08573 | 2025-07-16 09:10:08 -0500 | [diff] [blame] | 180 | Delete IPv6 Static Default Gateway And Verify |
| 181 | [Documentation] Delete IPv6 static default gateway and verify. |
| 182 | [Tags] Delete_IPv6_Static_Default_Gateway_And_Verify |
| 183 | [Setup] Configure IPv6 Static Default Gateway On BMC ${ipv6_gw_addr} ${prefix_length_def} |
| 184 | |
| 185 | Delete IPv6 Static Default Gateway ${ipv6_gw_addr} |
| 186 | |
| 187 | |
Sweta Potthuri | 35c503b | 2025-07-27 23:36:20 -0500 | [diff] [blame] | 188 | Verify Coexistence Of Linklocalv6 And Static IPv6 On BMC |
| 189 | [Documentation] Verify linklocalv6 And static IPv6 both exist. |
| 190 | [Tags] Verify_Coexistence_Of_Linklocalv6_And_Static_IPv6_On_BMC |
Anvesh-Kumar_Rayankula | 019d936 | 2025-09-03 22:55:12 -0500 | [diff] [blame] | 191 | [Setup] Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} |
| 192 | [Teardown] Delete IPv6 Address ${test_ipv6_addr} |
Sweta Potthuri | 35c503b | 2025-07-27 23:36:20 -0500 | [diff] [blame] | 193 | |
| 194 | Check Coexistence Of Linklocalv6 And Static IPv6 |
| 195 | |
| 196 | |
George Keishing | badb4c6 | 2025-09-18 16:14:12 +0530 | [diff] [blame] | 197 | Verify IPv6 Linklocal Address Is In Correct Format |
| 198 | [Documentation] Verify linklocal address has network part as fe80 and |
| 199 | ... host part as EUI64. |
Sweta Potthuri | 3c6f97d | 2025-08-06 00:30:19 -0500 | [diff] [blame] | 200 | [Tags] Verify_IPv6_Linklocal_Address_Is_In_Correct_Format |
| 201 | |
| 202 | Check If Linklocal Address Is In Correct Format |
| 203 | |
| 204 | |
Sweta Potthuri | 71f7bdc | 2025-08-10 03:08:10 -0500 | [diff] [blame] | 205 | Verify BMC Gets SLAAC Address On Enabling SLAAC |
| 206 | [Documentation] On enabling SLAAC verify SLAAC address comes up. |
| 207 | [Tags] Verify_BMC_Gets_SLAAC_Address_On_Enabling_SLAAC |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 208 | [Setup] Set SLAAC Configuration State And Verify ${False} |
Sweta Potthuri | 71f7bdc | 2025-08-10 03:08:10 -0500 | [diff] [blame] | 209 | |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 210 | Set SLAAC Configuration State And Verify ${True} |
Sweta Potthuri | 71f7bdc | 2025-08-10 03:08:10 -0500 | [diff] [blame] | 211 | Sleep ${NETWORK_TIMEOUT} |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 212 | Check BMC Gets SLAAC Address |
Sweta Potthuri | 71f7bdc | 2025-08-10 03:08:10 -0500 | [diff] [blame] | 213 | |
| 214 | |
Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 215 | Enable And Verify DHCPv6 Property On Eth1 When DHCPv6 Property Enabled On Eth0 |
| 216 | [Documentation] Verify DHCPv6 on eth1 when DHCPv6 property is enabled on eth0. |
| 217 | [Tags] Enable_And_Verify_DHCPv6_Property_On_Eth1_When_DHCPv6_Property_Enabled_On_Eth0 |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 218 | [Setup] Get The Initial DHCPv6 Settings |
Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 219 | [Teardown] Run Keywords Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1} |
| 220 | ... AND Set And Verify DHCPv6 Property ${dhcpv6_channel_2} ${2} |
| 221 | |
| 222 | Set And Verify DHCPv6 Property Enabled ${1} |
| 223 | Set And Verify DHCPv6 Property Enabled ${2} |
| 224 | |
| 225 | |
Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 226 | Verify Enable And Disable SLAAC On Both Interfaces |
| 227 | [Documentation] Verify enable and disable SLAAC on both the interfaces. |
| 228 | [Tags] Verify_Enable_And_Disable_SLAAC_On_Both_Interfaces |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 229 | [Setup] Get The Initial SLAAC Settings |
Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 230 | [Template] Set And Verify SLAAC Property On Both Interfaces |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 231 | [Teardown] Run Keywords Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1} |
| 232 | ... AND Set SLAAC Configuration State And Verify ${slaac_channel_2} [${HTTP_OK}] ${2} |
| 233 | |
Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 234 | # slaac_eth0 slaac_eth1 |
| 235 | ${True} ${True} |
| 236 | ${True} ${False} |
| 237 | ${False} ${True} |
| 238 | ${False} ${False} |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 239 | |
| 240 | |
abhijith-121 | 3a64590 | 2025-09-08 01:12:34 -0500 | [diff] [blame] | 241 | Verify Autoconfig Is Present On Ethernet Interface |
| 242 | [Documentation] Verify autoconfig is present on ethernet interface. |
| 243 | [Tags] Verify_Autoconfig_Is_Present_On_Ethernet_Interface |
| 244 | |
| 245 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 246 | Should Contain ${resp.dict} StatelessAddressAutoConfig |
| 247 | |
| 248 | |
Sweta Potthuri | f3d188f | 2025-09-08 07:17:31 -0500 | [diff] [blame] | 249 | Verify Interface ID Of SLAAC And LinkLocal Addresses Are Same |
| 250 | [Documentation] Validate interface id of SLAAC and link-local addresses are same. |
| 251 | [Tags] Verify_Interface_ID_Of_SLAAC_And_LinkLocal_Addresses_Are_Same |
| 252 | |
| 253 | @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal |
| 254 | @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= Get Address Origin List And Address For Type SLAAC |
| 255 | |
| 256 | ${linklocal_interface_id}= Get Interface ID Of IPv6 ${ipv6_linklocal_addr} |
| 257 | ${slaac_interface_id}= Get Interface ID Of IPv6 ${ipv6_slaac_addr} |
| 258 | |
| 259 | Should Be Equal ${linklocal_interface_id} ${slaac_interface_id} |
| 260 | |
| 261 | |
abhijith-121 | c3e96d7 | 2025-09-09 11:35:09 -0500 | [diff] [blame] | 262 | Verify Persistency Of Link Local IPv6 On BMC Reboot |
| 263 | [Documentation] Verify persistency of link local on BMC reboot. |
| 264 | [Tags] Verify_Persistency_Of_Link_Local_IPv6_On_BMC_Reboot |
| 265 | |
| 266 | # Capturing the linklocal before reboot. |
| 267 | @{ipv6_address_origin_list} ${linklocal_addr_before_reboot}= |
| 268 | ... Get Address Origin List And Address For Type LinkLocal |
| 269 | |
| 270 | # Rebooting BMC. |
| 271 | Redfish OBMC Reboot (off) stack_mode=skip |
| 272 | |
| 273 | @{ipv6_address_origin_list} ${linklocal_addr_after_reboot}= |
| 274 | ... Get Address Origin List And Address For Type LinkLocal |
| 275 | |
| 276 | # Verifying the linklocal must be the same before and after reboot. |
| 277 | Should Be Equal ${linklocal_addr_before_reboot} ${linklocal_addr_after_reboot} |
| 278 | ... msg=IPv6 Linklocal address has changed after reboot. |
| 279 | |
| 280 | |
Sweta Potthuri | 2f3fbb5 | 2025-09-19 00:50:47 -0500 | [diff] [blame] | 281 | Modify MAC and Verify BMC Reinitializing Linklocal |
| 282 | [Documentation] Modify MAC and verify BMC reinitializing linklocal. |
| 283 | [Tags] Modify_MAC_and_Verify_BMC_Reinitializing_Linklocal |
| 284 | [Teardown] Configure MAC Settings ${original_address} |
| 285 | |
| 286 | ${original_address}= Get BMC MAC Address |
| 287 | @{ipv6_addressorigin_list} ${ipv6_before_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal |
| 288 | |
| 289 | # Modify MAC Address Of Ethernet Interface. |
| 290 | Configure MAC Settings ${new_mac_addr} |
| 291 | Sleep 30s |
| 292 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 293 | @{ipv6_addressorigin_list} ${ipv6_linklocal_after_addr}= Get Address Origin List And Address For Type LinkLocal |
| 294 | |
| 295 | # Verify whether the linklocal has changed and is in the the correct format. |
| 296 | Check If Linklocal Address Is In Correct Format |
| 297 | Should Not Be Equal ${ipv6_before_linklocal_addr} ${ipv6_linklocal_after_addr} |
| 298 | |
| 299 | |
abhijith-121 | bfbd03a | 2025-09-15 01:40:35 -0500 | [diff] [blame] | 300 | Add Multiple IPv6 Address And Verify |
| 301 | [Documentation] Add multiple IPv6 address and verify. |
| 302 | [Tags] Add_Multiple_IPv6_Address_And_Verify |
| 303 | [Teardown] Run Keywords |
| 304 | ... Delete IPv6 Address ${test_ipv6_addr} AND Delete IPv6 Address ${test_ipv6_addr1} |
| 305 | ... AND Test Teardown Execution |
| 306 | |
| 307 | Configure Multiple IPv6 Address on BMC ${test_prefix_length} |
| 308 | |
| 309 | |
abhijith-121 | 97078c5 | 2025-09-25 01:13:00 -0500 | [diff] [blame] | 310 | Verify Coexistence Of Static IPv6 And SLAAC On BMC |
abhijith-121 | 4dc01a0 | 2025-09-24 11:29:55 -0500 | [diff] [blame] | 311 | [Documentation] Verify static IPv6 And SLAAC both coexist. |
abhijith-121 | 97078c5 | 2025-09-25 01:13:00 -0500 | [diff] [blame] | 312 | [Tags] Verify_Coexistence_Of_Static_IPv6_And_SLAAC_On_BMC |
| 313 | [Setup] Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} |
| 314 | Set SLAAC Configuration State And Verify ${True} |
| 315 | [Teardown] Delete IPv6 Address ${test_ipv6_addr} |
| 316 | |
| 317 | Sleep ${NETWORK_TIMEOUT}s |
| 318 | |
| 319 | Check Coexistence Of Static IPv6 And SLAAC |
| 320 | |
| 321 | |
abhijith-121 | 8ff5db4 | 2025-09-24 06:24:03 -0500 | [diff] [blame] | 322 | Verify Coexistence Of Link Local And DHCPv6 On BMC |
| 323 | [Documentation] Verify link local And dhcpv6 both coexist. |
| 324 | [Tags] Verify_Coexistence_Of_Link_Local_And_DHCPv6_On_BMC |
| 325 | [Setup] Set DHCPv6 Property Enabled ${2} |
| 326 | |
| 327 | Sleep ${NETWORK_TIMEOUT}s |
| 328 | |
| 329 | Check Coexistence Of Link Local And DHCPv6 |
| 330 | |
| 331 | |
abhijith-121 | 4dc01a0 | 2025-09-24 11:29:55 -0500 | [diff] [blame] | 332 | Verify Coexistence Of Link Local And SLAAC On BMC |
| 333 | [Documentation] Verify link local And SLAAC both coexist. |
| 334 | [Tags] Verify_Coexistence_Of_Link_Local_And_SLAAC_On_BMC |
| 335 | [Setup] Set SLAAC Configuration State And Verify ${True} |
| 336 | |
| 337 | Sleep ${NETWORK_TIMEOUT}s |
| 338 | |
| 339 | Check Coexistence Of Link Local And SLAAC |
| 340 | |
| 341 | |
abhijith-121 | ffea191 | 2025-10-06 02:39:22 -0500 | [diff] [blame] | 342 | Verify Coexistence Of All IPv6 Type Addresses On BMC |
| 343 | [Documentation] Verify coexistence of link local, static, DHCPv6 and SLAAC ipv6 addresses. |
| 344 | [Tags] Verify_Coexistence_Of_All_IPv6_Type_Addresses_On_BMC |
| 345 | [Setup] Run Keywords Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} |
| 346 | ... AND Get The Initial DHCPv6 Setting On Each Interface ${1} |
| 347 | ... AND Set And Verify DHCPv6 Property Enabled |
| 348 | ... AND Get The Initial SLAAC Setting On Each Interface ${1} |
| 349 | ... AND Set SLAAC Configuration State And Verify ${True} |
| 350 | [Teardown] Run Keywords Delete IPv6 Address ${test_ipv6_addr} |
| 351 | ... AND Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1} |
| 352 | ... AND Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1} |
| 353 | |
| 354 | Sleep ${NETWORK_TIMEOUT}s |
| 355 | |
| 356 | # Verify link local, static, DHCPv6 and SLAAC ipv6 addresses coexist. |
| 357 | Verify The Coexistence Of The Address Type LinkLocal Static DHCPv6 SLAAC |
| 358 | |
| 359 | |
Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 360 | *** Keywords *** |
| 361 | |
Prashanth Katti | 3270fd0 | 2021-06-11 08:02:22 -0500 | [diff] [blame] | 362 | Suite Setup Execution |
| 363 | [Documentation] Do suite setup execution. |
| 364 | |
Anvesh-Kumar_Rayankula | 019d936 | 2025-09-03 22:55:12 -0500 | [diff] [blame] | 365 | Redfish.Login |
Prashanth Katti | 3270fd0 | 2021-06-11 08:02:22 -0500 | [diff] [blame] | 366 | ${active_channel_config}= Get Active Channel Config |
Sweta Potthuri | 3c6f97d | 2025-08-06 00:30:19 -0500 | [diff] [blame] | 367 | Set Suite Variable ${active_channel_config} |
| 368 | |
Prashanth Katti | 3270fd0 | 2021-06-11 08:02:22 -0500 | [diff] [blame] | 369 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 370 | |
| 371 | Set Suite variable ${ethernet_interface} |
| 372 | |
Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 373 | # Get initial IPv4 and IPv6 addresses and address origins for eth0. |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 374 | ${initial_ipv4_addressorigin_list} ${initial_ipv4_addr_list}= Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses |
| 375 | ${initial_ipv6_addressorigin_list} ${initial_ipv6_addr_list}= Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses |
| 376 | |
| 377 | Set Suite Variable ${initial_ipv4_addressorigin_list} |
| 378 | Set Suite Variable ${initial_ipv4_addr_list} |
| 379 | Set Suite Variable ${initial_ipv6_addressorigin_list} |
| 380 | Set Suite Variable ${initial_ipv6_addr_list} |
| 381 | |
Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 382 | # Get initial IPv4 and IPv6 addresses and address origins for eth1. |
| 383 | ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}= |
| 384 | ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${2} |
| 385 | ${eth1_initial_ipv6_addressorigin_list} ${eth1_initial_ipv6_addr_list}= |
| 386 | ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${2} |
| 387 | Set Suite Variable ${eth1_initial_ipv4_addressorigin_list} |
| 388 | Set Suite Variable ${eth1_initial_ipv4_addr_list} |
| 389 | Set Suite Variable ${eth1_initial_ipv6_addressorigin_list} |
| 390 | Set Suite Variable ${eth1_initial_ipv6_addr_list} |
| 391 | |
Prashanth Katti | 3270fd0 | 2021-06-11 08:02:22 -0500 | [diff] [blame] | 392 | |
Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 393 | Test Setup Execution |
| 394 | [Documentation] Test setup execution. |
| 395 | |
Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 396 | @{ipv6_network_configurations}= Get IPv6 Network Configuration |
| 397 | Set Test Variable @{ipv6_network_configurations} |
| 398 | |
| 399 | # Get BMC IPv6 address and prefix length. |
| 400 | ${ipv6_data}= Get BMC IPv6 Info |
| 401 | Set Test Variable ${ipv6_data} |
| 402 | |
| 403 | |
| 404 | Test Teardown Execution |
| 405 | [Documentation] Test teardown execution. |
| 406 | |
| 407 | FFDC On Test Case Fail |
Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 408 | |
| 409 | |
| 410 | Get IPv6 Network Configuration |
| 411 | [Documentation] Get Ipv6 network configuration. |
| 412 | # Sample output: |
| 413 | # { |
ganesanb | 4d43028 | 2023-04-27 14:33:23 +0000 | [diff] [blame] | 414 | # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0", |
Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 415 | # "@odata.type": "#EthernetInterface.v1_4_1.EthernetInterface", |
| 416 | # "DHCPv4": { |
| 417 | # "DHCPEnabled": false, |
| 418 | # "UseDNSServers": false, |
| 419 | # "UseDomainName": true, |
| 420 | # "UseNTPServers": false |
| 421 | # }, |
| 422 | # "DHCPv6": { |
| 423 | # "OperatingMode": "Disabled", |
| 424 | # "UseDNSServers": false, |
| 425 | # "UseDomainName": true, |
| 426 | # "UseNTPServers": false |
| 427 | # }, |
| 428 | # "Description": "Management Network Interface", |
| 429 | # "FQDN": "localhost", |
| 430 | # "HostName": "localhost", |
| 431 | # "IPv4Addresses": [ |
| 432 | # { |
| 433 | # "Address": "xx.xx.xx.xx", |
| 434 | # "AddressOrigin": "Static", |
| 435 | # "Gateway": "xx.xx.xx.1", |
| 436 | # "SubnetMask": "xx.xx.xx.0" |
| 437 | # }, |
| 438 | # { |
| 439 | # "Address": "169.254.xx.xx", |
| 440 | # "AddressOrigin": "IPv4LinkLocal", |
| 441 | # "Gateway": "0.0.0.0", |
| 442 | # "SubnetMask": "xx.xx.0.0" |
| 443 | # }, |
| 444 | # ], |
| 445 | # "IPv4StaticAddresses": [ |
| 446 | # { |
| 447 | # "Address": "xx.xx.xx.xx", |
| 448 | # "AddressOrigin": "Static", |
| 449 | # "Gateway": "xx.xx.xx.1", |
| 450 | # "SubnetMask": "xx.xx.0.0" |
| 451 | # } |
| 452 | # } |
| 453 | # ], |
| 454 | # "IPv6AddressPolicyTable": [], |
| 455 | # "IPv6Addresses": [ |
| 456 | # { |
| 457 | # "Address": "fe80::xxxx:xxxx:xxxx:xxxx", |
| 458 | # "AddressOrigin": "LinkLocal", |
| 459 | # "AddressState": null, |
| 460 | # "PrefixLength": xx |
| 461 | # } |
| 462 | # ], |
| 463 | # "IPv6DefaultGateway": "", |
| 464 | # "IPv6StaticAddresses": [ |
| 465 | # { "Address": "xxxx:xxxx:xxxx:xxxx::xxxx", |
| 466 | # "AddressOrigin": "Static", |
| 467 | # "AddressState": null, |
| 468 | # "PrefixLength": xxx |
| 469 | # } |
| 470 | # ], |
| 471 | # "Id": "eth0", |
| 472 | # "InterfaceEnabled": true, |
| 473 | # "LinkStatus": "LinkUp", |
| 474 | # "MACAddress": "xx:xx:xx:xx:xx:xx", |
| 475 | # "Name": "Manager Ethernet Interface", |
| 476 | # "NameServers": [], |
| 477 | # "SpeedMbps": 0, |
| 478 | # "StaticNameServers": [], |
| 479 | # "Status": { |
| 480 | # "Health": "OK", |
| 481 | # "HealthRollup": "OK", |
| 482 | # "State": "Enabled" |
| 483 | # }, |
| 484 | # "VLANs": { |
ganesanb | 4d43028 | 2023-04-27 14:33:23 +0000 | [diff] [blame] | 485 | # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0/VLANs" |
Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 486 | |
| 487 | |
| 488 | ${active_channel_config}= Get Active Channel Config |
| 489 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 490 | |
| 491 | @{ipv6_network_configurations}= Get From Dictionary ${resp.dict} IPv6StaticAddresses |
George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 492 | RETURN @{ipv6_network_configurations} |
Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 493 | |
| 494 | |
| 495 | Verify IPv6 And PrefixLength |
| 496 | [Documentation] Verify IPv6 address and prefix length on BMC. |
| 497 | [Arguments] ${ipv6_addr} ${prefix_len} |
| 498 | |
| 499 | # Description of the argument(s): |
| 500 | # ipv6_addr IPv6 address to be verified. |
| 501 | # prefix_len PrefixLength value to be verified. |
| 502 | |
| 503 | # Catenate IPv6 address and its prefix length. |
| 504 | ${ipv6_with_prefix}= Catenate ${ipv6_addr}/${prefix_len} |
| 505 | |
| 506 | # Get IPv6 address details on BMC using IP command. |
| 507 | @{ip_data}= Get BMC IPv6 Info |
| 508 | |
| 509 | # Verify if IPv6 and prefix length is configured on BMC. |
| 510 | |
| 511 | Should Contain ${ip_data} ${ipv6_with_prefix} |
| 512 | ... msg=IPv6 and prefix length pair does not exist. |
| 513 | |
| 514 | |
| 515 | Configure IPv6 Address On BMC |
| 516 | [Documentation] Add IPv6 Address on BMC. |
| 517 | [Arguments] ${ipv6_addr} ${prefix_len} ${valid_status_codes}=${HTTP_OK} |
| 518 | |
| 519 | # Description of argument(s): |
| 520 | # ipv6_addr IPv6 address to be added (e.g. "2001:EEEE:2222::2022"). |
| 521 | # prefix_len Prefix length for the IPv6 to be added |
| 522 | # (e.g. "64"). |
| 523 | # valid_status_codes Expected return code from patch operation |
| 524 | # (e.g. "200"). |
| 525 | |
Prashanth Katti | 12ed4b7 | 2023-05-16 05:24:00 -0500 | [diff] [blame] | 526 | ${prefix_length}= Convert To Integer ${prefix_len} |
Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 527 | ${empty_dict}= Create Dictionary |
| 528 | ${ipv6_data}= Create Dictionary Address=${ipv6_addr} |
Prashanth Katti | 12ed4b7 | 2023-05-16 05:24:00 -0500 | [diff] [blame] | 529 | ... PrefixLength=${prefix_length} |
Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 530 | |
| 531 | ${patch_list}= Create List |
| 532 | |
| 533 | # Get existing static IPv6 configurations on BMC. |
| 534 | ${ipv6_network_configurations}= Get IPv6 Network Configuration |
| 535 | ${num_entries}= Get Length ${ipv6_network_configurations} |
| 536 | |
| 537 | FOR ${INDEX} IN RANGE 0 ${num_entries} |
| 538 | Append To List ${patch_list} ${empty_dict} |
| 539 | END |
| 540 | |
George Keishing | e6e161e | 2025-05-08 10:18:30 +0530 | [diff] [blame] | 541 | ${valid_status_codes}= Set Variable If '${valid_status_codes}' == '${HTTP_OK}' |
| 542 | ... ${HTTP_OK},${HTTP_NO_CONTENT} |
| 543 | ... ${valid_status_codes} |
Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 544 | |
| 545 | # We need not check for existence of IPv6 on BMC while adding. |
| 546 | Append To List ${patch_list} ${ipv6_data} |
| 547 | ${data}= Create Dictionary IPv6StaticAddresses=${patch_list} |
| 548 | |
| 549 | ${active_channel_config}= Get Active Channel Config |
| 550 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 551 | |
| 552 | Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data} |
| 553 | ... valid_status_codes=[${valid_status_codes}] |
| 554 | |
| 555 | Return From Keyword If '${valid_status_codes}' != '${HTTP_OK},${HTTP_NO_CONTENT}' |
| 556 | |
| 557 | # Note: Network restart takes around 15-18s after patch request processing. |
| 558 | Sleep ${NETWORK_TIMEOUT}s |
| 559 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 560 | |
| 561 | Verify IPv6 And PrefixLength ${ipv6_addr} ${prefix_len} |
| 562 | |
| 563 | # Verify if existing static IPv6 addresses still exist. |
| 564 | FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} |
| 565 | Verify IPv6 On BMC ${ipv6_network_configuration['Address']} |
| 566 | END |
| 567 | |
| 568 | Validate IPv6 Network Config On BMC |
| 569 | |
| 570 | |
abhijith-121 | bfbd03a | 2025-09-15 01:40:35 -0500 | [diff] [blame] | 571 | Configure Multiple IPv6 Address on BMC |
| 572 | [Documentation] Add multiple IPv6 address on BMC. |
| 573 | [Arguments] ${prefix_len} |
| 574 | ... ${valid_status_codes}=[${HTTP_OK},${HTTP_NO_CONTENT}] |
| 575 | |
| 576 | # Description of argument(s): |
| 577 | # prefix_len Prefix length for the IPv6 to be added |
| 578 | # (e.g. "64"). |
| 579 | # valid_status_codes Expected return code from patch operation |
| 580 | # (e.g. "200"). |
| 581 | |
| 582 | ${ipv6_list}= Create List ${test_ipv6_addr} ${test_ipv6_addr1} |
| 583 | ${prefix_length}= Convert To Integer ${prefix_len} |
| 584 | ${empty_dict}= Create Dictionary |
| 585 | ${patch_list}= Create List |
| 586 | |
| 587 | # Get existing static IPv6 configurations on BMC. |
| 588 | ${ipv6_network_configurations}= Get IPv6 Network Configuration |
| 589 | ${num_entries}= Get Length ${ipv6_network_configurations} |
| 590 | |
| 591 | FOR ${INDEX} IN RANGE 0 ${num_entries} |
| 592 | Append To List ${patch_list} ${empty_dict} |
| 593 | END |
| 594 | |
| 595 | # We need not check for existence of IPv6 on BMC while adding. |
| 596 | FOR ${ipv6_addr} IN @{ipv6_list} |
| 597 | ${ipv6_data}= Create Dictionary Address=${ipv6_addr} PrefixLength=${prefix_length} |
| 598 | Append To List ${patch_list} ${ipv6_data} |
| 599 | END |
| 600 | ${data}= Create Dictionary IPv6StaticAddresses=${patch_list} |
| 601 | |
| 602 | ${active_channel_config}= Get Active Channel Config |
| 603 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 604 | |
| 605 | Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data} |
| 606 | ... valid_status_codes=${valid_status_codes} |
| 607 | |
| 608 | IF ${valid_status_codes} != [${HTTP_OK}, ${HTTP_NO_CONTENT}] |
| 609 | Fail msg=Static address not added correctly |
| 610 | END |
| 611 | |
| 612 | # Note: Network restart takes around 15-18s after patch request processing. |
| 613 | Sleep ${NETWORK_TIMEOUT}s |
| 614 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 615 | |
| 616 | # Verify newly added ip address on CLI. |
| 617 | FOR ${ipv6_addr} IN @{ipv6_list} |
| 618 | Verify IPv6 And PrefixLength ${ipv6_addr} ${prefix_len} |
| 619 | END |
| 620 | |
| 621 | # Verify if existing static IPv6 addresses still exist. |
| 622 | FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} |
| 623 | Verify IPv6 On BMC ${ipv6_network_configuration['Address']} |
| 624 | END |
| 625 | |
| 626 | # Get the latest ipv6 network configurations. |
| 627 | @{ipv6_network_configurations}= Get IPv6 Network Configuration |
| 628 | |
| 629 | # Verify newly added ip address on BMC. |
| 630 | FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} |
| 631 | Should Contain Match ${ipv6_list} ${ipv6_network_configuration['Address']} |
| 632 | END |
| 633 | |
| 634 | Validate IPv6 Network Config On BMC |
| 635 | |
| 636 | |
Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 637 | Validate IPv6 Network Config On BMC |
| 638 | [Documentation] Check that IPv6 network info obtained via redfish matches info |
| 639 | ... obtained via CLI. |
Sridevi Ramesh | ed94c69 | 2025-09-07 23:41:10 -0500 | [diff] [blame] | 640 | |
Prashanth Katti | 5f7d2e4 | 2023-05-22 03:17:25 -0500 | [diff] [blame] | 641 | @{ipv6_network_configurations}= Get IPv6 Network Configuration |
Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 642 | ${ipv6_data}= Get BMC IPv6 Info |
| 643 | FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} |
| 644 | Should Contain Match ${ipv6_data} ${ipv6_network_configuration['Address']}/* |
| 645 | ... msg=IPv6 address does not exist. |
| 646 | END |
| 647 | |
Prashanth Katti | 12ed4b7 | 2023-05-16 05:24:00 -0500 | [diff] [blame] | 648 | |
| 649 | Delete IPv6 Address |
| 650 | [Documentation] Delete IPv6 address of BMC. |
Prashanth Katti | bcb9dab | 2025-04-01 12:58:37 -0500 | [diff] [blame] | 651 | [Arguments] ${ipv6_addr} |
| 652 | ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}] |
Prashanth Katti | 12ed4b7 | 2023-05-16 05:24:00 -0500 | [diff] [blame] | 653 | |
| 654 | # Description of argument(s): |
| 655 | # ipv6_addr IPv6 address to be deleted (e.g. "2001:1234:1234:1234::1234"). |
| 656 | # valid_status_codes Expected return code from patch operation |
| 657 | # (e.g. "200"). See prolog of rest_request |
| 658 | # method in redfish_plus.py for details. |
| 659 | |
| 660 | ${empty_dict}= Create Dictionary |
| 661 | ${patch_list}= Create List |
| 662 | |
| 663 | @{ipv6_network_configurations}= Get IPv6 Network Configuration |
| 664 | FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} |
| 665 | IF '${ipv6_network_configuration['Address']}' == '${ipv6_addr}' |
| 666 | Append To List ${patch_list} ${null} |
| 667 | ELSE |
| 668 | Append To List ${patch_list} ${empty_dict} |
| 669 | END |
| 670 | END |
| 671 | |
| 672 | ${ip_found}= Run Keyword And Return Status List Should Contain Value |
| 673 | ... ${patch_list} ${null} msg=${ipv6_addr} does not exist on BMC |
| 674 | Pass Execution If ${ip_found} == ${False} ${ipv6_addr} does not exist on BMC |
| 675 | |
| 676 | # Run patch command only if given IP is found on BMC |
| 677 | ${data}= Create Dictionary IPv6StaticAddresses=${patch_list} |
| 678 | |
| 679 | ${active_channel_config}= Get Active Channel Config |
| 680 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 681 | |
| 682 | Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data} |
Sweta Potthuri | a198161 | 2025-05-09 05:41:10 -0500 | [diff] [blame] | 683 | ... valid_status_codes=${valid_status_codes} |
Prashanth Katti | 12ed4b7 | 2023-05-16 05:24:00 -0500 | [diff] [blame] | 684 | |
| 685 | # Note: Network restart takes around 15-18s after patch request processing |
| 686 | Sleep ${NETWORK_TIMEOUT}s |
| 687 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 688 | |
| 689 | # IPv6 address that is deleted should not be there on BMC. |
| 690 | ${delete_status}= Run Keyword And Return Status Verify IPv6 On BMC ${ipv6_addr} |
Anvesh-Kumar_Rayankula | 3a26c66 | 2025-04-16 01:19:26 -0500 | [diff] [blame] | 691 | IF '${valid_status_codes}' == '[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]' |
Prashanth Katti | 12ed4b7 | 2023-05-16 05:24:00 -0500 | [diff] [blame] | 692 | Should Be True '${delete_status}' == '${False}' |
| 693 | ELSE |
| 694 | Should Be True '${delete_status}' == '${True}' |
| 695 | END |
| 696 | |
| 697 | Validate IPv6 Network Config On BMC |
Prashanth Katti | 5f7d2e4 | 2023-05-22 03:17:25 -0500 | [diff] [blame] | 698 | |
| 699 | |
| 700 | Modify IPv6 Address |
| 701 | [Documentation] Modify and verify IPv6 address of BMC. |
| 702 | [Arguments] ${ipv6} ${new_ipv6} ${prefix_len} |
| 703 | ... ${valid_status_codes}=[${HTTP_OK}, ${HTTP_NO_CONTENT}] |
| 704 | |
| 705 | # Description of argument(s): |
| 706 | # ipv6 IPv6 address to be replaced (e.g. "2001:AABB:CCDD::AAFF"). |
| 707 | # new_ipv6 New IPv6 address to be configured. |
| 708 | # prefix_len Prefix length value (Range 1 to 128). |
| 709 | # valid_status_codes Expected return code from patch operation |
| 710 | # (e.g. "200", "201"). |
| 711 | |
| 712 | ${empty_dict}= Create Dictionary |
| 713 | ${patch_list}= Create List |
| 714 | ${prefix_length}= Convert To Integer ${prefix_len} |
| 715 | ${ipv6_data}= Create Dictionary |
| 716 | ... Address=${new_ipv6} PrefixLength=${prefix_length} |
| 717 | |
| 718 | # Sample IPv6 network configurations: |
| 719 | # "IPv6AddressPolicyTable": [], |
| 720 | # "IPv6Addresses": [ |
| 721 | # { |
| 722 | # "Address": "X002:db8:0:2::XX0", |
| 723 | # "AddressOrigin": "DHCPv6", |
| 724 | # "PrefixLength": 128 |
| 725 | # }, |
| 726 | # { |
| 727 | # "Address": “X002:db8:0:2:a94:XXff:fe82:XXXX", |
| 728 | # "AddressOrigin": "SLAAC", |
| 729 | # "PrefixLength": 64 |
| 730 | # }, |
| 731 | # { |
| 732 | # "Address": “Y002:db8:0:2:a94:efff:fe82:5000", |
| 733 | # "AddressOrigin": "Static", |
| 734 | # "PrefixLength": 56 |
| 735 | # }, |
| 736 | # { |
| 737 | # "Address": “Z002:db8:0:2:a94:efff:fe82:5000", |
| 738 | # "AddressOrigin": "Static", |
| 739 | # "PrefixLength": 56 |
| 740 | # }, |
| 741 | # { |
| 742 | # "Address": “Xe80::a94:efff:YYYY:XXXX", |
| 743 | # "AddressOrigin": "LinkLocal", |
| 744 | # "PrefixLength": 64 |
| 745 | # }, |
| 746 | # { |
| 747 | # "Address": “X002:db8:1:2:eff:233:fee:546", |
| 748 | # "AddressOrigin": "Static", |
| 749 | # "PrefixLength": 56 |
| 750 | # } |
| 751 | # ], |
| 752 | # "IPv6DefaultGateway": “XXXX::ab2e:80fe:87df:XXXX”, |
| 753 | # "IPv6StaticAddresses": [ |
| 754 | # { |
| 755 | # "Address": “X002:db8:0:2:a94:efff:fe82:5000", |
| 756 | # "PrefixLength": 56 |
| 757 | # }, |
| 758 | # { |
| 759 | # "Address": “Y002:db8:0:2:a94:efff:fe82:5000", |
| 760 | # "PrefixLength": 56 |
| 761 | # }, |
| 762 | # { |
| 763 | # "Address": “Z002:db8:1:2:eff:233:fee:546", |
| 764 | # "PrefixLength": 56 |
| 765 | # } |
| 766 | # ], |
| 767 | # "IPv6StaticDefaultGateways": [], |
| 768 | |
| 769 | # Find the position of IPv6 address to be modified. |
| 770 | @{ipv6_network_configurations}= Get IPv6 Network Configuration |
| 771 | FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} |
George Keishing | e6e161e | 2025-05-08 10:18:30 +0530 | [diff] [blame] | 772 | IF '${ipv6_network_configuration['Address']}' == '${ipv6}' |
| 773 | Append To List ${patch_list} ${ipv6_data} |
| 774 | ELSE |
| 775 | Append To List ${patch_list} ${empty_dict} |
| 776 | END |
Prashanth Katti | 5f7d2e4 | 2023-05-22 03:17:25 -0500 | [diff] [blame] | 777 | END |
| 778 | |
| 779 | # Modify the IPv6 address only if given IPv6 is found |
| 780 | ${ip_found}= Run Keyword And Return Status List Should Contain Value |
| 781 | ... ${patch_list} ${ipv6_data} msg=${ipv6} does not exist on BMC |
| 782 | Pass Execution If ${ip_found} == ${False} ${ipv6} does not exist on BMC |
| 783 | |
| 784 | ${data}= Create Dictionary IPv6StaticAddresses=${patch_list} |
| 785 | |
| 786 | ${active_channel_config}= Get Active Channel Config |
| 787 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 788 | |
| 789 | Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 790 | ... body=&{data} valid_status_codes=${valid_status_codes} |
| 791 | |
| 792 | # Note: Network restart takes around 15-18s after patch request processing. |
| 793 | Sleep ${NETWORK_TIMEOUT}s |
| 794 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 795 | |
| 796 | # Verify if new IPv6 address is configured on BMC. |
| 797 | Verify IPv6 On BMC ${new_ipv6} |
| 798 | |
| 799 | # Verify if old IPv6 address is erased. |
| 800 | ${cmd_status}= Run Keyword And Return Status |
| 801 | ... Verify IPv6 On BMC ${ipv6} |
| 802 | Should Be Equal ${cmd_status} ${False} msg=Old IPv6 address is not deleted. |
| 803 | |
| 804 | Validate IPv6 Network Config On BMC |
Sweta Potthuri | 8ba7432 | 2025-03-19 12:29:06 -0500 | [diff] [blame] | 805 | |
| 806 | |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 807 | Set SLAAC Configuration State And Verify |
| 808 | [Documentation] Set SLAAC configuration state and verify. |
Sridevi Ramesh | ed94c69 | 2025-09-07 23:41:10 -0500 | [diff] [blame] | 809 | [Arguments] ${slaac_state} ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}] |
| 810 | ... ${channel_number}=${CHANNEL_NUMBER} |
Sweta Potthuri | 8ba7432 | 2025-03-19 12:29:06 -0500 | [diff] [blame] | 811 | |
| 812 | # Description of argument(s): |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 813 | # slaac_state SLAAC state('True' or 'False'). |
Sweta Potthuri | 8ba7432 | 2025-03-19 12:29:06 -0500 | [diff] [blame] | 814 | # valid_status_code Expected valid status codes. |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 815 | # channel_number Channel number 1(eth0) or 2(eth1). |
Sweta Potthuri | 8ba7432 | 2025-03-19 12:29:06 -0500 | [diff] [blame] | 816 | |
| 817 | ${active_channel_config}= Get Active Channel Config |
| 818 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 819 | |
| 820 | ${data}= Set Variable If ${slaac_state} == ${False} ${DISABLE_SLAAC} ${ENABLE_SLAAC} |
| 821 | ${resp}= Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
Sweta Potthuri | 610f86f | 2025-05-30 00:47:23 -0500 | [diff] [blame] | 822 | ... body=${data} valid_status_codes=${valid_status_codes} |
Sweta Potthuri | 8ba7432 | 2025-03-19 12:29:06 -0500 | [diff] [blame] | 823 | |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 824 | # Verify SLAAC is set correctly. |
Sweta Potthuri | 8ba7432 | 2025-03-19 12:29:06 -0500 | [diff] [blame] | 825 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 826 | ${slaac_verify}= Get From Dictionary ${resp.dict} StatelessAddressAutoConfig |
| 827 | |
George Keishing | e6e161e | 2025-05-08 10:18:30 +0530 | [diff] [blame] | 828 | IF '${slaac_verify['IPv6AutoConfigEnabled']}' != '${slaac_state}' |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 829 | Fail msg=SLAAC not set properly. |
George Keishing | e6e161e | 2025-05-08 10:18:30 +0530 | [diff] [blame] | 830 | END |
Sweta Potthuri | 0df4a86 | 2025-03-24 12:05:09 -0500 | [diff] [blame] | 831 | |
Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 832 | Set And Verify DHCPv6 Property |
| 833 | [Documentation] Set DHCPv6 property and verify. |
| 834 | [Arguments] ${dhcpv6_operating_mode}=${Disabled} ${channel_number}=${CHANNEL_NUMBER} |
Sweta Potthuri | 0df4a86 | 2025-03-24 12:05:09 -0500 | [diff] [blame] | 835 | |
| 836 | # Description of argument(s): |
| 837 | # dhcpv6_operating_mode Enabled if user wants to enable DHCPv6('Enabled' or 'Disabled'). |
Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 838 | # channel_number Channel number 1 or 2. |
| 839 | |
| 840 | Set DHCPv6 Property ${dhcpv6_operating_mode} ${channel_number} |
| 841 | Verify DHCPv6 Property ${dhcpv6_operating_mode} ${channel_number} |
| 842 | |
| 843 | |
| 844 | Set DHCPv6 Property |
| 845 | [Documentation] Set DHCPv6 attribute is enables or disabled. |
| 846 | [Arguments] ${dhcpv6_operating_mode}=${Disabled} ${channel_number}=${CHANNEL_NUMBER} |
| 847 | |
| 848 | # Description of argument(s): |
| 849 | # dhcpv6_operating_mode Enabled if user wants to enable DHCPv6('Enabled' or 'Disabled'). |
| 850 | # channel_number Channel number 1 or 2. |
Sweta Potthuri | 0df4a86 | 2025-03-24 12:05:09 -0500 | [diff] [blame] | 851 | |
| 852 | ${data}= Set Variable If '${dhcpv6_operating_mode}' == 'Disabled' ${DISABLE_DHCPv6} ${ENABLE_DHCPv6} |
Sweta Potthuri | 0df4a86 | 2025-03-24 12:05:09 -0500 | [diff] [blame] | 853 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 854 | |
| 855 | Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 856 | ... body=${data} valid_status_codes=[${HTTP_OK},${HTTP_NO_CONTENT}] |
| 857 | |
kvishal | bd04bd6 | 2025-08-05 03:57:53 -0500 | [diff] [blame] | 858 | |
| 859 | Verify DHCPv6 Property |
| 860 | [Documentation] Verify DHCPv6 settings is enabled or disabled. |
Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 861 | [Arguments] ${dhcpv6_operating_mode} ${channel_number}=${CHANNEL_NUMBER} |
kvishal | bd04bd6 | 2025-08-05 03:57:53 -0500 | [diff] [blame] | 862 | |
| 863 | # Description of Argument(s): |
| 864 | # dhcpv6_operating_mode Enable/ Disable DHCPv6. |
Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 865 | # channel_number Channel number 1 or 2. |
| 866 | |
| 867 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
kvishal | bd04bd6 | 2025-08-05 03:57:53 -0500 | [diff] [blame] | 868 | |
Sweta Potthuri | 0df4a86 | 2025-03-24 12:05:09 -0500 | [diff] [blame] | 869 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 870 | ${dhcpv6_verify}= Get From Dictionary ${resp.dict} DHCPv6 |
| 871 | |
| 872 | Should Be Equal '${dhcpv6_verify['OperatingMode']}' '${dhcpv6_operating_mode}' |
Sweta Potthuri | cb61ff0 | 2025-04-09 05:16:09 -0500 | [diff] [blame] | 873 | |
Sweta Potthuri | 2edacd3 | 2025-07-02 01:04:43 -0500 | [diff] [blame] | 874 | |
Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 875 | Get IPv6 Static Default Gateway |
| 876 | [Documentation] Get IPv6 static default gateway. |
| 877 | |
| 878 | ${active_channel_config}= Get Active Channel Config |
| 879 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 880 | |
| 881 | @{ipv6_static_defgw_configurations}= Get From Dictionary ${resp.dict} IPv6StaticDefaultGateways |
| 882 | RETURN @{ipv6_static_defgw_configurations} |
| 883 | |
Sweta Potthuri | 2d08573 | 2025-07-16 09:10:08 -0500 | [diff] [blame] | 884 | |
Sweta Potthuri | 2edacd3 | 2025-07-02 01:04:43 -0500 | [diff] [blame] | 885 | Configure IPv6 Static Default Gateway On BMC |
| 886 | [Documentation] Configure IPv6 static default gateway on BMC. |
| 887 | [Arguments] ${ipv6_gw_addr} ${prefix_length_def} |
| 888 | ... ${valid_status_codes}=${HTTP_OK} |
Sridevi Ramesh | ed94c69 | 2025-09-07 23:41:10 -0500 | [diff] [blame] | 889 | |
Sweta Potthuri | 2edacd3 | 2025-07-02 01:04:43 -0500 | [diff] [blame] | 890 | # Description of argument(s): |
| 891 | # ipv6_gw_addr IPv6 Static Default Gateway address to be configured. |
| 892 | # prefix_len_def Prefix length value (Range 1 to 128). |
| 893 | # valid_status_codes Expected return code from patch operation |
| 894 | # (e.g. "200", "204".) |
| 895 | |
| 896 | # Prefix Length is passed as None. |
| 897 | IF '${prefix_length_def}' == '${None}' |
| 898 | ${ipv6_gw}= Create Dictionary Address=${ipv6_gw_addr} |
| 899 | ELSE |
| 900 | ${ipv6_gw}= Create Dictionary Address=${ipv6_gw_addr} Prefix Length=${prefix_length_def} |
| 901 | END |
| 902 | |
| 903 | ${ipv6_static_def_gw}= Get IPv6 Static Default Gateway |
| 904 | |
| 905 | ${num_entries}= Get Length ${ipv6_static_def_gw} |
| 906 | |
| 907 | ${patch_list}= Create List |
| 908 | ${empty_dict}= Create Dictionary |
| 909 | |
| 910 | FOR ${INDEX} IN RANGE 0 ${num_entries} |
| 911 | Append To List ${patch_list} ${empty_dict} |
| 912 | END |
| 913 | |
| 914 | ${valid_status_codes}= Set Variable If '${valid_status_codes}' == '${HTTP_OK}' |
| 915 | ... ${HTTP_OK},${HTTP_NO_CONTENT} |
| 916 | ... ${valid_status_codes} |
| 917 | |
| 918 | Append To List ${patch_list} ${ipv6_gw} |
| 919 | ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list} |
| 920 | |
| 921 | Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 922 | ... body=${data} valid_status_codes=[${valid_status_codes}] |
| 923 | |
| 924 | # Verify the added static default gateway is present in Redfish Get Output. |
| 925 | ${ipv6_staticdef_gateway}= Get IPv6 Static Default Gateway |
| 926 | |
| 927 | ${ipv6_static_def_gw_list}= Create List |
| 928 | FOR ${ipv6_staticdef_gateway} IN @{ipv6_staticdef_gateway} |
| 929 | ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address |
| 930 | Append To List ${ipv6_static_def_gw_list} ${value} |
| 931 | END |
| 932 | |
| 933 | IF '${valid_status_codes}' != '${HTTP_OK},${HTTP_NO_CONTENT}' |
| 934 | Should Not Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr} |
| 935 | ELSE |
| 936 | Should Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr} |
| 937 | END |
| 938 | |
Sweta Potthuri | 2d08573 | 2025-07-16 09:10:08 -0500 | [diff] [blame] | 939 | |
Anvesh-Kumar_Rayankula | 019d936 | 2025-09-03 22:55:12 -0500 | [diff] [blame] | 940 | Modify IPv6 Static Default Gateway On BMC |
Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 941 | [Documentation] Modify and verify IPv6 address of BMC. |
| 942 | [Arguments] ${ipv6_gw_addr} ${new_static_def_gw} ${prefix_length} |
| 943 | ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED}] |
Sweta Potthuri | 2edacd3 | 2025-07-02 01:04:43 -0500 | [diff] [blame] | 944 | |
Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 945 | # Description of argument(s): |
| 946 | # ipv6_gw_addr IPv6 static default gateway address to be replaced (e.g. "2001:AABB:CCDD::AAFF"). |
| 947 | # new_static_def_gw New static default gateway address to be configured. |
Sridevi Ramesh | ed94c69 | 2025-09-07 23:41:10 -0500 | [diff] [blame] | 948 | # prefix_length Prefix length value (Range 1 to 128). |
Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 949 | # valid_status_codes Expected return code from patch operation |
| 950 | # (e.g. "200", "204"). |
Sweta Potthuri | 2edacd3 | 2025-07-02 01:04:43 -0500 | [diff] [blame] | 951 | |
Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 952 | ${empty_dict}= Create Dictionary |
| 953 | ${patch_list}= Create List |
| 954 | # Prefix Length is passed as None. |
| 955 | IF '${prefix_length_def}' == '${None}' |
| 956 | ${modified_ipv6_gw_addripv6_data}= Create Dictionary Address=${new_static_def_gw} |
| 957 | ELSE |
| 958 | ${modified_ipv6_gw_addripv6_data}= Create Dictionary Address=${new_static_def_gw} Prefix Length=${prefix_length_def} |
| 959 | END |
Sweta Potthuri | 2edacd3 | 2025-07-02 01:04:43 -0500 | [diff] [blame] | 960 | |
Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 961 | @{ipv6_static_def_gw_list}= Get IPv6 Static Default Gateway |
| 962 | |
| 963 | FOR ${ipv6_static_def_gw} IN @{ipv6_static_def_gw_list} |
| 964 | IF '${ipv6_static_def_gw['Address']}' == '${ipv6_gw_addr}' |
| 965 | Append To List ${patch_list} ${modified_ipv6_gw_addripv6_data} |
| 966 | ELSE |
| 967 | Append To List ${patch_list} ${empty_dict} |
| 968 | END |
| 969 | END |
| 970 | |
| 971 | # Modify the IPv6 address only if given IPv6 static default gateway is found. |
| 972 | ${ip_static_def_gw_found}= Run Keyword And Return Status List Should Contain Value |
| 973 | ... ${patch_list} ${modified_ipv6_gw_addripv6_data} msg=${ipv6_gw_addr} does not exist on BMC |
| 974 | Pass Execution If ${ip_static_def_gw_found} == ${False} ${ipv6_gw_addr} does not exist on BMC |
| 975 | |
| 976 | ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list} |
| 977 | |
| 978 | Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 979 | ... body=&{data} valid_status_codes=${valid_status_codes} |
| 980 | |
| 981 | ${ipv6_staticdef_gateway}= Get IPv6 Static Default Gateway |
| 982 | |
| 983 | ${ipv6_static_def_gw_list}= Create List |
| 984 | FOR ${ipv6_staticdef_gateway} IN @{ipv6_staticdef_gateway} |
Sweta Potthuri | 2d08573 | 2025-07-16 09:10:08 -0500 | [diff] [blame] | 985 | ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address |
Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 986 | Append To List ${ipv6_static_def_gw_list} ${value} |
| 987 | END |
| 988 | |
| 989 | Should Contain ${ipv6_static_def_gw_list} ${new_static_def_gw} |
| 990 | # Verify if old static default gateway address is erased. |
| 991 | Should Not Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr} |
| 992 | |
Sweta Potthuri | 2d08573 | 2025-07-16 09:10:08 -0500 | [diff] [blame] | 993 | |
| 994 | Delete IPv6 Static Default Gateway |
| 995 | [Documentation] Delete IPv6 static default gateway on BMC. |
| 996 | [Arguments] ${ipv6_gw_addr} |
| 997 | ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}] |
| 998 | |
| 999 | # Description of argument(s): |
| 1000 | # ipv6_gw_addr IPv6 Static Default Gateway address to be deleted. |
| 1001 | # valid_status_codes Expected return code from patch operation |
| 1002 | # (e.g. "200"). |
| 1003 | |
| 1004 | ${patch_list}= Create List |
| 1005 | ${empty_dict}= Create Dictionary |
| 1006 | |
| 1007 | ${ipv6_static_def_gw_list}= Create List |
| 1008 | @{ipv6_static_defgw_configurations}= Get IPv6 Static Default Gateway |
| 1009 | |
| 1010 | FOR ${ipv6_staticdef_gateway} IN @{ipv6_static_defgw_configurations} |
| 1011 | ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address |
| 1012 | Append To List ${ipv6_static_def_gw_list} ${value} |
| 1013 | END |
| 1014 | |
| 1015 | ${defgw_found}= Run Keyword And Return Status List Should Contain Value |
| 1016 | ... ${ipv6_static_def_gw_list} ${ipv6_gw_addr} msg=${ipv6_gw_addr} does not exist on BMC |
| 1017 | Skip If ${defgw_found} == ${False} ${ipv6_gw_addr} does not exist on BMC |
| 1018 | |
| 1019 | FOR ${ipv6_static_def_gw} IN @{ipv6_static_defgw_configurations} |
| 1020 | IF '${ipv6_static_def_gw['Address']}' == '${ipv6_gw_addr}' |
| 1021 | Append To List ${patch_list} ${null} |
| 1022 | ELSE |
| 1023 | Append To List ${patch_list} ${empty_dict} |
| 1024 | END |
| 1025 | END |
| 1026 | |
| 1027 | # Run patch command only if given IP is found on BMC. |
| 1028 | ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list} |
| 1029 | |
| 1030 | Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data} |
| 1031 | ... valid_status_codes=${valid_status_codes} |
| 1032 | |
| 1033 | ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list} |
| 1034 | |
| 1035 | @{ipv6_static_defgw_configurations}= Get IPv6 Static Default Gateway |
| 1036 | Should Not Contain Match ${ipv6_static_defgw_configurations} ${ipv6_gw_addr} |
| 1037 | ... msg=IPv6 Static default gateway does not exist. |
Sweta Potthuri | 35c503b | 2025-07-27 23:36:20 -0500 | [diff] [blame] | 1038 | |
| 1039 | |
| 1040 | Check Coexistence Of Linklocalv6 And Static IPv6 |
| 1041 | [Documentation] Verify both linklocalv6 and static IPv6 exist. |
| 1042 | |
Sweta Potthuri | 35c503b | 2025-07-27 23:36:20 -0500 | [diff] [blame] | 1043 | # Verify the address origin contains static and linklocal. |
Sweta Potthuri | 71f7bdc | 2025-08-10 03:08:10 -0500 | [diff] [blame] | 1044 | @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal |
Sweta Potthuri | 35c503b | 2025-07-27 23:36:20 -0500 | [diff] [blame] | 1045 | |
Sweta Potthuri | 35c503b | 2025-07-27 23:36:20 -0500 | [diff] [blame] | 1046 | Should Match Regexp ${ipv6_linklocal_addr} ${linklocal_addr_format} |
Sweta Potthuri | 35c503b | 2025-07-27 23:36:20 -0500 | [diff] [blame] | 1047 | Should Contain ${ipv6_addressorigin_list} Static |
Sweta Potthuri | 3c6f97d | 2025-08-06 00:30:19 -0500 | [diff] [blame] | 1048 | |
| 1049 | |
abhijith-121 | 97078c5 | 2025-09-25 01:13:00 -0500 | [diff] [blame] | 1050 | Check Coexistence Of Static IPv6 And SLAAC |
abhijith-121 | 4dc01a0 | 2025-09-24 11:29:55 -0500 | [diff] [blame] | 1051 | [Documentation] Verify both static IPv6 and SLAAC coexist. |
abhijith-121 | 97078c5 | 2025-09-25 01:13:00 -0500 | [diff] [blame] | 1052 | |
| 1053 | # Verify the address origin contains static and slaac. |
| 1054 | @{ipv6_addressorigin_list} ${ipv6_static_addr}= |
| 1055 | ... Get Address Origin List And Address For Type Static |
| 1056 | |
| 1057 | @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= |
| 1058 | ... Get Address Origin List And Address For Type SLAAC |
| 1059 | |
| 1060 | |
abhijith-121 | 4dc01a0 | 2025-09-24 11:29:55 -0500 | [diff] [blame] | 1061 | Check Coexistence Of Link Local And SLAAC |
| 1062 | [Documentation] Verify both link local and SLAAC coexist. |
| 1063 | |
| 1064 | # Verify the address origin contains SLAAC and link local. |
| 1065 | @{ipv6_addressorigin_list} ${ipv6_link_local_addr}= |
| 1066 | ... Get Address Origin List And Address For Type LinkLocal |
| 1067 | |
| 1068 | @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= |
| 1069 | ... Get Address Origin List And Address For Type SLAAC |
| 1070 | |
| 1071 | Should Match Regexp ${ipv6_link_local_addr} ${linklocal_addr_format} |
| 1072 | |
| 1073 | |
abhijith-121 | 8ff5db4 | 2025-09-24 06:24:03 -0500 | [diff] [blame] | 1074 | Check Coexistence Of Link Local And DHCPv6 |
| 1075 | [Documentation] Verify both link local and dhcpv6 coexist. |
| 1076 | |
| 1077 | # Verify the address origin contains dhcpv6 and link local. |
| 1078 | @{ipv6_address_origin_list} ${ipv6_link_local_addr}= |
| 1079 | ... Get Address Origin List And Address For Type LinkLocal |
| 1080 | |
| 1081 | @{ipv6_address_origin_list} ${ipv6_dhcpv6_addr}= |
| 1082 | ... Get Address Origin List And Address For Type DHCPv6 |
| 1083 | |
| 1084 | Should Match Regexp ${ipv6_link_local_addr} ${linklocal_addr_format} |
| 1085 | |
| 1086 | |
Sweta Potthuri | 3c6f97d | 2025-08-06 00:30:19 -0500 | [diff] [blame] | 1087 | Check If Linklocal Address Is In Correct Format |
| 1088 | [Documentation] Linklocal address has network part fe80 and host part EUI64. |
| 1089 | |
| 1090 | # Fetch the linklocal address. |
Sweta Potthuri | 71f7bdc | 2025-08-10 03:08:10 -0500 | [diff] [blame] | 1091 | @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal |
Sweta Potthuri | 3c6f97d | 2025-08-06 00:30:19 -0500 | [diff] [blame] | 1092 | |
| 1093 | # Follow EUI64 from MAC. |
| 1094 | ${system_mac}= Get BMC MAC Address |
| 1095 | ${split_octets}= Split String ${system_mac} : |
| 1096 | ${first_octet}= Evaluate int('${split_octets[0]}', 16) |
| 1097 | ${flipped_hex}= Evaluate format(${first_octet} ^ 2, '02x') |
| 1098 | ${grp1}= Evaluate re.sub(r'^0+', '', '${flipped_hex}${split_octets[1]}') modules=re |
| 1099 | ${grp2}= Evaluate re.sub(r'^0+', '', '${split_octets[2]}ff') modules=re |
| 1100 | ${grp3}= Evaluate re.sub(r'^0+', '', '${split_octets[4]}${split_octets[5]}') modules=re |
| 1101 | ${linklocal}= Set Variable fe80::${grp1}:${grp2}:fe${split_octets[3]}:${grp3} |
| 1102 | |
| 1103 | # Verify the linklocal obtained is the same as on the machine. |
| 1104 | Should Be Equal ${linklocal} ${ipv6_linklocal_addr} |
| 1105 | |
Sweta Potthuri | 71f7bdc | 2025-08-10 03:08:10 -0500 | [diff] [blame] | 1106 | |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1107 | Check BMC Gets SLAAC Address |
| 1108 | [Documentation] Check BMC gets slaac address. |
Sweta Potthuri | 71f7bdc | 2025-08-10 03:08:10 -0500 | [diff] [blame] | 1109 | |
| 1110 | @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= Get Address Origin List And Address For Type SLAAC |
| 1111 | |
Sweta Potthuri | 71f7bdc | 2025-08-10 03:08:10 -0500 | [diff] [blame] | 1112 | |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1113 | Get The Initial DHCPv6 Setting On Each Interface |
| 1114 | [Documentation] Get the initial DHCPv6 setting of each interface. |
| 1115 | [Arguments] ${channel_number} |
Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 1116 | |
| 1117 | # Description of the argument(s): |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1118 | # channel_number Channel number 1 or 2. |
Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 1119 | |
| 1120 | ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']} |
| 1121 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 1122 | ${initial_dhcpv6_iface}= Get From Dictionary ${resp.dict} DHCPv6 |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1123 | IF ${channel_number}==${1} |
| 1124 | Set Test Variable ${dhcpv6_channel_1} ${initial_dhcpv6_iface['OperatingMode']} |
| 1125 | ELSE |
| 1126 | Set Test Variable ${dhcpv6_channel_2} ${initial_dhcpv6_iface['OperatingMode']} |
| 1127 | END |
| 1128 | |
| 1129 | |
| 1130 | Get The Initial DHCPv6 Settings |
| 1131 | [Documentation] Get the initial DHCPv6 settings of both the interfaces. |
| 1132 | |
| 1133 | Get The Initial DHCPv6 Setting On Each Interface ${1} |
| 1134 | Get The Initial DHCPv6 Setting On Each Interface ${2} |
| 1135 | |
| 1136 | |
| 1137 | Get The Initial SLAAC Settings |
| 1138 | [Documentation] Get the initial SLAAC settings of both the interfaces. |
| 1139 | |
Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 1140 | Get The Initial SLAAC Setting On Each Interface ${1} |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1141 | Get The Initial SLAAC Setting On Each Interface ${2} |
| 1142 | |
| 1143 | |
| 1144 | Get The Initial SLAAC Setting On Each Interface |
| 1145 | [Documentation] Get the initial SLAAC setting of the interface. |
| 1146 | [Arguments] ${channel_number} |
| 1147 | |
| 1148 | # Description of the argument(s): |
| 1149 | # channel_number Channel number 1 or 2. |
| 1150 | |
| 1151 | ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']} |
| 1152 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 1153 | ${initial_slaac_iface}= Get From Dictionary ${resp.dict} StatelessAddressAutoConfig |
| 1154 | IF ${channel_number}==${1} |
| 1155 | Set Test Variable ${slaac_channel_1} ${initial_slaac_iface['IPv6AutoConfigEnabled']} |
| 1156 | ELSE |
| 1157 | Set Test Variable ${slaac_channel_2} ${initial_slaac_iface['IPv6AutoConfigEnabled']} |
| 1158 | END |
Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 1159 | |
| 1160 | |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1161 | Get Address Origin List And IPv4 or IPv6 Address |
| 1162 | [Documentation] Get address origin list and address for type. |
Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 1163 | [Arguments] ${ip_address_type} ${channel_number}=${CHANNEL_NUMBER} |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1164 | |
| 1165 | # Description of the argument(s): |
Sridevi Ramesh | ed94c69 | 2025-09-07 23:41:10 -0500 | [diff] [blame] | 1166 | # ip_address_type Type of IPv4 or IPv6 address to be checked. |
Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 1167 | # channel_number Channel number 1(eth0) or 2(eth1). |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1168 | |
Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 1169 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${channel_number}']['name']} |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1170 | @{ip_addresses}= Get From Dictionary ${resp.dict} ${ip_address_type} |
| 1171 | |
| 1172 | ${ip_addressorigin_list}= Create List |
| 1173 | ${ip_addr_list}= Create List |
| 1174 | FOR ${ip_address} IN @{ip_addresses} |
| 1175 | ${ip_addressorigin}= Get From Dictionary ${ip_address} AddressOrigin |
| 1176 | Append To List ${ip_addressorigin_list} ${ip_addressorigin} |
| 1177 | Append To List ${ip_addr_list} ${ip_address['Address']} |
| 1178 | END |
| 1179 | RETURN ${ip_addressorigin_list} ${ip_addr_list} |
| 1180 | |
| 1181 | |
| 1182 | Verify All The Addresses Are Intact |
| 1183 | [Documentation] Verify all the addresses and address origins remain intact. |
Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 1184 | [Arguments] ${channel_number}=${CHANNEL_NUMBER} |
| 1185 | ... ${initial_ipv4_addressorigin_list}=${initial_ipv4_addressorigin_list} |
| 1186 | ... ${initial_ipv4_addr_list}=${initial_ipv4_addr_list} |
| 1187 | |
| 1188 | # Description of argument(s): |
| 1189 | # channel_number Channel number 1(eth0) or 2(eth1). |
| 1190 | # initial_ipv4_addressorigin_list Initial IPv4 address origin list. |
| 1191 | # initial_ipv4_addr_list Initial IPv4 address list. |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1192 | |
| 1193 | # Verify that it will not impact the IPv4 configuration. |
| 1194 | Sleep ${NETWORK_TIMEOUT} |
| 1195 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 1196 | |
Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 1197 | # IPv6 Linklocal address must be present. |
| 1198 | @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= |
| 1199 | ... Get Address Origin List And Address For Type LinkLocal ${channel_number} |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1200 | |
Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 1201 | # IPv4 addresses must remain intact. |
| 1202 | ${ipv4_addressorigin_list} ${ipv4_addr_list}= |
| 1203 | ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${channel_number} |
Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1204 | |
| 1205 | Should be Equal ${initial_ipv4_addressorigin_list} ${ipv4_addressorigin_list} |
| 1206 | Should be Equal ${initial_ipv4_addr_list} ${ipv4_addr_list} |
Sweta Potthuri | f3d188f | 2025-09-08 07:17:31 -0500 | [diff] [blame] | 1207 | |
| 1208 | |
| 1209 | Get Interface ID Of IPv6 |
| 1210 | [Documentation] Get interface id of IPv6 address. |
| 1211 | [Arguments] ${ipv6_address} |
| 1212 | |
| 1213 | # Description of the argument(s): |
| 1214 | # ${ipv6_address} IPv6 Address to extract the last 4 hextets. |
| 1215 | |
| 1216 | # Last 64 bits of SLAAC and Linklocal must be the same. |
| 1217 | # Sample IPv6 network configurations. |
| 1218 | #"IPv6AddressPolicyTable": [], |
| 1219 | # "IPv6Addresses": [ |
| 1220 | # { |
| 1221 | # "Address": "fe80::xxxx:xxxx:xxxx:xxxx", |
| 1222 | # "AddressOrigin": "LinkLocal", |
| 1223 | # "AddressState": null, |
| 1224 | # "PrefixLength": xx |
| 1225 | # } |
| 1226 | # ], |
| 1227 | # { |
| 1228 | # "Address": "2002:xxxx:xxxx:xxxx:xxxx", |
| 1229 | # "AddressOrigin": "SLAAC", |
| 1230 | # "PrefixLength": 64 |
| 1231 | # } |
| 1232 | # ], |
| 1233 | |
| 1234 | ${split_ip_address}= Split String ${ipv6_address} : |
| 1235 | ${missing_ip}= Evaluate 8 - len(${split_ip_address}) + 1 |
| 1236 | ${expanded_ip}= Create List |
| 1237 | |
| 1238 | FOR ${hextet} IN @{split_ip_address} |
| 1239 | IF '${hextet}' == '' |
| 1240 | FOR ${i} IN RANGE ${missing_ip} |
| 1241 | Append To List ${expanded_ip} 0000 |
| 1242 | END |
| 1243 | ELSE |
| 1244 | Append To List ${expanded_ip} ${hextet} |
| 1245 | END |
| 1246 | END |
| 1247 | ${interface_id}= Evaluate ':'.join(${expanded_ip}[-4:]) |
| 1248 | RETURN ${interface_id} |
Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 1249 | |
| 1250 | |
| 1251 | Set And Verify SLAAC Property On Both Interfaces |
| 1252 | [Documentation] Set and verify SLAAC property on both interfaces. |
| 1253 | [Arguments] ${slaac_value_1} ${slaac_value_2} |
| 1254 | |
| 1255 | # Description of the argument(s): |
| 1256 | # slaac_value_1 SLAAC value for channel 1. |
| 1257 | # slaac_value_2 SLAAC value for channel 2. |
| 1258 | |
| 1259 | Set SLAAC Configuration State And Verify ${slaac_value_1} [${HTTP_OK}] ${1} |
| 1260 | Set SLAAC Configuration State And Verify ${slaac_value_2} [${HTTP_OK}] ${2} |
| 1261 | |
| 1262 | Sleep 30s |
| 1263 | |
| 1264 | # Check SLAAC Settings for eth0. |
| 1265 | @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= |
| 1266 | ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${1} |
| 1267 | IF "${slaac_value_1}" == "${True}" |
| 1268 | Should Not Be Empty ${ipv6_slaac_addr} SLAAC |
| 1269 | ELSE |
| 1270 | Should Not Contain ${ipv6_addressorigin_list} SLAAC |
| 1271 | END |
| 1272 | |
| 1273 | # Check SLAAC Settings for eth1. |
| 1274 | @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= |
| 1275 | ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${2} |
| 1276 | IF "${slaac_value_2}" == "${True}" |
| 1277 | Should Not Be Empty ${ipv6_slaac_addr} SLAAC |
| 1278 | ELSE |
| 1279 | Should Not Contain ${ipv6_addressorigin_list} SLAAC |
| 1280 | END |
| 1281 | |
| 1282 | Verify All The Addresses Are Intact ${1} |
| 1283 | Verify All The Addresses Are Intact ${2} |
| 1284 | ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list} |
| 1285 | |