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