| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Vmi network utilities keywords. |
| 3 | |
| 4 | Resource ../../lib/resource.robot |
| 5 | Resource ../../lib/bmc_redfish_resource.robot |
| 6 | Resource ../../lib/openbmc_ffdc.robot |
| 7 | Resource ../../lib/bmc_redfish_utils.robot |
| 8 | Resource ../../lib/state_manager.robot |
| shrsuman123 | 7ba02f3 | 2021-08-26 04:50:56 -0500 | [diff] [blame] | 9 | Resource ../../lib/bmc_network_utils.robot |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 10 | Library ../../lib/bmc_network_utils.py |
| 11 | |
| 12 | *** Variables *** |
| 13 | |
| shrsuman123 | 7e9b212 | 2021-09-28 06:06:16 -0500 | [diff] [blame] | 14 | &{DHCP_ENABLED} DHCPEnabled=${True} |
| 15 | &{DHCP_DISABLED} DHCPEnabled=${False} |
| 16 | |
| 17 | &{ENABLE_DHCP} DHCPv4=&{DHCP_ENABLED} |
| 18 | &{DISABLE_DHCP} DHCPv4=&{DHCP_DISABLED} |
| 19 | |
| Megha G N | a214833 | 2025-03-06 07:28:15 -0600 | [diff] [blame] | 20 | &{SLAAC_ENABLED} IPv6AutoConfigEnabled=${True} |
| 21 | &{SLAAC_DISABLED} IPv6AutoConfigEnabled=${False} |
| 22 | |
| 23 | &{ENABLE_SLAAC} StatelessAddressAutoConfig=&{SLAAC_ENABLED} |
| 24 | &{DISABLE_SLAAC} StatelessAddressAutoConfig=&{SLAAC_DISABLED} |
| 25 | |
| 26 | &{DHCPv6_ENABLED} OperatingMode=Enabled |
| 27 | &{DHCPv6_DISABLED} OperatingMode=Disabled |
| 28 | |
| 29 | &{ENABLE_DHCPv6} DHCPv6=&{DHCPv6_ENABLED} |
| 30 | &{DISABLE_DHCPv6} DHCPv6=&{DHCPv6_DISABLED} |
| 31 | |
| Megha G N | a9cf2d8 | 2023-10-09 07:41:11 -0500 | [diff] [blame] | 32 | ${wait_time} 40s |
| shrsuman123 | a035578 | 2021-10-18 05:56:56 -0500 | [diff] [blame] | 33 | ${ethernet_interface} eth0 |
| Sweta Potthuri | cb61ff0 | 2025-04-09 05:16:09 -0500 | [diff] [blame] | 34 | ${ipv4_hexword_addr} 10.5.5.6:1A:1B:1C:1D:1E:1F |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 35 | |
| 36 | *** Keywords *** |
| 37 | |
| 38 | Set Static IPv4 Address To VMI And Verify |
| 39 | [Documentation] Set static IPv4 address to VMI. |
| 40 | [Arguments] ${ip} ${gateway} ${netmask} ${valid_status_code}=${HTTP_ACCEPTED} |
| shrsuman123 | a035578 | 2021-10-18 05:56:56 -0500 | [diff] [blame] | 41 | ... ${interface}=${ethernet_interface} |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 42 | |
| 43 | # Description of argument(s): |
| 44 | # ip VMI IPv4 address. |
| 45 | # gateway Gateway for VMI IP. |
| 46 | # netmask Subnetmask for VMI IP. |
| 47 | # valid_status_code Expected valid status code from GET request. Default is HTTP_ACCEPTED. |
| shrsuman123 | 298e804 | 2021-08-20 07:36:21 -0500 | [diff] [blame] | 48 | # interface VMI interface (eg. eth0 or eth1). |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 49 | |
| shrsuman123 | 298e804 | 2021-08-20 07:36:21 -0500 | [diff] [blame] | 50 | ${ip_details}= Create dictionary Address=${ip} SubnetMask=${netmask} Gateway=${gateway} |
| 51 | ${ip_data}= Create List ${ip_details} |
| 52 | ${resp}= Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| 53 | ... body={'IPv4StaticAddresses':${ip_data}} valid_status_codes=[${valid_status_code}] |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 54 | |
| 55 | # Wait few seconds for new configuration to get populated on runtime. |
| 56 | Sleep ${wait_time} |
| 57 | |
| 58 | Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED} |
| 59 | ${host_power_state} ${host_state}= Redfish Get Host State |
| Sridevi Ramesh | fcbb554 | 2025-11-05 02:01:34 -0600 | [diff] [blame^] | 60 | IF '${host_power_state}' == 'On' and '${host_state}' == 'Enabled' |
| 61 | Verify VMI Network Interface Details ${ip} Static ${gateway} ${netmask} ${interface} |
| 62 | END |
| 63 | |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 64 | |
| 65 | Verify VMI Network Interface Details |
| 66 | [Documentation] Verify VMI network interface details. |
| 67 | [Arguments] ${ip} ${origin} ${gateway} ${netmask} |
| shrsuman123 | a035578 | 2021-10-18 05:56:56 -0500 | [diff] [blame] | 68 | ... ${interface}=${ethernet_interface} ${valid_status_code}=${HTTP_OK} |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 69 | |
| 70 | # Description of argument(s): |
| 71 | # ip VMI IPv4 address. |
| 72 | # origin Origin of IPv4 address eg. Static or DHCP. |
| 73 | # gateway Gateway for VMI IP. |
| 74 | # netmask Subnetmask for VMI IP. |
| shrsuman123 | 298e804 | 2021-08-20 07:36:21 -0500 | [diff] [blame] | 75 | # interface VMI interface (eg. eth0 or eth1). |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 76 | # valid_status_code Expected valid status code from GET request. Default is HTTP_OK. |
| 77 | |
| shrsuman123 | 298e804 | 2021-08-20 07:36:21 -0500 | [diff] [blame] | 78 | ${vmi_ip}= Get VMI Network Interface Details ${interface} ${valid_status_code} |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 79 | Should Be Equal As Strings ${origin} ${vmi_ip["IPv4_AddressOrigin"]} |
| 80 | Should Be Equal As Strings ${gateway} ${vmi_ip["IPv4_Gateway"]} |
| 81 | Should Be Equal As Strings ${netmask} ${vmi_ip["IPv4_SubnetMask"]} |
| 82 | Should Be Equal As Strings ${ip} ${vmi_ip["IPv4_Address"]} |
| 83 | |
| 84 | Delete VMI IPv4 Address |
| 85 | [Documentation] Delete VMI IPv4 address. |
| 86 | [Arguments] ${delete_param}=IPv4StaticAddresses ${valid_status_code}=${HTTP_ACCEPTED} |
| shrsuman123 | a035578 | 2021-10-18 05:56:56 -0500 | [diff] [blame] | 87 | ... ${interface}=${ethernet_interface} |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 88 | |
| 89 | # Description of argument(s): |
| 90 | # delete_param Parameter to be deleted eg. IPv4StaticAddresses or IPv4Addresses. |
| 91 | # Default is IPv4StaticAddresses. |
| 92 | # valid_status_code Expected valid status code from PATCH request. Default is HTTP_OK. |
| shrsuman123 | 298e804 | 2021-08-20 07:36:21 -0500 | [diff] [blame] | 93 | # interface VMI interface (eg. eth0 or eth1). |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 94 | |
| 95 | ${data}= Set Variable {"${delete_param}": [${Null}]} |
| 96 | ${resp}= Redfish.Patch |
| shrsuman123 | 298e804 | 2021-08-20 07:36:21 -0500 | [diff] [blame] | 97 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 98 | ... body=${data} valid_status_codes=[${valid_status_code}] |
| 99 | |
| 100 | Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED} |
| shrsuman123 | a3759b3 | 2021-11-02 02:50:42 -0500 | [diff] [blame] | 101 | |
| 102 | # Wait few seconds for configuration to get effective. |
| 103 | Sleep ${wait_time} |
| shrsuman123 | 298e804 | 2021-08-20 07:36:21 -0500 | [diff] [blame] | 104 | ${vmi_ip}= Get VMI Network Interface Details ${interface} |
| Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 105 | ${default}= Set Variable 0.0.0.0 |
| 106 | Verify VMI Network Interface Details ${default} Static ${default} ${default} |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 107 | |
| 108 | Set VMI IPv4 Origin |
| 109 | [Documentation] Set VMI IPv4 origin. |
| 110 | [Arguments] ${dhcp_enabled}=${False} ${valid_status_code}=${HTTP_ACCEPTED} |
| shrsuman123 | a035578 | 2021-10-18 05:56:56 -0500 | [diff] [blame] | 111 | ... ${interface}=${ethernet_interface} |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 112 | |
| 113 | # Description of argument(s): |
| 114 | # dhcp_enabled True if user wants to enable DHCP. Default is Static, hence value is set to False. |
| 115 | # valid_status_code Expected valid status code from PATCH request. Default is HTTP_OK. |
| shrsuman123 | 298e804 | 2021-08-20 07:36:21 -0500 | [diff] [blame] | 116 | # interface VMI interface (eg. eth0 or eth1). |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 117 | |
| 118 | ${data}= Set Variable If ${dhcp_enabled} == ${False} ${DISABLE_DHCP} ${ENABLE_DHCP} |
| 119 | ${resp}= Redfish.Patch |
| shrsuman123 | 298e804 | 2021-08-20 07:36:21 -0500 | [diff] [blame] | 120 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 121 | ... body=${data} valid_status_codes=[${valid_status_code}] |
| 122 | |
| 123 | Sleep ${wait_time} |
| 124 | Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED} |
| 125 | ${resp}= Redfish.Get |
| shrsuman123 | 298e804 | 2021-08-20 07:36:21 -0500 | [diff] [blame] | 126 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 127 | Should Be Equal ${resp.dict["DHCPv4"]["DHCPEnabled"]} ${dhcp_enabled} |
| 128 | |
| Megha G N | a9cf2d8 | 2023-10-09 07:41:11 -0500 | [diff] [blame] | 129 | |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 130 | Get VMI Network Interface Details |
| 131 | [Documentation] Get VMI network interface details. |
| shrsuman123 | a035578 | 2021-10-18 05:56:56 -0500 | [diff] [blame] | 132 | [Arguments] ${interface}=${ethernet_interface} ${valid_status_code}=${HTTP_OK} |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 133 | |
| 134 | # Description of argument(s): |
| shrsuman123 | 298e804 | 2021-08-20 07:36:21 -0500 | [diff] [blame] | 135 | # interface VMI interface (eg. eth0 or eth1). |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 136 | # valid_status_code Expected valid status code from GET request. |
| 137 | |
| 138 | # Note: It returns a dictionary of VMI ethernet interface parameters. |
| 139 | |
| 140 | ${resp}= Redfish.Get |
| shrsuman123 | 298e804 | 2021-08-20 07:36:21 -0500 | [diff] [blame] | 141 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 142 | ... valid_status_codes=[${valid_status_code}] |
| 143 | |
| 144 | ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json |
| 145 | |
| 146 | ${ip_exists}= Set Variable If ${ip_resp["IPv4Addresses"]} == @{empty} ${False} ${True} |
| 147 | ${static_exists}= Set Variable If ${ip_resp["IPv4StaticAddresses"]} == @{empty} ${False} ${True} |
| 148 | |
| Sridevi Ramesh | fcbb554 | 2025-11-05 02:01:34 -0600 | [diff] [blame^] | 149 | ${vmi_ip}= Set Variable If ${ip_exists} == ${True} |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 150 | ... Create Dictionary DHCPv4=${${ip_resp["DHCPv4"]["DHCPEnabled"]}} Id=${ip_resp["Id"]} |
| 151 | ... Description=${ip_resp["Description"]} IPv4_Address=${ip_resp["IPv4Addresses"][0]["Address"]} |
| 152 | ... IPv4_AddressOrigin=${ip_resp["IPv4Addresses"][0]["AddressOrigin"]} Name=${ip_resp["Name"]} |
| 153 | ... IPv4_Gateway=${ip_resp["IPv4Addresses"][0]["Gateway"]} |
| 154 | ... InterfaceEnabled=${${ip_resp["InterfaceEnabled"]}} |
| 155 | ... IPv4_SubnetMask=${ip_resp["IPv4Addresses"][0]["SubnetMask"]} |
| 156 | ... IPv4StaticAddresses=${${static_exists}} |
| 157 | ... ELSE |
| 158 | ... Create Dictionary DHCPv4=${${ip_resp["DHCPv4"]["DHCPEnabled"]}} Id=${ip_resp["Id"]} |
| 159 | ... Description=${ip_resp["Description"]} IPv4StaticAddresses=${ip_resp["IPv4StaticAddresses"]} |
| 160 | ... IPv4_Address=${ip_resp["IPv4Addresses"]} Name=${ip_resp["Name"]} |
| 161 | ... InterfaceEnabled=${${ip_resp["InterfaceEnabled"]}} |
| 162 | |
| George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 163 | RETURN &{vmi_ip} |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 164 | |
| shrsuman123 | 298e804 | 2021-08-20 07:36:21 -0500 | [diff] [blame] | 165 | |
| 166 | Get VMI Interfaces |
| 167 | [Documentation] Get VMI network interface. |
| 168 | [Arguments] ${valid_status_code}=${HTTP_OK} |
| 169 | |
| 170 | # Description of argument(s): |
| 171 | # valid_status_code Expected valid status code from GET request. |
| 172 | # By default set to ${HTTP_OK}. |
| 173 | |
| 174 | ${resp}= Redfish.Get /redfish/v1/Systems/hypervisor/EthernetInterfaces |
| 175 | ... valid_status_codes=[${valid_status_code}] |
| 176 | |
| 177 | ${resp}= Evaluate json.loads(r'''${resp.text}''') json |
| 178 | ${interfaces_uri}= Set Variable ${resp["Members"]} |
| 179 | ${interface_list}= Create List |
| 180 | ${number_of_interfaces}= Get Length ${interfaces_uri} |
| 181 | FOR ${interface} IN RANGE ${number_of_interfaces} |
| 182 | ${_} ${interface_value}= Split String From Right ${interfaces_uri[${interface}]}[@odata.id] / 1 |
| 183 | Append To List ${interface_list} ${interface_value} |
| 184 | END |
| 185 | |
| George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 186 | RETURN @{interface_list} |
| shrsuman123 | 298e804 | 2021-08-20 07:36:21 -0500 | [diff] [blame] | 187 | |
| 188 | |
| Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 189 | Verify VMI EthernetInterfaces |
| 190 | [Documentation] Verify VMI ethernet interfaces. |
| 191 | [Arguments] ${valid_status_code}=${HTTP_OK} |
| 192 | |
| 193 | # Description of argument(s): |
| 194 | # valid_status_code Expected valid status code from GET request. |
| 195 | |
| 196 | ${resp}= Redfish.Get /redfish/v1/Systems/hypervisor/EthernetInterfaces |
| 197 | ... valid_status_codes=[${valid_status_code}] |
| 198 | |
| 199 | ${resp}= Evaluate json.loads(r'''${resp.text}''') json |
| 200 | ${interfaces}= Set Variable ${resp["Members"]} |
| 201 | |
| 202 | ${number_of_interfaces}= Get Length ${interfaces} |
| 203 | FOR ${i} IN RANGE ${number_of_interfaces} |
| 204 | Should Be Equal As Strings ${interfaces[${i}]}[@odata.id] |
| 205 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/eth${i} |
| 206 | END |
| 207 | Should Be Equal ${resp["Members@odata.count"]} ${number_of_interfaces} |
| shrsuman123 | 7ba02f3 | 2021-08-26 04:50:56 -0500 | [diff] [blame] | 208 | |
| 209 | Get And Set Static VMI IP |
| 210 | [Documentation] Get a suitable VMI IP and set it. |
| 211 | [Arguments] ${host}=${OPENBMC_HOST} ${network_active_channel}=${CHANNEL_NUMBER} |
| 212 | ... ${interface}=eth0 ${valid_status_code}=${HTTP_ACCEPTED} |
| 213 | |
| 214 | # Description of argument(s): |
| 215 | # host BMC host name or IP address. |
| 216 | # network_active_channel Ethernet channel number (e.g.1 or 2). |
| 217 | # interface VMI interface (eg. eth0 or eth1). |
| 218 | # valid_status_code Expected valid status code from PATCH request. Default is HTTP_ACCEPTED. |
| 219 | |
| 220 | ${vmi_ip}= Get First Non Pingable IP From Subnet ${host} |
| 221 | ${bmc_ip_data}= Get Network Configuration ${network_active_channel} |
| 222 | |
| 223 | Set Static IPv4 Address To VMI And Verify ${vmi_ip} ${bmc_ip_data[0]['Gateway']} |
| 224 | ... ${bmc_ip_data[0]['SubnetMask']} ${valid_status_code} ${interface} |
| 225 | |
| George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 226 | RETURN ${vmi_ip} ${bmc_ip_data} |
| Megha G N | a214833 | 2025-03-06 07:28:15 -0600 | [diff] [blame] | 227 | |
| 228 | |
| 229 | Set VMI SLAACv6 Origin |
| 230 | [Documentation] Set VMI SLAACv6 origin. |
| 231 | [Arguments] ${slaac_enabled}=${False} ${valid_status_code}=${HTTP_ACCEPTED} |
| 232 | ... ${interface}=${ethernet_interface} |
| 233 | |
| 234 | # Description of argument(s): |
| 235 | # slaacv6_enabled True if user wants to enable SLAACv6. Default is Static, hence value is set to False. |
| 236 | # valid_status_code Expected valid status code from PATCH request. Default is HTTP_OK. |
| 237 | # interface VMI interface (eg. eth0 or eth1). |
| 238 | |
| 239 | ${data}= Set Variable If ${slaac_enabled} == ${False} ${DISABLE_SLAAC} ${ENABLE_SLAAC} |
| 240 | ${resp}= Redfish.Patch |
| 241 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| 242 | ... body=${data} valid_status_codes=[${valid_status_code}] |
| 243 | |
| 244 | Sleep ${wait_time} |
| 245 | Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED} |
| 246 | ${resp}= Redfish.Get |
| 247 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| 248 | Should Be Equal ${resp.dict["StatelessAddressAutoConfig"]["IPv6AutoConfigEnabled"]} ${slaac_enabled} |
| 249 | |
| 250 | |
| 251 | Verify VMI IPv6 Address |
| 252 | [Documentation] Verify VMI IPv6 address configurations. |
| 253 | [Arguments] ${ipv6_origin} ${interface}=${ethernet_interface} |
| 254 | |
| 255 | # Description of argument(s): |
| 256 | # ipv6_origin Origin of IPv6 address eg. Static or DHCPv6 or SLAAC. |
| 257 | # interface VMI interface (eg. eth0 or eth1). |
| 258 | |
| 259 | ${resp}= Redfish.Get /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| 260 | |
| 261 | @{vmi_ipv6_configurations}= Get From Dictionary ${resp.dict} IPv6Addresses |
| 262 | ${vmi_ipv6_config}= Get From List ${vmi_ipv6_configurations} 0 |
| 263 | Should Not Be Empty ${vmi_ipv6_config["Address"]} |
| 264 | Should Be Equal As Strings ${vmi_ipv6_config["AddressOrigin"]} ${ipv6_origin} |
| 265 | RETURN &{vmi_ipv6_config} |
| 266 | |
| 267 | |
| 268 | Set VMI DHCPv6 Property |
| 269 | [Documentation] Set VMI DHCPv6 attribute. |
| 270 | [Arguments] ${dhcpv6_operatingmode}=${Disabled} ${valid_status_code}=${HTTP_ACCEPTED} |
| 271 | ... ${interface}=${ethernet_interface} |
| 272 | |
| 273 | # Description of argument(s): |
| 274 | # dhcpv6_operatingmode Enabled if user wants to enable DHCPv6. |
| 275 | # ... Default is Static, hence value is set to Disabled. |
| 276 | # valid_status_code Expected valid status code from PATCH request. Default is HTTP_OK. |
| 277 | # interface VMI interface (eg. eth0 or eth1). |
| 278 | |
| 279 | ${data}= Set Variable If '${dhcpv6_operatingmode}' == 'Disabled' ${DISABLE_DHCPv6} ${ENABLE_DHCPv6} |
| 280 | ${resp}= Redfish.Patch |
| 281 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| 282 | ... body=${data} valid_status_codes=[${valid_status_code}] |
| 283 | |
| 284 | Sleep ${wait_time} |
| 285 | Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED} |
| 286 | ${resp}= Redfish.Get |
| 287 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| 288 | Should Be Equal ${resp.dict["DHCPv6"]["OperatingMode"]} ${dhcpv6_operatingmode} |
| 289 | |
| 290 | |
| 291 | Set Static VMI IPv6 Address |
| 292 | [Documentation] Add static VMI IPv6 address. |
| 293 | [Arguments] ${vmi_ipv6_addr} ${prefix_len} ${valid_status_codes}=${HTTP_ACCEPTED} |
| 294 | ... ${interface}=${ethernet_interface} |
| 295 | |
| 296 | # Description of argument(s): |
| 297 | # vmi_ipv6_addr VMI IPv6 address to be added. |
| 298 | # prefix_len Prefix length for the VMI IPv6 to be added. |
| 299 | # valid_status_codes Expected valid status code from PATCH request. |
| 300 | # interface VMI interface (eg. eth0 or eth1). |
| 301 | |
| 302 | ${prefix_length}= Convert To Integer ${prefix_len} |
| 303 | ${empty_dict}= Create Dictionary |
| 304 | ${vmi_ipv6_data}= Create Dictionary Address=${vmi_ipv6_addr} |
| 305 | ... PrefixLength=${prefix_length} |
| 306 | |
| 307 | ${patch_list}= Create List |
| 308 | |
| 309 | Append To List ${patch_list} ${vmi_ipv6_data} |
| 310 | ${data}= Create Dictionary IPv6StaticAddresses=${patch_list} |
| 311 | |
| 312 | ${active_channel_config}= Get Active Channel Config |
| 313 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 314 | |
| 315 | Redfish.patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| 316 | ... body=&{data} valid_status_codes=[${valid_status_codes}] |
| 317 | |
| Megha G N | 1361edf | 2025-03-18 03:09:41 -0500 | [diff] [blame] | 318 | Sleep 5s |
| Megha G N | a214833 | 2025-03-06 07:28:15 -0600 | [diff] [blame] | 319 | |
| 320 | Set VMI IPv6 Static Default Gateway |
| 321 | [Documentation] Set VMI IPv6 static default gateway address. |
| 322 | [Arguments] ${vmi_staticipv6_gateway} ${valid_status_codes}=${HTTP_ACCEPTED} |
| 323 | ... ${interface}=${ethernet_interface} |
| 324 | |
| 325 | # Description of argument(s): |
| 326 | # vmi_staticipv6_gateway VMI static IPv6 default gateway address. |
| 327 | # valid_status_codes Expected valid status code from PATCH request. |
| 328 | # interface VMI interface (eg. eth0 or eth1). |
| 329 | |
| 330 | ${patch_list}= Create List ${vmi_staticipv6_gateway} |
| 331 | ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list} |
| 332 | |
| 333 | Redfish.patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| 334 | ... body=&{data} valid_status_codes=[${valid_status_codes}] |
| 335 | |
| 336 | |
| 337 | Delete VMI IPv6 Static Address |
| 338 | [Documentation] Delete VMI IPv6 static address. |
| 339 | [Arguments] ${valid_status_codes}=${HTTP_ACCEPTED} |
| 340 | ... ${interface}=${ethernet_interface} |
| 341 | |
| 342 | # Description of argument(s): |
| 343 | # valid_status_codes Expected valid status code from PATCH request. |
| 344 | # interface VMI interface (eg. eth0 or eth1). |
| 345 | |
| 346 | ${data}= Set Variable {"IPv6StaticAddresses": [${Null}]} |
| 347 | Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| 348 | ... body=${data} valid_status_codes=[${valid_status_codes}] |
| 349 | |
| 350 | Sleep 5s |