| 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 | 2f3fbb5 | 2025-09-19 00:50:47 -0500 | [diff] [blame] | 32 | ${new_mac_addr} AA:E2:84:14:28:79 |
| abhijith-121 | 9e190dd | 2025-10-15 03:35:06 -0500 | [diff] [blame] | 33 | ${linklocal_addr_format} fe80::[0-9a-f:]+$ |
| 34 | ${link_local_addr} fe80:: |
| 35 | ${link_local_prefix_len} 10 |
| abhijith-121 | b9fc274 | 2025-10-14 09:46:43 -0500 | [diff] [blame] | 36 | ${ipv6_leading_zero} 2001:0022:0033::0111 |
| abhijith-121 | 5f0aa20 | 2025-10-24 02:53:53 -0500 | [diff] [blame] | 37 | ${ipv6_firsthextet_zero} 2001:0022:1133::1111 |
| abhijith-121 | b9fc274 | 2025-10-14 09:46:43 -0500 | [diff] [blame] | 38 | ${ipv6_eliminate_zero} 2001:22:33::111 |
| abhijith-121 | 5f0aa20 | 2025-10-24 02:53:53 -0500 | [diff] [blame] | 39 | ${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 Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 42 | |
| 43 | *** Test Cases *** |
| 44 | |
| 45 | Get 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 Katti | 2c73abc | 2021-03-17 07:42:25 -0500 | [diff] [blame] | 54 | Get 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 | |
| 63 | Get IPv6 Default Gateway And Verify |
| George Keishing | 9614383 | 2021-03-23 07:55:08 -0500 | [diff] [blame] | 64 | [Documentation] Get IPv6 default gateway and verify. |
| George Keishing | ade6ab4 | 2022-07-19 11:41:03 -0500 | [diff] [blame] | 65 | [Tags] Get_IPv6_Default_Gateway_And_Verify |
| Prashanth Katti | 2c73abc | 2021-03-17 07:42:25 -0500 | [diff] [blame] | 66 | |
| 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 Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 72 | Verify 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 Keishing | f02ca2b | 2023-04-05 22:11:03 +0530 | [diff] [blame] | 77 | Verify IPv6 And PrefixLength ${ipv6_network_configuration['Address']} |
| Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 78 | ... ${ipv6_network_configuration['PrefixLength']} |
| 79 | END |
| 80 | |
| 81 | |
| 82 | Configure IPv6 Address And Verify |
| 83 | [Documentation] Configure IPv6 address and verify. |
| 84 | [Tags] Configure_IPv6_Address_And_Verify |
| Anvesh-Kumar_Rayankula | 3a26c66 | 2025-04-16 01:19:26 -0500 | [diff] [blame] | 85 | [Teardown] Run Keywords |
| 86 | ... Delete IPv6 Address ${test_ipv6_addr} AND Test Teardown Execution |
| Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 87 | [Template] Configure IPv6 Address On BMC |
| 88 | |
| 89 | |
| 90 | # IPv6 address Prefix length |
| 91 | ${test_ipv6_addr} ${test_prefix_length} |
| 92 | |
| 93 | |
| Sweta Potthuri | 3b2b9cd | 2025-10-22 06:41:54 -0500 | [diff] [blame] | 94 | Configure 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 Katti | 12ed4b7 | 2023-05-16 05:24:00 -0500 | [diff] [blame] | 122 | Delete 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 Keishing | cc28831 | 2024-10-22 10:13:12 +0530 | [diff] [blame] | 131 | Modify IPv6 Address And Verify |
| Prashanth Katti | 5f7d2e4 | 2023-05-22 03:17:25 -0500 | [diff] [blame] | 132 | [Documentation] Modify IPv6 address and verify. |
| 133 | [Tags] Modify_IPv6_Address_And_Verify |
| kvishal | 88de8c4 | 2025-03-04 01:45:10 -0600 | [diff] [blame] | 134 | [Teardown] Run Keywords |
| George Keishing | cfdd099 | 2025-03-17 11:59:20 +0530 | [diff] [blame] | 135 | ... Delete IPv6 Address ${test_ipv6_addr1} AND Test Teardown Execution |
| Prashanth Katti | 5f7d2e4 | 2023-05-22 03:17:25 -0500 | [diff] [blame] | 136 | |
| 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 Potthuri | afe858e | 2025-02-25 23:52:51 -0600 | [diff] [blame] | 142 | Verify 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 Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 156 | Enable SLAAC On BMC And Verify |
| 157 | [Documentation] Enable SLAAC on BMC and verify. |
| 158 | [Tags] Enable_SLAAC_On_BMC_And_Verify |
| Sweta Potthuri | 8ba7432 | 2025-03-19 12:29:06 -0500 | [diff] [blame] | 159 | |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 160 | Set SLAAC Configuration State And Verify ${True} |
| Sweta Potthuri | 8ba7432 | 2025-03-19 12:29:06 -0500 | [diff] [blame] | 161 | |
| 162 | |
| Sweta Potthuri | 0df4a86 | 2025-03-24 12:05:09 -0500 | [diff] [blame] | 163 | Enable 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 Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 167 | Set And Verify DHCPv6 Property Enabled |
| Sweta Potthuri | 0df4a86 | 2025-03-24 12:05:09 -0500 | [diff] [blame] | 168 | |
| Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 169 | |
| kvishal | 0d199a9 | 2025-05-29 02:35:18 -0500 | [diff] [blame] | 170 | Disable 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 Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 174 | Set And Verify DHCPv6 Property Disabled |
| kvishal | bd04bd6 | 2025-08-05 03:57:53 -0500 | [diff] [blame] | 175 | |
| 176 | |
| 177 | Verify Persistency Of DHCPv6 On Reboot |
| 178 | [Documentation] Verify persistency of DHCPv6 property on reboot. |
| 179 | [Tags] Verify_Persistency_Of_DHCPv6_On_Reboot |
| 180 | |
| Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 181 | Set And Verify DHCPv6 Property Enabled |
| 182 | Redfish OBMC Reboot (off) stack_mode=skip |
| 183 | Verify DHCPv6 Property Enabled |
| Sweta Potthuri | 0df4a86 | 2025-03-24 12:05:09 -0500 | [diff] [blame] | 184 | |
| Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 185 | |
| abhijith-121 | 59fed68 | 2025-10-31 00:36:15 -0500 | [diff] [blame] | 186 | Verify 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 Potthuri | e05a8dd | 2025-10-29 08:32:32 -0500 | [diff] [blame] | 201 | Verify 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 | |
| 210 | Verify 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 Potthuri | cb61ff0 | 2025-04-09 05:16:09 -0500 | [diff] [blame] | 219 | Configure 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 | |
| kvishal | 9c6774c | 2025-09-10 02:14:07 -0500 | [diff] [blame] | 224 | #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 Potthuri | cb61ff0 | 2025-04-09 05:16:09 -0500 | [diff] [blame] | 229 | |
| Sweta Potthuri | 2edacd3 | 2025-07-02 01:04:43 -0500 | [diff] [blame] | 230 | Configure 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 Potthuri | 565318d | 2025-06-09 06:13:46 -0500 | [diff] [blame] | 234 | |
| Sweta Potthuri | 2edacd3 | 2025-07-02 01:04:43 -0500 | [diff] [blame] | 235 | # 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 Potthuri | 565318d | 2025-06-09 06:13:46 -0500 | [diff] [blame] | 238 | |
| Sweta Potthuri | cb61ff0 | 2025-04-09 05:16:09 -0500 | [diff] [blame] | 239 | |
| Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 240 | Modify 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 Potthuri | 2d08573 | 2025-07-16 09:10:08 -0500 | [diff] [blame] | 248 | Delete 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 Potthuri | 35c503b | 2025-07-27 23:36:20 -0500 | [diff] [blame] | 256 | Verify 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_Rayankula | 019d936 | 2025-09-03 22:55:12 -0500 | [diff] [blame] | 259 | [Setup] Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} |
| 260 | [Teardown] Delete IPv6 Address ${test_ipv6_addr} |
| Sweta Potthuri | 35c503b | 2025-07-27 23:36:20 -0500 | [diff] [blame] | 261 | |
| 262 | Check Coexistence Of Linklocalv6 And Static IPv6 |
| 263 | |
| 264 | |
| George Keishing | badb4c6 | 2025-09-18 16:14:12 +0530 | [diff] [blame] | 265 | Verify IPv6 Linklocal Address Is In Correct Format |
| 266 | [Documentation] Verify linklocal address has network part as fe80 and |
| 267 | ... host part as EUI64. |
| Sweta Potthuri | 3c6f97d | 2025-08-06 00:30:19 -0500 | [diff] [blame] | 268 | [Tags] Verify_IPv6_Linklocal_Address_Is_In_Correct_Format |
| 269 | |
| 270 | Check If Linklocal Address Is In Correct Format |
| 271 | |
| 272 | |
| Sweta Potthuri | 71f7bdc | 2025-08-10 03:08:10 -0500 | [diff] [blame] | 273 | Verify 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 Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 276 | [Setup] Set SLAAC Configuration State And Verify ${False} |
| Sweta Potthuri | 71f7bdc | 2025-08-10 03:08:10 -0500 | [diff] [blame] | 277 | |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 278 | Set SLAAC Configuration State And Verify ${True} |
| Sweta Potthuri | 71f7bdc | 2025-08-10 03:08:10 -0500 | [diff] [blame] | 279 | Sleep ${NETWORK_TIMEOUT} |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 280 | Check BMC Gets SLAAC Address |
| Sweta Potthuri | 71f7bdc | 2025-08-10 03:08:10 -0500 | [diff] [blame] | 281 | |
| 282 | |
| Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 283 | Verify 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 Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 286 | [Setup] Get The Initial SLAAC Settings |
| Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 287 | [Template] Set And Verify SLAAC Property On Both Interfaces |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 288 | [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 Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 291 | # slaac_eth0 slaac_eth1 |
| 292 | ${True} ${True} |
| 293 | ${True} ${False} |
| 294 | ${False} ${True} |
| 295 | ${False} ${False} |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 296 | |
| 297 | |
| Sweta Potthuri | 425713a | 2025-10-16 00:28:20 -0500 | [diff] [blame] | 298 | Configure 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-121 | 3a64590 | 2025-09-08 01:12:34 -0500 | [diff] [blame] | 314 | Verify 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 Potthuri | f3d188f | 2025-09-08 07:17:31 -0500 | [diff] [blame] | 322 | Verify 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-121 | c3e96d7 | 2025-09-09 11:35:09 -0500 | [diff] [blame] | 335 | Verify 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 Potthuri | 2f3fbb5 | 2025-09-19 00:50:47 -0500 | [diff] [blame] | 354 | Modify 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-121 | bfbd03a | 2025-09-15 01:40:35 -0500 | [diff] [blame] | 373 | Add 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-121 | 97078c5 | 2025-09-25 01:13:00 -0500 | [diff] [blame] | 383 | Verify Coexistence Of Static IPv6 And SLAAC On BMC |
| abhijith-121 | 4dc01a0 | 2025-09-24 11:29:55 -0500 | [diff] [blame] | 384 | [Documentation] Verify static IPv6 And SLAAC both coexist. |
| abhijith-121 | 97078c5 | 2025-09-25 01:13:00 -0500 | [diff] [blame] | 385 | [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-121 | 8ff5db4 | 2025-09-24 06:24:03 -0500 | [diff] [blame] | 395 | Verify 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-121 | 4dc01a0 | 2025-09-24 11:29:55 -0500 | [diff] [blame] | 405 | Verify 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-121 | ffea191 | 2025-10-06 02:39:22 -0500 | [diff] [blame] | 415 | Verify 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-121 | 9e190dd | 2025-10-15 03:35:06 -0500 | [diff] [blame] | 433 | Configure 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-121 | 5f0aa20 | 2025-10-24 02:53:53 -0500 | [diff] [blame] | 448 | Configure 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-121 | b9fc274 | 2025-10-14 09:46:43 -0500 | [diff] [blame] | 451 | [Teardown] Run Keywords |
| abhijith-121 | 5f0aa20 | 2025-10-24 02:53:53 -0500 | [diff] [blame] | 452 | ... 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-121 | b9fc274 | 2025-10-14 09:46:43 -0500 | [diff] [blame] | 457 | |
| abhijith-121 | 5f0aa20 | 2025-10-24 02:53:53 -0500 | [diff] [blame] | 458 | # 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-121 | b9fc274 | 2025-10-14 09:46:43 -0500 | [diff] [blame] | 462 | |
| 463 | |
| abhijith-121 | d8322b7 | 2025-10-13 02:23:48 -0500 | [diff] [blame] | 464 | Verify 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-121 | cd9edf6 | 2025-11-03 02:25:25 -0600 | [diff] [blame^] | 482 | Verify 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 | |
| Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 496 | *** Keywords *** |
| 497 | |
| Prashanth Katti | 3270fd0 | 2021-06-11 08:02:22 -0500 | [diff] [blame] | 498 | Suite Setup Execution |
| 499 | [Documentation] Do suite setup execution. |
| 500 | |
| Anvesh-Kumar_Rayankula | 019d936 | 2025-09-03 22:55:12 -0500 | [diff] [blame] | 501 | Redfish.Login |
| Prashanth Katti | 3270fd0 | 2021-06-11 08:02:22 -0500 | [diff] [blame] | 502 | ${active_channel_config}= Get Active Channel Config |
| Sweta Potthuri | 3c6f97d | 2025-08-06 00:30:19 -0500 | [diff] [blame] | 503 | Set Suite Variable ${active_channel_config} |
| 504 | |
| Prashanth Katti | 3270fd0 | 2021-06-11 08:02:22 -0500 | [diff] [blame] | 505 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 506 | |
| 507 | Set Suite variable ${ethernet_interface} |
| 508 | |
| Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 509 | # Get initial IPv4 and IPv6 addresses and address origins for eth0. |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 510 | ${initial_ipv4_addressorigin_list} ${initial_ipv4_addr_list}= Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses |
| 511 | ${initial_ipv6_addressorigin_list} ${initial_ipv6_addr_list}= Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses |
| 512 | |
| 513 | Set Suite Variable ${initial_ipv4_addressorigin_list} |
| 514 | Set Suite Variable ${initial_ipv4_addr_list} |
| 515 | Set Suite Variable ${initial_ipv6_addressorigin_list} |
| 516 | Set Suite Variable ${initial_ipv6_addr_list} |
| 517 | |
| Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 518 | # Get initial IPv4 and IPv6 addresses and address origins for eth1. |
| 519 | ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}= |
| 520 | ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${2} |
| 521 | ${eth1_initial_ipv6_addressorigin_list} ${eth1_initial_ipv6_addr_list}= |
| 522 | ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${2} |
| 523 | Set Suite Variable ${eth1_initial_ipv4_addressorigin_list} |
| 524 | Set Suite Variable ${eth1_initial_ipv4_addr_list} |
| 525 | Set Suite Variable ${eth1_initial_ipv6_addressorigin_list} |
| 526 | Set Suite Variable ${eth1_initial_ipv6_addr_list} |
| 527 | |
| Prashanth Katti | 3270fd0 | 2021-06-11 08:02:22 -0500 | [diff] [blame] | 528 | |
| Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 529 | Test Setup Execution |
| 530 | [Documentation] Test setup execution. |
| 531 | |
| Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 532 | @{ipv6_network_configurations}= Get IPv6 Network Configuration |
| 533 | Set Test Variable @{ipv6_network_configurations} |
| 534 | |
| 535 | # Get BMC IPv6 address and prefix length. |
| 536 | ${ipv6_data}= Get BMC IPv6 Info |
| 537 | Set Test Variable ${ipv6_data} |
| 538 | |
| 539 | |
| 540 | Test Teardown Execution |
| 541 | [Documentation] Test teardown execution. |
| 542 | |
| 543 | FFDC On Test Case Fail |
| Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 544 | |
| 545 | |
| 546 | Get IPv6 Network Configuration |
| 547 | [Documentation] Get Ipv6 network configuration. |
| Sweta Potthuri | 3b2b9cd | 2025-10-22 06:41:54 -0500 | [diff] [blame] | 548 | [Arguments] ${channel_number}=${CHANNEL_NUMBER} |
| 549 | |
| 550 | # Description of argument(s): |
| 551 | # channel_number Channel number (1 - eth0 and 2 - eth1). |
| 552 | |
| Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 553 | # Sample output: |
| 554 | # { |
| ganesanb | 4d43028 | 2023-04-27 14:33:23 +0000 | [diff] [blame] | 555 | # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0", |
| Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 556 | # "@odata.type": "#EthernetInterface.v1_4_1.EthernetInterface", |
| 557 | # "DHCPv4": { |
| 558 | # "DHCPEnabled": false, |
| 559 | # "UseDNSServers": false, |
| 560 | # "UseDomainName": true, |
| 561 | # "UseNTPServers": false |
| 562 | # }, |
| 563 | # "DHCPv6": { |
| 564 | # "OperatingMode": "Disabled", |
| 565 | # "UseDNSServers": false, |
| 566 | # "UseDomainName": true, |
| 567 | # "UseNTPServers": false |
| 568 | # }, |
| 569 | # "Description": "Management Network Interface", |
| 570 | # "FQDN": "localhost", |
| 571 | # "HostName": "localhost", |
| 572 | # "IPv4Addresses": [ |
| 573 | # { |
| 574 | # "Address": "xx.xx.xx.xx", |
| 575 | # "AddressOrigin": "Static", |
| 576 | # "Gateway": "xx.xx.xx.1", |
| 577 | # "SubnetMask": "xx.xx.xx.0" |
| 578 | # }, |
| 579 | # { |
| 580 | # "Address": "169.254.xx.xx", |
| 581 | # "AddressOrigin": "IPv4LinkLocal", |
| 582 | # "Gateway": "0.0.0.0", |
| 583 | # "SubnetMask": "xx.xx.0.0" |
| 584 | # }, |
| 585 | # ], |
| 586 | # "IPv4StaticAddresses": [ |
| 587 | # { |
| 588 | # "Address": "xx.xx.xx.xx", |
| 589 | # "AddressOrigin": "Static", |
| 590 | # "Gateway": "xx.xx.xx.1", |
| 591 | # "SubnetMask": "xx.xx.0.0" |
| 592 | # } |
| 593 | # } |
| 594 | # ], |
| 595 | # "IPv6AddressPolicyTable": [], |
| 596 | # "IPv6Addresses": [ |
| 597 | # { |
| 598 | # "Address": "fe80::xxxx:xxxx:xxxx:xxxx", |
| 599 | # "AddressOrigin": "LinkLocal", |
| 600 | # "AddressState": null, |
| 601 | # "PrefixLength": xx |
| 602 | # } |
| 603 | # ], |
| 604 | # "IPv6DefaultGateway": "", |
| 605 | # "IPv6StaticAddresses": [ |
| 606 | # { "Address": "xxxx:xxxx:xxxx:xxxx::xxxx", |
| 607 | # "AddressOrigin": "Static", |
| 608 | # "AddressState": null, |
| 609 | # "PrefixLength": xxx |
| 610 | # } |
| 611 | # ], |
| 612 | # "Id": "eth0", |
| 613 | # "InterfaceEnabled": true, |
| 614 | # "LinkStatus": "LinkUp", |
| 615 | # "MACAddress": "xx:xx:xx:xx:xx:xx", |
| 616 | # "Name": "Manager Ethernet Interface", |
| 617 | # "NameServers": [], |
| 618 | # "SpeedMbps": 0, |
| 619 | # "StaticNameServers": [], |
| 620 | # "Status": { |
| 621 | # "Health": "OK", |
| 622 | # "HealthRollup": "OK", |
| 623 | # "State": "Enabled" |
| 624 | # }, |
| 625 | # "VLANs": { |
| ganesanb | 4d43028 | 2023-04-27 14:33:23 +0000 | [diff] [blame] | 626 | # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0/VLANs" |
| Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 627 | |
| 628 | |
| 629 | ${active_channel_config}= Get Active Channel Config |
| Sweta Potthuri | 3b2b9cd | 2025-10-22 06:41:54 -0500 | [diff] [blame] | 630 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${channel_number}']['name']} |
| Prashanth Katti | 8abbb4d | 2021-01-29 02:17:45 -0600 | [diff] [blame] | 631 | |
| 632 | @{ipv6_network_configurations}= Get From Dictionary ${resp.dict} IPv6StaticAddresses |
| George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 633 | RETURN @{ipv6_network_configurations} |
| Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 634 | |
| 635 | |
| 636 | Verify IPv6 And PrefixLength |
| 637 | [Documentation] Verify IPv6 address and prefix length on BMC. |
| 638 | [Arguments] ${ipv6_addr} ${prefix_len} |
| 639 | |
| 640 | # Description of the argument(s): |
| 641 | # ipv6_addr IPv6 address to be verified. |
| 642 | # prefix_len PrefixLength value to be verified. |
| 643 | |
| 644 | # Catenate IPv6 address and its prefix length. |
| 645 | ${ipv6_with_prefix}= Catenate ${ipv6_addr}/${prefix_len} |
| 646 | |
| 647 | # Get IPv6 address details on BMC using IP command. |
| 648 | @{ip_data}= Get BMC IPv6 Info |
| 649 | |
| 650 | # Verify if IPv6 and prefix length is configured on BMC. |
| 651 | |
| 652 | Should Contain ${ip_data} ${ipv6_with_prefix} |
| 653 | ... msg=IPv6 and prefix length pair does not exist. |
| 654 | |
| Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 655 | Configure IPv6 Address On BMC |
| 656 | [Documentation] Add IPv6 Address on BMC. |
| abhijith-121 | b9fc274 | 2025-10-14 09:46:43 -0500 | [diff] [blame] | 657 | [Arguments] ${ipv6_addr1} ${prefix_len} ${ipv6_addr2}=${None} |
| Sweta Potthuri | 3b2b9cd | 2025-10-22 06:41:54 -0500 | [diff] [blame] | 658 | ... ${channel_number}=${CHANNEL_NUMBER} |
| 659 | ... ${valid_status_codes}=[${HTTP_OK},${HTTP_NO_CONTENT}] |
| Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 660 | |
| 661 | # Description of argument(s): |
| abhijith-121 | b9fc274 | 2025-10-14 09:46:43 -0500 | [diff] [blame] | 662 | # ipv6_addr1 IPv6 address to be added (e.g. "2001:0022:0033::0111"). |
| 663 | # ipv6_addr2 IPv6 address to be Verified (e.g. "2001:22:33::111"). |
| Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 664 | # prefix_len Prefix length for the IPv6 to be added |
| 665 | # (e.g. "64"). |
| Sweta Potthuri | 3b2b9cd | 2025-10-22 06:41:54 -0500 | [diff] [blame] | 666 | # channel_number Channel number (1 - eth0 and 2 - eth1). |
| Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 667 | # valid_status_codes Expected return code from patch operation |
| 668 | # (e.g. "200"). |
| 669 | |
| Prashanth Katti | 12ed4b7 | 2023-05-16 05:24:00 -0500 | [diff] [blame] | 670 | ${prefix_length}= Convert To Integer ${prefix_len} |
| Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 671 | ${empty_dict}= Create Dictionary |
| abhijith-121 | b9fc274 | 2025-10-14 09:46:43 -0500 | [diff] [blame] | 672 | ${ipv6_data}= Create Dictionary Address=${ipv6_addr1} |
| Prashanth Katti | 12ed4b7 | 2023-05-16 05:24:00 -0500 | [diff] [blame] | 673 | ... PrefixLength=${prefix_length} |
| Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 674 | |
| 675 | ${patch_list}= Create List |
| 676 | |
| 677 | # Get existing static IPv6 configurations on BMC. |
| Sweta Potthuri | 3b2b9cd | 2025-10-22 06:41:54 -0500 | [diff] [blame] | 678 | ${ipv6_network_configurations}= Get IPv6 Network Configuration ${channel_number} |
| Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 679 | ${num_entries}= Get Length ${ipv6_network_configurations} |
| 680 | |
| 681 | FOR ${INDEX} IN RANGE 0 ${num_entries} |
| 682 | Append To List ${patch_list} ${empty_dict} |
| 683 | END |
| 684 | |
| Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 685 | # We need not check for existence of IPv6 on BMC while adding. |
| 686 | Append To List ${patch_list} ${ipv6_data} |
| 687 | ${data}= Create Dictionary IPv6StaticAddresses=${patch_list} |
| 688 | |
| 689 | ${active_channel_config}= Get Active Channel Config |
| Sweta Potthuri | 3b2b9cd | 2025-10-22 06:41:54 -0500 | [diff] [blame] | 690 | ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']} |
| Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 691 | |
| 692 | Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data} |
| abhijith-121 | b9fc274 | 2025-10-14 09:46:43 -0500 | [diff] [blame] | 693 | ... valid_status_codes=${valid_status_codes} |
| Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 694 | |
| abhijith-121 | b9fc274 | 2025-10-14 09:46:43 -0500 | [diff] [blame] | 695 | IF ${valid_status_codes} != [${HTTP_OK}, ${HTTP_NO_CONTENT}] |
| 696 | Fail msg=Static address not added correctly |
| 697 | END |
| Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 698 | |
| 699 | # Note: Network restart takes around 15-18s after patch request processing. |
| 700 | Sleep ${NETWORK_TIMEOUT}s |
| 701 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 702 | |
| Sweta Potthuri | 3b2b9cd | 2025-10-22 06:41:54 -0500 | [diff] [blame] | 703 | # Verify ip address on CLI. |
| abhijith-121 | b9fc274 | 2025-10-14 09:46:43 -0500 | [diff] [blame] | 704 | IF '${ipv6_addr2}' != '${None}' |
| 705 | Verify IPv6 And PrefixLength ${ipv6_addr2} ${prefix_len} |
| 706 | ELSE |
| 707 | Verify IPv6 And PrefixLength ${ipv6_addr1} ${prefix_len} |
| 708 | END |
| Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 709 | |
| 710 | # Verify if existing static IPv6 addresses still exist. |
| 711 | FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} |
| 712 | Verify IPv6 On BMC ${ipv6_network_configuration['Address']} |
| 713 | END |
| 714 | |
| abhijith-121 | b9fc274 | 2025-10-14 09:46:43 -0500 | [diff] [blame] | 715 | #Verify redfish and CLI data matches. |
| Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 716 | Validate IPv6 Network Config On BMC |
| 717 | |
| 718 | |
| abhijith-121 | bfbd03a | 2025-09-15 01:40:35 -0500 | [diff] [blame] | 719 | Configure Multiple IPv6 Address on BMC |
| 720 | [Documentation] Add multiple IPv6 address on BMC. |
| 721 | [Arguments] ${prefix_len} |
| 722 | ... ${valid_status_codes}=[${HTTP_OK},${HTTP_NO_CONTENT}] |
| 723 | |
| 724 | # Description of argument(s): |
| 725 | # prefix_len Prefix length for the IPv6 to be added |
| 726 | # (e.g. "64"). |
| 727 | # valid_status_codes Expected return code from patch operation |
| 728 | # (e.g. "200"). |
| 729 | |
| 730 | ${ipv6_list}= Create List ${test_ipv6_addr} ${test_ipv6_addr1} |
| 731 | ${prefix_length}= Convert To Integer ${prefix_len} |
| 732 | ${empty_dict}= Create Dictionary |
| 733 | ${patch_list}= Create List |
| 734 | |
| 735 | # Get existing static IPv6 configurations on BMC. |
| 736 | ${ipv6_network_configurations}= Get IPv6 Network Configuration |
| 737 | ${num_entries}= Get Length ${ipv6_network_configurations} |
| 738 | |
| 739 | FOR ${INDEX} IN RANGE 0 ${num_entries} |
| 740 | Append To List ${patch_list} ${empty_dict} |
| 741 | END |
| 742 | |
| 743 | # We need not check for existence of IPv6 on BMC while adding. |
| 744 | FOR ${ipv6_addr} IN @{ipv6_list} |
| 745 | ${ipv6_data}= Create Dictionary Address=${ipv6_addr} PrefixLength=${prefix_length} |
| 746 | Append To List ${patch_list} ${ipv6_data} |
| 747 | END |
| 748 | ${data}= Create Dictionary IPv6StaticAddresses=${patch_list} |
| 749 | |
| 750 | ${active_channel_config}= Get Active Channel Config |
| 751 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 752 | |
| 753 | Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data} |
| 754 | ... valid_status_codes=${valid_status_codes} |
| 755 | |
| 756 | IF ${valid_status_codes} != [${HTTP_OK}, ${HTTP_NO_CONTENT}] |
| 757 | Fail msg=Static address not added correctly |
| 758 | END |
| 759 | |
| 760 | # Note: Network restart takes around 15-18s after patch request processing. |
| 761 | Sleep ${NETWORK_TIMEOUT}s |
| 762 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 763 | |
| 764 | # Verify newly added ip address on CLI. |
| 765 | FOR ${ipv6_addr} IN @{ipv6_list} |
| 766 | Verify IPv6 And PrefixLength ${ipv6_addr} ${prefix_len} |
| 767 | END |
| 768 | |
| 769 | # Verify if existing static IPv6 addresses still exist. |
| 770 | FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} |
| 771 | Verify IPv6 On BMC ${ipv6_network_configuration['Address']} |
| 772 | END |
| 773 | |
| 774 | # Get the latest ipv6 network configurations. |
| 775 | @{ipv6_network_configurations}= Get IPv6 Network Configuration |
| 776 | |
| 777 | # Verify newly added ip address on BMC. |
| 778 | FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} |
| 779 | Should Contain Match ${ipv6_list} ${ipv6_network_configuration['Address']} |
| 780 | END |
| 781 | |
| 782 | Validate IPv6 Network Config On BMC |
| 783 | |
| 784 | |
| Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 785 | Validate IPv6 Network Config On BMC |
| 786 | [Documentation] Check that IPv6 network info obtained via redfish matches info |
| 787 | ... obtained via CLI. |
| Sridevi Ramesh | ed94c69 | 2025-09-07 23:41:10 -0500 | [diff] [blame] | 788 | |
| Prashanth Katti | 5f7d2e4 | 2023-05-22 03:17:25 -0500 | [diff] [blame] | 789 | @{ipv6_network_configurations}= Get IPv6 Network Configuration |
| Prashanth Katti | c1d2daa | 2022-07-26 03:53:06 -0500 | [diff] [blame] | 790 | ${ipv6_data}= Get BMC IPv6 Info |
| 791 | FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} |
| 792 | Should Contain Match ${ipv6_data} ${ipv6_network_configuration['Address']}/* |
| 793 | ... msg=IPv6 address does not exist. |
| 794 | END |
| 795 | |
| Prashanth Katti | 12ed4b7 | 2023-05-16 05:24:00 -0500 | [diff] [blame] | 796 | |
| 797 | Delete IPv6 Address |
| 798 | [Documentation] Delete IPv6 address of BMC. |
| Prashanth Katti | bcb9dab | 2025-04-01 12:58:37 -0500 | [diff] [blame] | 799 | [Arguments] ${ipv6_addr} |
| Sweta Potthuri | 3b2b9cd | 2025-10-22 06:41:54 -0500 | [diff] [blame] | 800 | ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}] |
| 801 | ... ${channel_number}=${CHANNEL_NUMBER} |
| Prashanth Katti | 12ed4b7 | 2023-05-16 05:24:00 -0500 | [diff] [blame] | 802 | |
| 803 | # Description of argument(s): |
| 804 | # ipv6_addr IPv6 address to be deleted (e.g. "2001:1234:1234:1234::1234"). |
| Sweta Potthuri | 3b2b9cd | 2025-10-22 06:41:54 -0500 | [diff] [blame] | 805 | # channel_number Channel number (1 - eth0 and 2 - eth1). |
| Prashanth Katti | 12ed4b7 | 2023-05-16 05:24:00 -0500 | [diff] [blame] | 806 | # valid_status_codes Expected return code from patch operation |
| 807 | # (e.g. "200"). See prolog of rest_request |
| 808 | # method in redfish_plus.py for details. |
| 809 | |
| 810 | ${empty_dict}= Create Dictionary |
| 811 | ${patch_list}= Create List |
| 812 | |
| Sweta Potthuri | 3b2b9cd | 2025-10-22 06:41:54 -0500 | [diff] [blame] | 813 | @{ipv6_network_configurations}= Get IPv6 Network Configuration ${channel_number} |
| Prashanth Katti | 12ed4b7 | 2023-05-16 05:24:00 -0500 | [diff] [blame] | 814 | FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} |
| 815 | IF '${ipv6_network_configuration['Address']}' == '${ipv6_addr}' |
| 816 | Append To List ${patch_list} ${null} |
| 817 | ELSE |
| 818 | Append To List ${patch_list} ${empty_dict} |
| 819 | END |
| 820 | END |
| 821 | |
| 822 | ${ip_found}= Run Keyword And Return Status List Should Contain Value |
| 823 | ... ${patch_list} ${null} msg=${ipv6_addr} does not exist on BMC |
| 824 | Pass Execution If ${ip_found} == ${False} ${ipv6_addr} does not exist on BMC |
| 825 | |
| 826 | # Run patch command only if given IP is found on BMC |
| 827 | ${data}= Create Dictionary IPv6StaticAddresses=${patch_list} |
| 828 | |
| 829 | ${active_channel_config}= Get Active Channel Config |
| Sweta Potthuri | 3b2b9cd | 2025-10-22 06:41:54 -0500 | [diff] [blame] | 830 | ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']} |
| Prashanth Katti | 12ed4b7 | 2023-05-16 05:24:00 -0500 | [diff] [blame] | 831 | |
| 832 | Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data} |
| Sweta Potthuri | a198161 | 2025-05-09 05:41:10 -0500 | [diff] [blame] | 833 | ... valid_status_codes=${valid_status_codes} |
| Prashanth Katti | 12ed4b7 | 2023-05-16 05:24:00 -0500 | [diff] [blame] | 834 | |
| 835 | # Note: Network restart takes around 15-18s after patch request processing |
| 836 | Sleep ${NETWORK_TIMEOUT}s |
| 837 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 838 | |
| 839 | # IPv6 address that is deleted should not be there on BMC. |
| 840 | ${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] | 841 | IF '${valid_status_codes}' == '[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]' |
| Prashanth Katti | 12ed4b7 | 2023-05-16 05:24:00 -0500 | [diff] [blame] | 842 | Should Be True '${delete_status}' == '${False}' |
| 843 | ELSE |
| 844 | Should Be True '${delete_status}' == '${True}' |
| 845 | END |
| 846 | |
| 847 | Validate IPv6 Network Config On BMC |
| Prashanth Katti | 5f7d2e4 | 2023-05-22 03:17:25 -0500 | [diff] [blame] | 848 | |
| 849 | |
| 850 | Modify IPv6 Address |
| 851 | [Documentation] Modify and verify IPv6 address of BMC. |
| 852 | [Arguments] ${ipv6} ${new_ipv6} ${prefix_len} |
| 853 | ... ${valid_status_codes}=[${HTTP_OK}, ${HTTP_NO_CONTENT}] |
| 854 | |
| 855 | # Description of argument(s): |
| 856 | # ipv6 IPv6 address to be replaced (e.g. "2001:AABB:CCDD::AAFF"). |
| 857 | # new_ipv6 New IPv6 address to be configured. |
| 858 | # prefix_len Prefix length value (Range 1 to 128). |
| 859 | # valid_status_codes Expected return code from patch operation |
| 860 | # (e.g. "200", "201"). |
| 861 | |
| 862 | ${empty_dict}= Create Dictionary |
| 863 | ${patch_list}= Create List |
| 864 | ${prefix_length}= Convert To Integer ${prefix_len} |
| 865 | ${ipv6_data}= Create Dictionary |
| 866 | ... Address=${new_ipv6} PrefixLength=${prefix_length} |
| 867 | |
| 868 | # Sample IPv6 network configurations: |
| 869 | # "IPv6AddressPolicyTable": [], |
| 870 | # "IPv6Addresses": [ |
| 871 | # { |
| 872 | # "Address": "X002:db8:0:2::XX0", |
| 873 | # "AddressOrigin": "DHCPv6", |
| 874 | # "PrefixLength": 128 |
| 875 | # }, |
| 876 | # { |
| 877 | # "Address": “X002:db8:0:2:a94:XXff:fe82:XXXX", |
| 878 | # "AddressOrigin": "SLAAC", |
| 879 | # "PrefixLength": 64 |
| 880 | # }, |
| 881 | # { |
| 882 | # "Address": “Y002:db8:0:2:a94:efff:fe82:5000", |
| 883 | # "AddressOrigin": "Static", |
| 884 | # "PrefixLength": 56 |
| 885 | # }, |
| 886 | # { |
| 887 | # "Address": “Z002:db8:0:2:a94:efff:fe82:5000", |
| 888 | # "AddressOrigin": "Static", |
| 889 | # "PrefixLength": 56 |
| 890 | # }, |
| 891 | # { |
| 892 | # "Address": “Xe80::a94:efff:YYYY:XXXX", |
| 893 | # "AddressOrigin": "LinkLocal", |
| 894 | # "PrefixLength": 64 |
| 895 | # }, |
| 896 | # { |
| 897 | # "Address": “X002:db8:1:2:eff:233:fee:546", |
| 898 | # "AddressOrigin": "Static", |
| 899 | # "PrefixLength": 56 |
| 900 | # } |
| 901 | # ], |
| 902 | # "IPv6DefaultGateway": “XXXX::ab2e:80fe:87df:XXXX”, |
| 903 | # "IPv6StaticAddresses": [ |
| 904 | # { |
| 905 | # "Address": “X002:db8:0:2:a94:efff:fe82:5000", |
| 906 | # "PrefixLength": 56 |
| 907 | # }, |
| 908 | # { |
| 909 | # "Address": “Y002:db8:0:2:a94:efff:fe82:5000", |
| 910 | # "PrefixLength": 56 |
| 911 | # }, |
| 912 | # { |
| 913 | # "Address": “Z002:db8:1:2:eff:233:fee:546", |
| 914 | # "PrefixLength": 56 |
| 915 | # } |
| 916 | # ], |
| 917 | # "IPv6StaticDefaultGateways": [], |
| 918 | |
| 919 | # Find the position of IPv6 address to be modified. |
| 920 | @{ipv6_network_configurations}= Get IPv6 Network Configuration |
| 921 | FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} |
| George Keishing | e6e161e | 2025-05-08 10:18:30 +0530 | [diff] [blame] | 922 | IF '${ipv6_network_configuration['Address']}' == '${ipv6}' |
| 923 | Append To List ${patch_list} ${ipv6_data} |
| 924 | ELSE |
| 925 | Append To List ${patch_list} ${empty_dict} |
| 926 | END |
| Prashanth Katti | 5f7d2e4 | 2023-05-22 03:17:25 -0500 | [diff] [blame] | 927 | END |
| 928 | |
| 929 | # Modify the IPv6 address only if given IPv6 is found |
| 930 | ${ip_found}= Run Keyword And Return Status List Should Contain Value |
| 931 | ... ${patch_list} ${ipv6_data} msg=${ipv6} does not exist on BMC |
| 932 | Pass Execution If ${ip_found} == ${False} ${ipv6} does not exist on BMC |
| 933 | |
| 934 | ${data}= Create Dictionary IPv6StaticAddresses=${patch_list} |
| 935 | |
| 936 | ${active_channel_config}= Get Active Channel Config |
| 937 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 938 | |
| 939 | Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 940 | ... body=&{data} valid_status_codes=${valid_status_codes} |
| 941 | |
| 942 | # Note: Network restart takes around 15-18s after patch request processing. |
| 943 | Sleep ${NETWORK_TIMEOUT}s |
| 944 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 945 | |
| 946 | # Verify if new IPv6 address is configured on BMC. |
| 947 | Verify IPv6 On BMC ${new_ipv6} |
| 948 | |
| 949 | # Verify if old IPv6 address is erased. |
| 950 | ${cmd_status}= Run Keyword And Return Status |
| 951 | ... Verify IPv6 On BMC ${ipv6} |
| 952 | Should Be Equal ${cmd_status} ${False} msg=Old IPv6 address is not deleted. |
| 953 | |
| 954 | Validate IPv6 Network Config On BMC |
| Sweta Potthuri | 8ba7432 | 2025-03-19 12:29:06 -0500 | [diff] [blame] | 955 | |
| 956 | |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 957 | Set SLAAC Configuration State And Verify |
| Sweta Potthuri | e05a8dd | 2025-10-29 08:32:32 -0500 | [diff] [blame] | 958 | [Documentation] Set SLAAC configuration state. |
| Sridevi Ramesh | ed94c69 | 2025-09-07 23:41:10 -0500 | [diff] [blame] | 959 | [Arguments] ${slaac_state} ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}] |
| Sweta Potthuri | e05a8dd | 2025-10-29 08:32:32 -0500 | [diff] [blame] | 960 | ... ${channel_number}=${CHANNEL_NUMBER} ${is_slaac_verify_state}=${True} |
| Sweta Potthuri | 8ba7432 | 2025-03-19 12:29:06 -0500 | [diff] [blame] | 961 | |
| 962 | # Description of argument(s): |
| Sweta Potthuri | e05a8dd | 2025-10-29 08:32:32 -0500 | [diff] [blame] | 963 | # slaac_state SLAAC state('True' or 'False'). |
| 964 | # valid_status_code Expected valid status codes. |
| 965 | # channel_number Channel number 1(eth0) or 2(eth1). |
| 966 | # is_slaac_verify_state Flag to check verification is required. |
| Sweta Potthuri | 8ba7432 | 2025-03-19 12:29:06 -0500 | [diff] [blame] | 967 | |
| 968 | ${active_channel_config}= Get Active Channel Config |
| 969 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 970 | |
| 971 | ${data}= Set Variable If ${slaac_state} == ${False} ${DISABLE_SLAAC} ${ENABLE_SLAAC} |
| 972 | ${resp}= Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| Sweta Potthuri | 610f86f | 2025-05-30 00:47:23 -0500 | [diff] [blame] | 973 | ... body=${data} valid_status_codes=${valid_status_codes} |
| Sweta Potthuri | e05a8dd | 2025-10-29 08:32:32 -0500 | [diff] [blame] | 974 | IF ${is_slaac_verify_state} |
| 975 | Verify SLAAC Property ${slaac_state} ${channel_number} |
| 976 | END |
| 977 | |
| 978 | |
| 979 | Verify SLAAC Property |
| 980 | [Documentation] Verify SLAAC property. |
| 981 | [Arguments] ${slaac_state} ${channel_number}=${CHANNEL_NUMBER} |
| 982 | |
| 983 | # Description of argument(s): |
| 984 | # slaac_state SLAAC state('True' or 'False'). |
| 985 | # channel_number Channel number 1(eth0) or 2(eth1). |
| Sweta Potthuri | 8ba7432 | 2025-03-19 12:29:06 -0500 | [diff] [blame] | 986 | |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 987 | # Verify SLAAC is set correctly. |
| Sweta Potthuri | 8ba7432 | 2025-03-19 12:29:06 -0500 | [diff] [blame] | 988 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 989 | ${slaac_verify}= Get From Dictionary ${resp.dict} StatelessAddressAutoConfig |
| 990 | |
| George Keishing | e6e161e | 2025-05-08 10:18:30 +0530 | [diff] [blame] | 991 | IF '${slaac_verify['IPv6AutoConfigEnabled']}' != '${slaac_state}' |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 992 | Fail msg=SLAAC not set properly. |
| George Keishing | e6e161e | 2025-05-08 10:18:30 +0530 | [diff] [blame] | 993 | END |
| Sweta Potthuri | 0df4a86 | 2025-03-24 12:05:09 -0500 | [diff] [blame] | 994 | |
| Sweta Potthuri | e05a8dd | 2025-10-29 08:32:32 -0500 | [diff] [blame] | 995 | |
| Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 996 | Set And Verify DHCPv6 Property |
| 997 | [Documentation] Set DHCPv6 property and verify. |
| 998 | [Arguments] ${dhcpv6_operating_mode}=${Disabled} ${channel_number}=${CHANNEL_NUMBER} |
| Sweta Potthuri | 0df4a86 | 2025-03-24 12:05:09 -0500 | [diff] [blame] | 999 | |
| 1000 | # Description of argument(s): |
| 1001 | # 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] | 1002 | # channel_number Channel number 1 or 2. |
| 1003 | |
| 1004 | Set DHCPv6 Property ${dhcpv6_operating_mode} ${channel_number} |
| 1005 | Verify DHCPv6 Property ${dhcpv6_operating_mode} ${channel_number} |
| 1006 | |
| 1007 | |
| 1008 | Set DHCPv6 Property |
| 1009 | [Documentation] Set DHCPv6 attribute is enables or disabled. |
| 1010 | [Arguments] ${dhcpv6_operating_mode}=${Disabled} ${channel_number}=${CHANNEL_NUMBER} |
| 1011 | |
| 1012 | # Description of argument(s): |
| 1013 | # dhcpv6_operating_mode Enabled if user wants to enable DHCPv6('Enabled' or 'Disabled'). |
| 1014 | # channel_number Channel number 1 or 2. |
| Sweta Potthuri | 0df4a86 | 2025-03-24 12:05:09 -0500 | [diff] [blame] | 1015 | |
| 1016 | ${data}= Set Variable If '${dhcpv6_operating_mode}' == 'Disabled' ${DISABLE_DHCPv6} ${ENABLE_DHCPv6} |
| Sweta Potthuri | 0df4a86 | 2025-03-24 12:05:09 -0500 | [diff] [blame] | 1017 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 1018 | |
| 1019 | Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 1020 | ... body=${data} valid_status_codes=[${HTTP_OK},${HTTP_NO_CONTENT}] |
| 1021 | |
| kvishal | bd04bd6 | 2025-08-05 03:57:53 -0500 | [diff] [blame] | 1022 | |
| 1023 | Verify DHCPv6 Property |
| 1024 | [Documentation] Verify DHCPv6 settings is enabled or disabled. |
| Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 1025 | [Arguments] ${dhcpv6_operating_mode} ${channel_number}=${CHANNEL_NUMBER} |
| kvishal | bd04bd6 | 2025-08-05 03:57:53 -0500 | [diff] [blame] | 1026 | |
| 1027 | # Description of Argument(s): |
| 1028 | # dhcpv6_operating_mode Enable/ Disable DHCPv6. |
| Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 1029 | # channel_number Channel number 1 or 2. |
| 1030 | |
| Sweta Potthuri | 425713a | 2025-10-16 00:28:20 -0500 | [diff] [blame] | 1031 | ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']} |
| kvishal | bd04bd6 | 2025-08-05 03:57:53 -0500 | [diff] [blame] | 1032 | |
| Sweta Potthuri | 0df4a86 | 2025-03-24 12:05:09 -0500 | [diff] [blame] | 1033 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 1034 | ${dhcpv6_verify}= Get From Dictionary ${resp.dict} DHCPv6 |
| 1035 | |
| 1036 | Should Be Equal '${dhcpv6_verify['OperatingMode']}' '${dhcpv6_operating_mode}' |
| Sweta Potthuri | cb61ff0 | 2025-04-09 05:16:09 -0500 | [diff] [blame] | 1037 | |
| Sweta Potthuri | 425713a | 2025-10-16 00:28:20 -0500 | [diff] [blame] | 1038 | Sleep 30s |
| 1039 | |
| 1040 | @{ipv6_addressorigin_list} ${ipv6_dhcpv6_addr}= |
| 1041 | ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${channel_number} |
| 1042 | |
| 1043 | IF "${dhcpv6_operating_mode}" == "Enabled" |
| 1044 | @{ipv6_addressorigin_list} ${ipv6_dhcpv6_addr}= |
| 1045 | ... Get Address Origin List And Address For Type DHCPv6 ${channel_number} |
| 1046 | Should Not Be Empty ${ipv6_dhcpv6_addr} msg=DHCPv6 must be present. |
| 1047 | ELSE |
| 1048 | Should Not Contain ${ipv6_addressorigin_list} DHCPv6 |
| 1049 | END |
| 1050 | |
| 1051 | |
| Sweta Potthuri | 2edacd3 | 2025-07-02 01:04:43 -0500 | [diff] [blame] | 1052 | |
| Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 1053 | Get IPv6 Static Default Gateway |
| 1054 | [Documentation] Get IPv6 static default gateway. |
| 1055 | |
| 1056 | ${active_channel_config}= Get Active Channel Config |
| 1057 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 1058 | |
| 1059 | @{ipv6_static_defgw_configurations}= Get From Dictionary ${resp.dict} IPv6StaticDefaultGateways |
| 1060 | RETURN @{ipv6_static_defgw_configurations} |
| 1061 | |
| Sweta Potthuri | 2d08573 | 2025-07-16 09:10:08 -0500 | [diff] [blame] | 1062 | |
| Sweta Potthuri | 2edacd3 | 2025-07-02 01:04:43 -0500 | [diff] [blame] | 1063 | Configure IPv6 Static Default Gateway On BMC |
| 1064 | [Documentation] Configure IPv6 static default gateway on BMC. |
| 1065 | [Arguments] ${ipv6_gw_addr} ${prefix_length_def} |
| 1066 | ... ${valid_status_codes}=${HTTP_OK} |
| Sridevi Ramesh | ed94c69 | 2025-09-07 23:41:10 -0500 | [diff] [blame] | 1067 | |
| Sweta Potthuri | 2edacd3 | 2025-07-02 01:04:43 -0500 | [diff] [blame] | 1068 | # Description of argument(s): |
| 1069 | # ipv6_gw_addr IPv6 Static Default Gateway address to be configured. |
| 1070 | # prefix_len_def Prefix length value (Range 1 to 128). |
| 1071 | # valid_status_codes Expected return code from patch operation |
| 1072 | # (e.g. "200", "204".) |
| 1073 | |
| 1074 | # Prefix Length is passed as None. |
| 1075 | IF '${prefix_length_def}' == '${None}' |
| 1076 | ${ipv6_gw}= Create Dictionary Address=${ipv6_gw_addr} |
| 1077 | ELSE |
| 1078 | ${ipv6_gw}= Create Dictionary Address=${ipv6_gw_addr} Prefix Length=${prefix_length_def} |
| 1079 | END |
| 1080 | |
| 1081 | ${ipv6_static_def_gw}= Get IPv6 Static Default Gateway |
| 1082 | |
| 1083 | ${num_entries}= Get Length ${ipv6_static_def_gw} |
| 1084 | |
| 1085 | ${patch_list}= Create List |
| 1086 | ${empty_dict}= Create Dictionary |
| 1087 | |
| 1088 | FOR ${INDEX} IN RANGE 0 ${num_entries} |
| 1089 | Append To List ${patch_list} ${empty_dict} |
| 1090 | END |
| 1091 | |
| 1092 | ${valid_status_codes}= Set Variable If '${valid_status_codes}' == '${HTTP_OK}' |
| 1093 | ... ${HTTP_OK},${HTTP_NO_CONTENT} |
| 1094 | ... ${valid_status_codes} |
| 1095 | |
| 1096 | Append To List ${patch_list} ${ipv6_gw} |
| 1097 | ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list} |
| 1098 | |
| 1099 | Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 1100 | ... body=${data} valid_status_codes=[${valid_status_codes}] |
| 1101 | |
| 1102 | # Verify the added static default gateway is present in Redfish Get Output. |
| 1103 | ${ipv6_staticdef_gateway}= Get IPv6 Static Default Gateway |
| 1104 | |
| 1105 | ${ipv6_static_def_gw_list}= Create List |
| 1106 | FOR ${ipv6_staticdef_gateway} IN @{ipv6_staticdef_gateway} |
| 1107 | ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address |
| 1108 | Append To List ${ipv6_static_def_gw_list} ${value} |
| 1109 | END |
| 1110 | |
| 1111 | IF '${valid_status_codes}' != '${HTTP_OK},${HTTP_NO_CONTENT}' |
| 1112 | Should Not Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr} |
| 1113 | ELSE |
| 1114 | Should Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr} |
| 1115 | END |
| 1116 | |
| Sweta Potthuri | 2d08573 | 2025-07-16 09:10:08 -0500 | [diff] [blame] | 1117 | |
| Anvesh-Kumar_Rayankula | 019d936 | 2025-09-03 22:55:12 -0500 | [diff] [blame] | 1118 | Modify IPv6 Static Default Gateway On BMC |
| Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 1119 | [Documentation] Modify and verify IPv6 address of BMC. |
| 1120 | [Arguments] ${ipv6_gw_addr} ${new_static_def_gw} ${prefix_length} |
| 1121 | ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED}] |
| Sweta Potthuri | 2edacd3 | 2025-07-02 01:04:43 -0500 | [diff] [blame] | 1122 | |
| Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 1123 | # Description of argument(s): |
| 1124 | # ipv6_gw_addr IPv6 static default gateway address to be replaced (e.g. "2001:AABB:CCDD::AAFF"). |
| 1125 | # new_static_def_gw New static default gateway address to be configured. |
| Sridevi Ramesh | ed94c69 | 2025-09-07 23:41:10 -0500 | [diff] [blame] | 1126 | # prefix_length Prefix length value (Range 1 to 128). |
| Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 1127 | # valid_status_codes Expected return code from patch operation |
| 1128 | # (e.g. "200", "204"). |
| Sweta Potthuri | 2edacd3 | 2025-07-02 01:04:43 -0500 | [diff] [blame] | 1129 | |
| Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 1130 | ${empty_dict}= Create Dictionary |
| 1131 | ${patch_list}= Create List |
| 1132 | # Prefix Length is passed as None. |
| 1133 | IF '${prefix_length_def}' == '${None}' |
| 1134 | ${modified_ipv6_gw_addripv6_data}= Create Dictionary Address=${new_static_def_gw} |
| 1135 | ELSE |
| 1136 | ${modified_ipv6_gw_addripv6_data}= Create Dictionary Address=${new_static_def_gw} Prefix Length=${prefix_length_def} |
| 1137 | END |
| Sweta Potthuri | 2edacd3 | 2025-07-02 01:04:43 -0500 | [diff] [blame] | 1138 | |
| Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 1139 | @{ipv6_static_def_gw_list}= Get IPv6 Static Default Gateway |
| 1140 | |
| 1141 | FOR ${ipv6_static_def_gw} IN @{ipv6_static_def_gw_list} |
| 1142 | IF '${ipv6_static_def_gw['Address']}' == '${ipv6_gw_addr}' |
| 1143 | Append To List ${patch_list} ${modified_ipv6_gw_addripv6_data} |
| 1144 | ELSE |
| 1145 | Append To List ${patch_list} ${empty_dict} |
| 1146 | END |
| 1147 | END |
| 1148 | |
| 1149 | # Modify the IPv6 address only if given IPv6 static default gateway is found. |
| 1150 | ${ip_static_def_gw_found}= Run Keyword And Return Status List Should Contain Value |
| 1151 | ... ${patch_list} ${modified_ipv6_gw_addripv6_data} msg=${ipv6_gw_addr} does not exist on BMC |
| 1152 | Pass Execution If ${ip_static_def_gw_found} == ${False} ${ipv6_gw_addr} does not exist on BMC |
| 1153 | |
| 1154 | ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list} |
| 1155 | |
| 1156 | Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 1157 | ... body=&{data} valid_status_codes=${valid_status_codes} |
| 1158 | |
| 1159 | ${ipv6_staticdef_gateway}= Get IPv6 Static Default Gateway |
| 1160 | |
| 1161 | ${ipv6_static_def_gw_list}= Create List |
| 1162 | FOR ${ipv6_staticdef_gateway} IN @{ipv6_staticdef_gateway} |
| Sweta Potthuri | 2d08573 | 2025-07-16 09:10:08 -0500 | [diff] [blame] | 1163 | ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address |
| Sweta Potthuri | 4b0083f | 2025-07-09 11:34:40 -0500 | [diff] [blame] | 1164 | Append To List ${ipv6_static_def_gw_list} ${value} |
| 1165 | END |
| 1166 | |
| 1167 | Should Contain ${ipv6_static_def_gw_list} ${new_static_def_gw} |
| 1168 | # Verify if old static default gateway address is erased. |
| 1169 | Should Not Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr} |
| 1170 | |
| Sweta Potthuri | 2d08573 | 2025-07-16 09:10:08 -0500 | [diff] [blame] | 1171 | |
| 1172 | Delete IPv6 Static Default Gateway |
| 1173 | [Documentation] Delete IPv6 static default gateway on BMC. |
| 1174 | [Arguments] ${ipv6_gw_addr} |
| 1175 | ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}] |
| 1176 | |
| 1177 | # Description of argument(s): |
| 1178 | # ipv6_gw_addr IPv6 Static Default Gateway address to be deleted. |
| 1179 | # valid_status_codes Expected return code from patch operation |
| 1180 | # (e.g. "200"). |
| 1181 | |
| 1182 | ${patch_list}= Create List |
| 1183 | ${empty_dict}= Create Dictionary |
| 1184 | |
| 1185 | ${ipv6_static_def_gw_list}= Create List |
| 1186 | @{ipv6_static_defgw_configurations}= Get IPv6 Static Default Gateway |
| 1187 | |
| 1188 | FOR ${ipv6_staticdef_gateway} IN @{ipv6_static_defgw_configurations} |
| 1189 | ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address |
| 1190 | Append To List ${ipv6_static_def_gw_list} ${value} |
| 1191 | END |
| 1192 | |
| 1193 | ${defgw_found}= Run Keyword And Return Status List Should Contain Value |
| 1194 | ... ${ipv6_static_def_gw_list} ${ipv6_gw_addr} msg=${ipv6_gw_addr} does not exist on BMC |
| 1195 | Skip If ${defgw_found} == ${False} ${ipv6_gw_addr} does not exist on BMC |
| 1196 | |
| 1197 | FOR ${ipv6_static_def_gw} IN @{ipv6_static_defgw_configurations} |
| 1198 | IF '${ipv6_static_def_gw['Address']}' == '${ipv6_gw_addr}' |
| 1199 | Append To List ${patch_list} ${null} |
| 1200 | ELSE |
| 1201 | Append To List ${patch_list} ${empty_dict} |
| 1202 | END |
| 1203 | END |
| 1204 | |
| 1205 | # Run patch command only if given IP is found on BMC. |
| 1206 | ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list} |
| 1207 | |
| 1208 | Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data} |
| 1209 | ... valid_status_codes=${valid_status_codes} |
| 1210 | |
| 1211 | ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list} |
| 1212 | |
| 1213 | @{ipv6_static_defgw_configurations}= Get IPv6 Static Default Gateway |
| 1214 | Should Not Contain Match ${ipv6_static_defgw_configurations} ${ipv6_gw_addr} |
| 1215 | ... msg=IPv6 Static default gateway does not exist. |
| Sweta Potthuri | 35c503b | 2025-07-27 23:36:20 -0500 | [diff] [blame] | 1216 | |
| 1217 | |
| 1218 | Check Coexistence Of Linklocalv6 And Static IPv6 |
| 1219 | [Documentation] Verify both linklocalv6 and static IPv6 exist. |
| 1220 | |
| Sweta Potthuri | 35c503b | 2025-07-27 23:36:20 -0500 | [diff] [blame] | 1221 | # Verify the address origin contains static and linklocal. |
| Sweta Potthuri | 71f7bdc | 2025-08-10 03:08:10 -0500 | [diff] [blame] | 1222 | @{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] | 1223 | |
| Sweta Potthuri | 35c503b | 2025-07-27 23:36:20 -0500 | [diff] [blame] | 1224 | Should Match Regexp ${ipv6_linklocal_addr} ${linklocal_addr_format} |
| Sweta Potthuri | 35c503b | 2025-07-27 23:36:20 -0500 | [diff] [blame] | 1225 | Should Contain ${ipv6_addressorigin_list} Static |
| Sweta Potthuri | 3c6f97d | 2025-08-06 00:30:19 -0500 | [diff] [blame] | 1226 | |
| 1227 | |
| abhijith-121 | 97078c5 | 2025-09-25 01:13:00 -0500 | [diff] [blame] | 1228 | Check Coexistence Of Static IPv6 And SLAAC |
| abhijith-121 | 4dc01a0 | 2025-09-24 11:29:55 -0500 | [diff] [blame] | 1229 | [Documentation] Verify both static IPv6 and SLAAC coexist. |
| abhijith-121 | 97078c5 | 2025-09-25 01:13:00 -0500 | [diff] [blame] | 1230 | |
| 1231 | # Verify the address origin contains static and slaac. |
| 1232 | @{ipv6_addressorigin_list} ${ipv6_static_addr}= |
| 1233 | ... Get Address Origin List And Address For Type Static |
| 1234 | |
| 1235 | @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= |
| 1236 | ... Get Address Origin List And Address For Type SLAAC |
| 1237 | |
| 1238 | |
| abhijith-121 | 4dc01a0 | 2025-09-24 11:29:55 -0500 | [diff] [blame] | 1239 | Check Coexistence Of Link Local And SLAAC |
| 1240 | [Documentation] Verify both link local and SLAAC coexist. |
| 1241 | |
| 1242 | # Verify the address origin contains SLAAC and link local. |
| 1243 | @{ipv6_addressorigin_list} ${ipv6_link_local_addr}= |
| 1244 | ... Get Address Origin List And Address For Type LinkLocal |
| 1245 | |
| 1246 | @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= |
| 1247 | ... Get Address Origin List And Address For Type SLAAC |
| 1248 | |
| 1249 | Should Match Regexp ${ipv6_link_local_addr} ${linklocal_addr_format} |
| 1250 | |
| 1251 | |
| abhijith-121 | 8ff5db4 | 2025-09-24 06:24:03 -0500 | [diff] [blame] | 1252 | Check Coexistence Of Link Local And DHCPv6 |
| 1253 | [Documentation] Verify both link local and dhcpv6 coexist. |
| 1254 | |
| 1255 | # Verify the address origin contains dhcpv6 and link local. |
| 1256 | @{ipv6_address_origin_list} ${ipv6_link_local_addr}= |
| 1257 | ... Get Address Origin List And Address For Type LinkLocal |
| 1258 | |
| 1259 | @{ipv6_address_origin_list} ${ipv6_dhcpv6_addr}= |
| 1260 | ... Get Address Origin List And Address For Type DHCPv6 |
| 1261 | |
| 1262 | Should Match Regexp ${ipv6_link_local_addr} ${linklocal_addr_format} |
| 1263 | |
| 1264 | |
| Sweta Potthuri | 3c6f97d | 2025-08-06 00:30:19 -0500 | [diff] [blame] | 1265 | Check If Linklocal Address Is In Correct Format |
| 1266 | [Documentation] Linklocal address has network part fe80 and host part EUI64. |
| 1267 | |
| 1268 | # Fetch the linklocal address. |
| Sweta Potthuri | 71f7bdc | 2025-08-10 03:08:10 -0500 | [diff] [blame] | 1269 | @{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] | 1270 | |
| 1271 | # Follow EUI64 from MAC. |
| 1272 | ${system_mac}= Get BMC MAC Address |
| 1273 | ${split_octets}= Split String ${system_mac} : |
| 1274 | ${first_octet}= Evaluate int('${split_octets[0]}', 16) |
| 1275 | ${flipped_hex}= Evaluate format(${first_octet} ^ 2, '02x') |
| 1276 | ${grp1}= Evaluate re.sub(r'^0+', '', '${flipped_hex}${split_octets[1]}') modules=re |
| 1277 | ${grp2}= Evaluate re.sub(r'^0+', '', '${split_octets[2]}ff') modules=re |
| 1278 | ${grp3}= Evaluate re.sub(r'^0+', '', '${split_octets[4]}${split_octets[5]}') modules=re |
| 1279 | ${linklocal}= Set Variable fe80::${grp1}:${grp2}:fe${split_octets[3]}:${grp3} |
| 1280 | |
| 1281 | # Verify the linklocal obtained is the same as on the machine. |
| 1282 | Should Be Equal ${linklocal} ${ipv6_linklocal_addr} |
| 1283 | |
| Sweta Potthuri | 71f7bdc | 2025-08-10 03:08:10 -0500 | [diff] [blame] | 1284 | |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1285 | Check BMC Gets SLAAC Address |
| 1286 | [Documentation] Check BMC gets slaac address. |
| Sweta Potthuri | 71f7bdc | 2025-08-10 03:08:10 -0500 | [diff] [blame] | 1287 | |
| 1288 | @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= Get Address Origin List And Address For Type SLAAC |
| 1289 | |
| Sweta Potthuri | 71f7bdc | 2025-08-10 03:08:10 -0500 | [diff] [blame] | 1290 | |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1291 | Get The Initial DHCPv6 Setting On Each Interface |
| 1292 | [Documentation] Get the initial DHCPv6 setting of each interface. |
| 1293 | [Arguments] ${channel_number} |
| Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 1294 | |
| 1295 | # Description of the argument(s): |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1296 | # channel_number Channel number 1 or 2. |
| Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 1297 | |
| 1298 | ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']} |
| 1299 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 1300 | ${initial_dhcpv6_iface}= Get From Dictionary ${resp.dict} DHCPv6 |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1301 | IF ${channel_number}==${1} |
| 1302 | Set Test Variable ${dhcpv6_channel_1} ${initial_dhcpv6_iface['OperatingMode']} |
| 1303 | ELSE |
| 1304 | Set Test Variable ${dhcpv6_channel_2} ${initial_dhcpv6_iface['OperatingMode']} |
| 1305 | END |
| 1306 | |
| 1307 | |
| 1308 | Get The Initial DHCPv6 Settings |
| 1309 | [Documentation] Get the initial DHCPv6 settings of both the interfaces. |
| 1310 | |
| 1311 | Get The Initial DHCPv6 Setting On Each Interface ${1} |
| 1312 | Get The Initial DHCPv6 Setting On Each Interface ${2} |
| 1313 | |
| 1314 | |
| 1315 | Get The Initial SLAAC Settings |
| 1316 | [Documentation] Get the initial SLAAC settings of both the interfaces. |
| 1317 | |
| Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 1318 | Get The Initial SLAAC Setting On Each Interface ${1} |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1319 | Get The Initial SLAAC Setting On Each Interface ${2} |
| 1320 | |
| 1321 | |
| 1322 | Get The Initial SLAAC Setting On Each Interface |
| 1323 | [Documentation] Get the initial SLAAC setting of the interface. |
| 1324 | [Arguments] ${channel_number} |
| 1325 | |
| 1326 | # Description of the argument(s): |
| 1327 | # channel_number Channel number 1 or 2. |
| 1328 | |
| 1329 | ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']} |
| 1330 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 1331 | ${initial_slaac_iface}= Get From Dictionary ${resp.dict} StatelessAddressAutoConfig |
| 1332 | IF ${channel_number}==${1} |
| 1333 | Set Test Variable ${slaac_channel_1} ${initial_slaac_iface['IPv6AutoConfigEnabled']} |
| 1334 | ELSE |
| 1335 | Set Test Variable ${slaac_channel_2} ${initial_slaac_iface['IPv6AutoConfigEnabled']} |
| 1336 | END |
| Sweta Potthuri | db4a6d6 | 2025-08-18 11:29:16 -0500 | [diff] [blame] | 1337 | |
| 1338 | |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1339 | Get Address Origin List And IPv4 or IPv6 Address |
| 1340 | [Documentation] Get address origin list and address for type. |
| Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 1341 | [Arguments] ${ip_address_type} ${channel_number}=${CHANNEL_NUMBER} |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1342 | |
| 1343 | # Description of the argument(s): |
| Sridevi Ramesh | ed94c69 | 2025-09-07 23:41:10 -0500 | [diff] [blame] | 1344 | # ip_address_type Type of IPv4 or IPv6 address to be checked. |
| Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 1345 | # channel_number Channel number 1(eth0) or 2(eth1). |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1346 | |
| Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 1347 | ${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] | 1348 | @{ip_addresses}= Get From Dictionary ${resp.dict} ${ip_address_type} |
| 1349 | |
| 1350 | ${ip_addressorigin_list}= Create List |
| 1351 | ${ip_addr_list}= Create List |
| 1352 | FOR ${ip_address} IN @{ip_addresses} |
| 1353 | ${ip_addressorigin}= Get From Dictionary ${ip_address} AddressOrigin |
| 1354 | Append To List ${ip_addressorigin_list} ${ip_addressorigin} |
| 1355 | Append To List ${ip_addr_list} ${ip_address['Address']} |
| 1356 | END |
| 1357 | RETURN ${ip_addressorigin_list} ${ip_addr_list} |
| 1358 | |
| 1359 | |
| 1360 | Verify All The Addresses Are Intact |
| 1361 | [Documentation] Verify all the addresses and address origins remain intact. |
| Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 1362 | [Arguments] ${channel_number}=${CHANNEL_NUMBER} |
| 1363 | ... ${initial_ipv4_addressorigin_list}=${initial_ipv4_addressorigin_list} |
| 1364 | ... ${initial_ipv4_addr_list}=${initial_ipv4_addr_list} |
| 1365 | |
| 1366 | # Description of argument(s): |
| 1367 | # channel_number Channel number 1(eth0) or 2(eth1). |
| 1368 | # initial_ipv4_addressorigin_list Initial IPv4 address origin list. |
| 1369 | # initial_ipv4_addr_list Initial IPv4 address list. |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1370 | |
| 1371 | # Verify that it will not impact the IPv4 configuration. |
| 1372 | Sleep ${NETWORK_TIMEOUT} |
| 1373 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 1374 | |
| Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 1375 | # IPv6 Linklocal address must be present. |
| 1376 | @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= |
| 1377 | ... Get Address Origin List And Address For Type LinkLocal ${channel_number} |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1378 | |
| Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 1379 | # IPv4 addresses must remain intact. |
| 1380 | ${ipv4_addressorigin_list} ${ipv4_addr_list}= |
| 1381 | ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${channel_number} |
| Sweta Potthuri | abbbeae | 2025-08-21 00:06:26 -0500 | [diff] [blame] | 1382 | |
| 1383 | Should be Equal ${initial_ipv4_addressorigin_list} ${ipv4_addressorigin_list} |
| 1384 | Should be Equal ${initial_ipv4_addr_list} ${ipv4_addr_list} |
| Sweta Potthuri | f3d188f | 2025-09-08 07:17:31 -0500 | [diff] [blame] | 1385 | |
| 1386 | |
| 1387 | Get Interface ID Of IPv6 |
| 1388 | [Documentation] Get interface id of IPv6 address. |
| 1389 | [Arguments] ${ipv6_address} |
| 1390 | |
| 1391 | # Description of the argument(s): |
| 1392 | # ${ipv6_address} IPv6 Address to extract the last 4 hextets. |
| 1393 | |
| 1394 | # Last 64 bits of SLAAC and Linklocal must be the same. |
| 1395 | # Sample IPv6 network configurations. |
| 1396 | #"IPv6AddressPolicyTable": [], |
| 1397 | # "IPv6Addresses": [ |
| 1398 | # { |
| 1399 | # "Address": "fe80::xxxx:xxxx:xxxx:xxxx", |
| 1400 | # "AddressOrigin": "LinkLocal", |
| 1401 | # "AddressState": null, |
| 1402 | # "PrefixLength": xx |
| 1403 | # } |
| 1404 | # ], |
| 1405 | # { |
| 1406 | # "Address": "2002:xxxx:xxxx:xxxx:xxxx", |
| 1407 | # "AddressOrigin": "SLAAC", |
| 1408 | # "PrefixLength": 64 |
| 1409 | # } |
| 1410 | # ], |
| 1411 | |
| 1412 | ${split_ip_address}= Split String ${ipv6_address} : |
| 1413 | ${missing_ip}= Evaluate 8 - len(${split_ip_address}) + 1 |
| 1414 | ${expanded_ip}= Create List |
| 1415 | |
| 1416 | FOR ${hextet} IN @{split_ip_address} |
| 1417 | IF '${hextet}' == '' |
| 1418 | FOR ${i} IN RANGE ${missing_ip} |
| 1419 | Append To List ${expanded_ip} 0000 |
| 1420 | END |
| 1421 | ELSE |
| 1422 | Append To List ${expanded_ip} ${hextet} |
| 1423 | END |
| 1424 | END |
| 1425 | ${interface_id}= Evaluate ':'.join(${expanded_ip}[-4:]) |
| 1426 | RETURN ${interface_id} |
| Sweta Potthuri | 6370afd | 2025-10-08 00:07:46 -0500 | [diff] [blame] | 1427 | |
| 1428 | |
| 1429 | Set And Verify SLAAC Property On Both Interfaces |
| 1430 | [Documentation] Set and verify SLAAC property on both interfaces. |
| 1431 | [Arguments] ${slaac_value_1} ${slaac_value_2} |
| 1432 | |
| 1433 | # Description of the argument(s): |
| 1434 | # slaac_value_1 SLAAC value for channel 1. |
| 1435 | # slaac_value_2 SLAAC value for channel 2. |
| 1436 | |
| 1437 | Set SLAAC Configuration State And Verify ${slaac_value_1} [${HTTP_OK}] ${1} |
| 1438 | Set SLAAC Configuration State And Verify ${slaac_value_2} [${HTTP_OK}] ${2} |
| 1439 | |
| 1440 | Sleep 30s |
| 1441 | |
| 1442 | # Check SLAAC Settings for eth0. |
| 1443 | @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= |
| 1444 | ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${1} |
| 1445 | IF "${slaac_value_1}" == "${True}" |
| 1446 | Should Not Be Empty ${ipv6_slaac_addr} SLAAC |
| 1447 | ELSE |
| 1448 | Should Not Contain ${ipv6_addressorigin_list} SLAAC |
| 1449 | END |
| 1450 | |
| 1451 | # Check SLAAC Settings for eth1. |
| 1452 | @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= |
| 1453 | ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${2} |
| 1454 | IF "${slaac_value_2}" == "${True}" |
| 1455 | Should Not Be Empty ${ipv6_slaac_addr} SLAAC |
| 1456 | ELSE |
| 1457 | Should Not Contain ${ipv6_addressorigin_list} SLAAC |
| 1458 | END |
| 1459 | |
| 1460 | Verify All The Addresses Are Intact ${1} |
| 1461 | Verify All The Addresses Are Intact ${2} |
| 1462 | ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list} |
| 1463 | |
| Sweta Potthuri | 425713a | 2025-10-16 00:28:20 -0500 | [diff] [blame] | 1464 | |
| 1465 | Set And Verify DHCPv6 Property On Both Interfaces |
| 1466 | [Documentation] Set and verify DHCPv6 property on both interfaces. |
| 1467 | [Arguments] ${dhcpv6_value_1} ${dhcpv6_value_2} |
| 1468 | |
| 1469 | # Description of the argument(s): |
| 1470 | # dhcpv6_value_1 DHCPv6 value for channel 1. |
| 1471 | # dhcpv6_value_2 DHCPv6 value for channel 2. |
| 1472 | |
| 1473 | Set And Verify DHCPv6 Property ${dhcpv6_value_1} ${1} |
| 1474 | Set And Verify DHCPv6 Property ${dhcpv6_value_2} ${2} |
| 1475 | |
| 1476 | Verify All The Addresses Are Intact ${1} |
| 1477 | Verify All The Addresses Are Intact ${2} |
| 1478 | ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list} |
| abhijith-121 | d8322b7 | 2025-10-13 02:23:48 -0500 | [diff] [blame] | 1479 | |
| 1480 | |
| 1481 | Verify IPv6 Addresses Coexist |
| 1482 | [Documentation] Verify IPv6 address type coexist. |
| 1483 | [Arguments] ${ipv6_address_type1} ${ipv6_address_type2} |
| 1484 | |
| 1485 | # Description of the argument(s): |
| 1486 | # ipv6_address_type1 IPv6 address type. |
| 1487 | # ipv6_address_type2 IPv6 address type. |
| 1488 | # Valid IPv6 address type (Static, DHCPv6, SLAAC). |
| 1489 | |
| 1490 | IF '${ipv6_address_type1}' == 'Static' and '${ipv6_address_type2}' == 'DHCPv6' |
| 1491 | Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} |
| 1492 | Set And Verify DHCPv6 Property Enabled |
| 1493 | ELSE IF '${ipv6_address_type1}' == 'DHCPv6' and '${ipv6_address_type2}' == 'SLAAC' |
| 1494 | Set And Verify DHCPv6 Property Enabled |
| 1495 | Set SLAAC Configuration State And Verify ${True} |
| 1496 | ELSE IF '${ipv6_address_type1}' == 'SLAAC' and '${ipv6_address_type2}' == 'Static' |
| 1497 | Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} |
| 1498 | Set SLAAC Configuration State And Verify ${True} |
| 1499 | ELSE IF '${ipv6_address_type1}' == 'Static' and '${ipv6_address_type2}' == 'Static' |
| 1500 | Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} |
| 1501 | Configure IPv6 Address On BMC ${test_ipv6_addr1} ${test_prefix_length} |
| 1502 | END |
| 1503 | |
| 1504 | Sleep ${NETWORK_TIMEOUT}s |
| 1505 | |
| 1506 | # Verify coexistence. |
| 1507 | Verify The Coexistence Of The Address Type ${ipv6_address_type1} ${ipv6_address_type2} |
| 1508 | |
| 1509 | IF '${ipv6_address_type1}' == 'Static' or '${ipv6_address_type2}' == 'Static' |
| 1510 | Delete IPv6 Address ${test_ipv6_addr} |
| 1511 | END |
| 1512 | IF '${ipv6_address_type1}' == 'Static' and '${ipv6_address_type2}' == 'Static' |
| 1513 | Delete IPv6 Address ${test_ipv6_addr1} |
| 1514 | END |
| 1515 | |
| 1516 | Set And Verify DHCPv6 Property Disabled |
| 1517 | Set SLAAC Configuration State And Verify ${False} |