Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 3 | Documentation VMI static/dynamic IP config tests. |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 4 | |
| 5 | Resource ../../lib/resource.robot |
| 6 | Resource ../../lib/bmc_redfish_resource.robot |
| 7 | Resource ../../lib/openbmc_ffdc.robot |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 8 | Resource ../../lib/bmc_redfish_utils.robot |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 9 | Resource ../../lib/state_manager.robot |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 10 | Library ../../lib/bmc_network_utils.py |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 11 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 12 | Suite Setup Suite Setup Execution |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 13 | Test Teardown FFDC On Test Case Fail |
| 14 | Suite Teardown Redfish.Logout |
| 15 | |
| 16 | *** Variables *** |
| 17 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 18 | # users User Name password |
| 19 | @{ADMIN} admin_user TestPwd123 |
| 20 | @{OPERATOR} operator_user TestPwd123 |
| 21 | @{ReadOnly} readonly_user TestPwd123 |
| 22 | @{NoAccess} noaccess_user TestPwd123 |
| 23 | &{USERS} Administrator=${ADMIN} Operator=${OPERATOR} ReadOnly=${ReadOnly} |
| 24 | ... NoAccess=${NoAccess} |
| 25 | |
Prashanth Katti | 1ce6821 | 2020-11-13 00:39:03 -0600 | [diff] [blame] | 26 | ${test_ipv4} 10.6.6.6 |
| 27 | ${test_gateway} 10.6.6.1 |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 28 | ${test_netmask} 255.255.252.0 |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 29 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 30 | &{DHCP_ENABLED} DHCPEnabled=${${True}} |
| 31 | &{DHCP_DISABLED} DHCPEnabled=${${False}} |
| 32 | |
| 33 | &{ENABLE_DHCP} DHCPv4=&{DHCP_ENABLED} |
| 34 | &{DISABLE_DHCP} DHCPv4=&{DHCP_DISABLED} |
Prashanth Katti | 1ce6821 | 2020-11-13 00:39:03 -0600 | [diff] [blame] | 35 | ${wait_time} 10s |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 36 | |
| 37 | |
| 38 | *** Test Cases *** |
| 39 | |
| 40 | Verify All VMI EthernetInterfaces |
| 41 | [Documentation] Verify all VMI ethernet interfaces. |
| 42 | [Tags] Verify_All_VMI_EthernetINterfaces |
| 43 | |
| 44 | Verify VMI EthernetInterfaces |
| 45 | |
| 46 | |
| 47 | Verify Existing VMI Network Interface Details |
| 48 | [Documentation] Verify existing VMI network interface details. |
| 49 | [Tags] Verify_VMI_Network_Interface_Details |
| 50 | |
| 51 | ${vmi_ip}= Get VMI Network Interface Details |
| 52 | ${origin}= Set Variable If ${vmi_ip["DHCPv4"]} == ${False} Static DHCP |
| 53 | |
| 54 | Should Not Be Equal ${vmi_ip["DHCPv4"]} ${vmi_ip["IPv4StaticAddresses"]} |
| 55 | Should Be Equal As Strings ${origin} ${vmi_ip["IPv4_AddressOrigin"]} |
| 56 | Should Be Equal As Strings ${vmi_ip["Id"]} intf0 |
George Keishing | b3ea095 | 2020-07-01 05:03:56 -0500 | [diff] [blame] | 57 | Should Be Equal As Strings ${vmi_ip["Description"]} |
| 58 | ... Ethernet Interface for Virtual Management Interface |
| 59 | Should Be Equal As Strings ${vmi_ip["Name"]} Virtual Management Interface |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 60 | Should Be True ${vmi_ip["InterfaceEnabled"]} |
| 61 | |
| 62 | |
| 63 | Delete Existing Static VMI IP Address |
| 64 | [Documentation] Delete existing static VMI IP address. |
| 65 | [Tags] Delete_Existing_Static_VMI_IP_Address |
| 66 | |
| 67 | ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 68 | Run Keyword If ${curr_origin} == ${True} Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED} |
| 69 | |
| 70 | Delete VMI IPv4 Address IPv4StaticAddresses valid_status_code=${HTTP_ACCEPTED} |
| 71 | ${default}= Set Variable 0.0.0.0 |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 72 | Verify VMI Network Interface Details ${default} Static ${default} ${default} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 73 | |
| 74 | |
| 75 | Verify User Cannot Delete ReadOnly Property IPv4Addresses |
| 76 | [Documentation] Verify user cannot delete readonly property IPv4Addresses. |
| 77 | [Tags] Verify_User_Cannot_Delete_ReadOnly_Property_IPv4Addresses |
| 78 | |
| 79 | ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 80 | Run Keyword If ${curr_origin} == ${False} Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED} |
| 81 | Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_BAD_REQUEST} |
| 82 | |
| 83 | |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 84 | Assign Valid And Invalid Static IPv4 Address To VMI |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 85 | [Documentation] Assign static IPv4 address to VMI. |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 86 | [Tags] Assign_Valid_And_Invalid_Static_IPv4_Address_To_VMI |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 87 | [Template] Set Static IPv4 Address To VMI And Verify |
| 88 | [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 89 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 90 | # ip gateway netmask valid_status_code |
| 91 | 10.5.20.30 0.0.0.0 255.255.252.0 ${HTTP_ACCEPTED} |
| 92 | a.3.118.94 0.0.0.0 255.255.252.0 ${HTTP_BAD_REQUEST} |
| 93 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 94 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 95 | Add Multiple IP Addreses On VMI Interface And Verify |
| 96 | [Documentation] Add multiple IP addreses on VMI interface and verify. |
| 97 | [Tags] Add_Multiple_IP_Addreses_On_VMI_Interface_And_Verify |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 98 | [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 99 | |
| 100 | ${ip1}= Create dictionary Address=10.5.5.10 SubnetMask=255.255.252.0 Gateway=0.0.0.0 |
| 101 | ${ip2}= Create dictionary Address=10.5.5.11 SubnetMask=255.255.252.0 Gateway=0.0.0.0 |
| 102 | ${ip3}= Create dictionary Address=10.5.5.12 SubnetMask=255.255.252.0 Gateway=0.0.0.0 |
| 103 | ${ips}= Create List ${ip1} ${ip2} ${ip3} |
| 104 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 105 | Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 106 | ... body={'IPv4StaticAddresses':${ips}} valid_status_codes=[${HTTP_ACCEPTED}] |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 107 | Verify VMI Network Interface Details ${ip1["Address"]} Static ${ip1["Gateway"]} ${ip1["SubnetMask"]} |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 108 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 109 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 110 | Modify IP Addresses On VMI Interface And Verify |
| 111 | [Documentation] Modify IP addresses on VMI interface and verify. |
| 112 | [Tags] Modify_IP_Addresses_On_VMI_Interface_And_Verify |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 113 | [Template] Set Static IPv4 Address To VMI And Verify |
| 114 | [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 115 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 116 | # ip gateway netmask valid_status_code |
| 117 | 10.5.5.10 0.0.0.0 255.255.252.0 ${HTTP_ACCEPTED} |
| 118 | 10.5.5.11 0.0.0.0 255.255.252.0 ${HTTP_ACCEPTED} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 119 | |
| 120 | Switch Between IP Origins On VMI And Verify Details |
| 121 | [Documentation] Switch between IP origins on VMI and verify details. |
| 122 | [Tags] Switch_Between_IP_Origins_On_VMI_And_Verify_Details |
| 123 | |
| 124 | Switch VMI IPv4 Origin And Verify Details |
| 125 | Switch VMI IPv4 Origin And Verify Details |
| 126 | |
| 127 | |
| 128 | Verify Persistency Of VMI IPv4 Details After Host Reboot |
| 129 | [Documentation] Verify persistency of VMI IPv4 details after host reboot. |
| 130 | [Tags] Verify_Persistency_Of_VMI_IPv4_Details_After_Host_Reboot |
| 131 | |
| 132 | # Verifying persistency of dynamic address. |
| 133 | Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED} |
| 134 | ${default}= Set Variable 0.0.0.0 |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 135 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 136 | |
| 137 | # Verifying persistency of static address. |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 138 | Switch VMI IPv4 Origin And Verify Details |
| 139 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 140 | |
| 141 | |
Anves Kumar rayankula | 9fa524a | 2020-08-18 06:40:18 -0500 | [diff] [blame] | 142 | Delete VMI Static IP Address And Verify |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 143 | [Documentation] Delete VMI static IP address and verify. |
| 144 | [Tags] Delete_VMI_Static_IP_Address_And_Verify |
| 145 | [Teardown] Test Teardown Execution |
Anves Kumar rayankula | 9fa524a | 2020-08-18 06:40:18 -0500 | [diff] [blame] | 146 | |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 147 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
| 148 | Delete VMI IPv4 Address |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 149 | ${resp}= Redfish.Get |
| 150 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 151 | Should Be Empty ${resp.dict["IPv4Addresses"]} |
| 152 | |
Anves Kumar rayankula | 9fa524a | 2020-08-18 06:40:18 -0500 | [diff] [blame] | 153 | |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 154 | Verify Successful VMI IP Static Configuration On HOST Boot After Session Delete |
| 155 | [Documentation] Verify VMI IP static Configuration On HOST Boot After session deleted. |
| 156 | [Tags] Verify_Successful_VMI_IP_Static_Configuration_On_HOST_Boot_After_Session_Delete |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 157 | [Teardown] Run keywords Delete VMI IPv4 Address IPv4Addresses AND Test Teardown Execution |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 158 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 159 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 160 | |
| 161 | ${session_info}= Get Redfish Session Info |
| 162 | Redfish.Delete ${session_info["location"]} |
| 163 | |
| 164 | # Create a new Redfish session |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 165 | Redfish Power Off |
| 166 | Redfish Power On |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 167 | |
| 168 | Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask} |
| 169 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 170 | |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 171 | Verify Persistency Of VMI DHCP IP Configuration After Multiple HOST Reboots |
| 172 | [Documentation] Verify Persistency Of VMI DHCP IP configuration After Multiple HOST Reboots |
| 173 | [Tags] Verify_Persistency_Of_VMI_DHCP_IP_Configuration_After_Multiple_HOST_Reboots |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 174 | [Teardown] Test Teardown Execution |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 175 | |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 176 | Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED} |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 177 | ${vmi_ip_config}= Get VMI Network Interface Details |
| 178 | # Verifying persistency of dynamic address after multiple reboots. |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 179 | FOR ${i} IN RANGE ${2} |
| 180 | Redfish Power Off |
| 181 | Redfish Power On |
| 182 | Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]} DHCP ${vmi_ip_config["IPv4_Gateway"]} |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 183 | ... ${vmi_ip_config["IPv4_SubnetMask"]} |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 184 | END |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 185 | |
| 186 | |
| 187 | Enable DHCP When Static IP Configured And Verify Static IP |
| 188 | [Documentation] Enable DHCP when static ip configured and verify static ip |
| 189 | [Tags] Enable_DHCP_when_Static_IP_Configured_And_Verify_Static_IP |
| 190 | [Teardown] Test Teardown Execution |
| 191 | |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 192 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 193 | Set VMI IPv4 Origin ${True} |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 194 | ${vmi_network_conf}= Get VMI Network Interface Details |
| 195 | Should Not Be Equal As Strings ${test_ipv4} ${vmi_network_conf["IPv4_Address"]} |
| 196 | |
Anves Kumar rayankula | 9fa524a | 2020-08-18 06:40:18 -0500 | [diff] [blame] | 197 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 198 | Verify VMI Static IP Configuration Persist On BMC Reset Before Host Boot |
| 199 | [Documentation] Verify VMI static IP configuration persist on BMC reset. |
| 200 | [Tags] Verify_VMI_Static_IP_Configuration_Persist_On_BMC_Reset_Before_Host_Boot |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 201 | [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 202 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 203 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 204 | OBMC Reboot (off) |
| 205 | Redfish Power On |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 206 | # Verifying the VMI static configuration |
| 207 | Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask} |
| 208 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 209 | Add Static IP When Host Poweroff And Verify On Poweron |
| 210 | [Documentation] Add Static IP When Host Poweroff And Verify on power on |
| 211 | [Tags] Add_Static_IP_When_Host_Poweroff_And_Verify_On_Poweron |
| 212 | [Setup] Redfish Power Off |
| 213 | [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail |
| 214 | |
| 215 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
| 216 | Redfish Power On |
| 217 | Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask} |
| 218 | |
| 219 | Add VMI Static IP When Host Poweroff And Verify Static IP On BMC Reset |
| 220 | [Documentation] Add Static IP When Host Poweroff And Verify Static IP On BMC Reset. |
| 221 | [Tags] Add_VMI_Static_IP_When_Host_Poweroff_And_Verify_Static_IP_On_BMC_Reset |
| 222 | [Setup] Redfish Power Off |
| 223 | [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail |
| 224 | |
| 225 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
| 226 | OBMC Reboot (off) |
| 227 | Redfish Power On |
| 228 | Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask} |
| 229 | |
| 230 | Enable DHCP When No Static IP Configured And Verify DHCP IP |
| 231 | [Documentation] Enable DHCP when no static ip configured and verify dhcp ip |
| 232 | [Tags] Enable_DHCP_When_No_Static_IP_Configured_And_Verify_DHCP_IP |
| 233 | [Setup] Run Keyword And Ignore Error Delete VMI IPv4 Address |
| 234 | [Teardown] Test Teardown Execution |
| 235 | |
| 236 | ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 237 | Run Keyword If ${curr_origin} == ${False} Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED} |
| 238 | ${vmi_ip_config}= Get VMI Network Interface Details |
| 239 | Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]} DHCP ${vmi_ip_config["IPv4_Gateway"]} |
| 240 | ... ${vmi_ip_config["IPv4_SubnetMask"]} |
| 241 | |
| 242 | Verify User Cannot Delete VMI DHCP IP Address |
| 243 | [Documentation] Verify user cannot delete VMI DHCP IP Address |
| 244 | [Tags] Verify_User_Cannot_Delete_VMI_DHCP_IP_Address |
| 245 | [Setup] Set VMI IPv4 Origin ${True} |
| 246 | [Teardown] Test Teardown Execution |
| 247 | |
| 248 | Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_BAD_REQUEST} |
| 249 | ${active_channel_config}= Get Active Channel Config |
| 250 | ${resp}= Redfish.Get |
| 251 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 252 | Should Not Be Empty ${resp.dict["IPv4Addresses"]} |
| 253 | |
| 254 | Enable DHCP When Static IP Configured DHCP Server Unavailable And Verify IP |
| 255 | [Documentation] Enable DHCP When Static IP Configured And DHCP Server Unavailable And Verify No IP. |
| 256 | [Tags] Enable_DHCP_When_Static_IP_Configured_DHCP_Server_Unavailable_And_Verify_IP |
| 257 | [Teardown] Test Teardown Execution |
| 258 | |
| 259 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
| 260 | Set VMI IPv4 Origin ${True} |
| 261 | ${default}= Set Variable 0.0.0.0 |
| 262 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
| 263 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 264 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 265 | Verify To Configure VMI Static IP Address With Different User Roles |
| 266 | [Documentation] Verify to configure vmi static ip address with different user roles. |
| 267 | [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Different_User_Roles |
| 268 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 269 | [Template] Config VMI Static IP Address Using Different Users |
| 270 | [Teardown] Delete BMC Users Using Redfish |
| 271 | |
| 272 | # username password ip_address gateway nemask valid_status_code |
| 273 | admin_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_ACCEPTED} |
| 274 | operator_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN} |
| 275 | readonly_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN} |
| 276 | noaccess_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN} |
| 277 | |
| 278 | |
| 279 | Verify To Delete VMI Static IP Address With Different User Roles |
| 280 | [Documentation] Verify to delete vmi static IP address with different user roles. |
| 281 | [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Different_User_Roles |
| 282 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 283 | [Template] Delete VMI Static IP Address Using Different Users |
| 284 | [Teardown] Delete BMC Users Using Redfish |
| 285 | |
| 286 | # username password valid_status_code |
| 287 | admin_user TestPwd123 ${HTTP_ACCEPTED} |
| 288 | operator_user TestPwd123 ${HTTP_FORBIDDEN} |
| 289 | readonly_user TestPwd123 ${HTTP_FORBIDDEN} |
| 290 | noaccess_user TestPwd123 ${HTTP_FORBIDDEN} |
| 291 | |
| 292 | |
| 293 | Verify To Update VMI Static IP Address With Different User Roles |
| 294 | [Documentation] Verify to update vmi static IP address with different user roles. |
| 295 | [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Different_User_Roles_And_Verify |
| 296 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 297 | [Template] Config VMI Static IP Address Using Different Users |
| 298 | [Teardown] Delete BMC Users Using Redfish |
| 299 | |
| 300 | # username password ip_address gateway nemask valid_status_code |
| 301 | admin_user TestPwd123 10.5.10.20 0.0.0.0 255.255.0.0 ${HTTP_ACCEPTED} |
| 302 | operator_user TestPwd123 10.5.10.30 0.0.0.0 255.255.0.0 ${HTTP_FORBIDDEN} |
| 303 | readonly_user TestPwd123 10.5.20.40 0.0.0.0 255.255.0.0 ${HTTP_FORBIDDEN} |
| 304 | noaccess_user TestPwd123 10.5.30.50 0.0.0.0 255.255.0.0 ${HTTP_FORBIDDEN} |
| 305 | |
| 306 | |
| 307 | Verify To Read VMI Network Configuration With Different User Roles |
| 308 | [Documentation] Verify to read vmi network configuration with different user roles. |
| 309 | [Tags] Verify_To_Read_VMI_Network_Configuration_Via_Different_User_Roles |
| 310 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 311 | [Template] Read VMI Static IP Address Using Different Users |
| 312 | [Teardown] Delete BMC Users Using Redfish |
| 313 | |
| 314 | # username password valid_status_code |
| 315 | admin_user TestPwd123 ${HTTP_OK} |
| 316 | operator_user TestPwd123 ${HTTP_OK} |
| 317 | readonly_user TestPwd123 ${HTTP_OK} |
| 318 | noaccess_user TestPwd123 ${HTTP_FORBIDDEN} |
| 319 | |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 320 | Enable DHCP On VMI Network Via Different Users Roles And Verify |
| 321 | [Documentation] Enable DHCP On VMI Network Via Different Users Roles And Verify. |
| 322 | [Tags] Enable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify |
| 323 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 324 | [Template] Update User Role And Set VMI IPv4 Origin |
| 325 | [Teardown] Delete BMC Users Using Redfish |
| 326 | |
| 327 | # username password dhcp_enabled valid_status_code |
| 328 | admin_user TestPwd123 ${True} ${HTTP_ACCEPTED} |
| 329 | operator_user TestPwd123 ${True} ${HTTP_FORBIDDEN} |
| 330 | readonly_user TestPwd123 ${True} ${HTTP_FORBIDDEN} |
| 331 | noaccess_user TestPwd123 ${True} ${HTTP_FORBIDDEN} |
| 332 | |
| 333 | Disable DHCP On VMI Network Via Different Users Roles And Verify |
| 334 | [Documentation] Disable DHCP On VMI Network Via Different Users Roles And Verify. |
| 335 | [Tags] Disable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify |
| 336 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 337 | [Template] Update User Role And Set VMI IPv4 Origin |
| 338 | [Teardown] Delete BMC Users Using Redfish |
| 339 | |
| 340 | # username password dhcp_enabled valid_status_code |
| 341 | admin_user TestPwd123 ${False} ${HTTP_ACCEPTED} |
| 342 | operator_user TestPwd123 ${False} ${HTTP_FORBIDDEN} |
| 343 | readonly_user TestPwd123 ${False} ${HTTP_FORBIDDEN} |
| 344 | noaccess_user TestPwd123 ${False} ${HTTP_FORBIDDEN} |
| 345 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 346 | |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 347 | Enable And Disable DHCP And Verify |
| 348 | [Documentation] verify enable DHCP and disable DHCP. |
| 349 | [Tags] Enabled_And_Disabled_DHCP_Verify |
| 350 | |
| 351 | Set VMI IPv4 Origin ${True} |
| 352 | ${default}= Set Variable 0.0.0.0 |
| 353 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
| 354 | Set VMI IPv4 Origin ${False} |
shrsuman123 | 7a0e7f5 | 2021-01-07 00:43:11 -0600 | [diff] [blame] | 355 | ${resp}= Redfish.Get |
| 356 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 357 | Should Be Empty ${resp.dict["IPv4Addresses"]} |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 358 | |
| 359 | |
| 360 | Multiple Times Enable And Disable DHCP And Verify |
| 361 | [Documentation] Enable and Disable DHCP in a loop and verify VMI gets an IP address from DHCP |
| 362 | ... each time when DHCP is enabled |
| 363 | [Tags] Multiple_Times_Enable_And_Disable_DHCP_And_Verify |
| 364 | |
| 365 | ${default}= Set Variable 0.0.0.0 |
| 366 | FOR ${i} IN RANGE ${2} |
| 367 | Set VMI IPv4 Origin ${True} |
| 368 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
| 369 | Set VMI IPv4 Origin ${False} |
shrsuman123 | 7a0e7f5 | 2021-01-07 00:43:11 -0600 | [diff] [blame] | 370 | ${resp}= Redfish.Get |
| 371 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 372 | Should Be Empty ${resp.dict["IPv4Addresses"]} |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 373 | END |
| 374 | |
| 375 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 376 | *** Keywords *** |
| 377 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 378 | Suite Setup Execution |
| 379 | [Documentation] Do test setup execution task. |
| 380 | |
| 381 | Redfish.Login |
| 382 | Redfish Power On |
| 383 | ${active_channel_config}= Get Active Channel Config |
| 384 | Set Suite Variable ${active_channel_config} |
| 385 | ${resp}= Redfish.Get |
| 386 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 387 | ${ip_resp}= Evaluate json.loads('''${resp.text}''') json |
| 388 | ${length}= Get Length ${ip_resp["IPv4StaticAddresses"]} |
| 389 | ${vmi_network_conf}= Run Keyword If ${length} != ${0} Get VMI Network Interface Details |
| 390 | Set Suite Variable ${vmi_network_conf} |
| 391 | |
| 392 | |
| 393 | Test Teardown Execution |
| 394 | [Documentation] Do test teardown execution task. |
| 395 | |
| 396 | FFDC On Test Case Fail |
| 397 | ${curr_mode}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 398 | Run Keyword If ${curr_mode} == ${True} Set VMI IPv4 Origin ${False} |
| 399 | Run Keyword If ${vmi_network_conf} != ${None} |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 400 | ... Set Static IPv4 Address To VMI And Verify ${vmi_network_conf["IPv4_Address"]} |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 401 | ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]} |
| 402 | |
| 403 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 404 | Get VMI Network Interface Details |
| 405 | [Documentation] Get VMI network interface details. |
| 406 | [Arguments] ${valid_status_code}=${HTTP_OK} |
| 407 | |
| 408 | # Description of argument(s): |
| 409 | # valid_status_code Expected valid status code from GET request. |
| 410 | |
Anves Kumar rayankula | aa33b05 | 2020-07-22 04:24:51 -0500 | [diff] [blame] | 411 | # Note: It returns a dictionary of VMI eth0 parameters. |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 412 | |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 413 | ${active_channel_config}= Get Active Channel Config |
| 414 | ${resp}= Redfish.Get |
| 415 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 416 | ... valid_status_codes=[${valid_status_code}] |
| 417 | |
| 418 | ${ip_resp}= Evaluate json.loads('''${resp.text}''') json |
| 419 | |
| 420 | ${static_exists}= Run Keyword And Ignore Error |
| 421 | ... Set Variable ${ip_resp["IPv4StaticAddresses"][0]["Address"]} |
| 422 | ${static_exists}= Set Variable If '${static_exists[0]}' == 'PASS' ${True} ${False} |
| 423 | |
| 424 | ${vmi_ip}= Create Dictionary DHCPv4=${${ip_resp["DHCPv4"]["DHCPEnabled"]}} Id=${ip_resp["Id"]} |
| 425 | ... Description=${ip_resp["Description"]} IPv4_Address=${ip_resp["IPv4Addresses"][0]["Address"]} |
| 426 | ... IPv4_AddressOrigin=${ip_resp["IPv4Addresses"][0]["AddressOrigin"]} Name=${ip_resp["Name"]} |
Sushil Singh | 810234d | 2020-05-13 12:12:03 -0500 | [diff] [blame] | 427 | ... IPv4_Gateway=${ip_resp["IPv4Addresses"][0]["Gateway"]} |
| 428 | ... InterfaceEnabled=${${ip_resp["InterfaceEnabled"]}} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 429 | ... IPv4_SubnetMask=${ip_resp["IPv4Addresses"][0]["SubnetMask"]} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 430 | ... IPv4StaticAddresses=${${static_exists}} |
| 431 | |
| 432 | [Return] &{vmi_ip} |
| 433 | |
| 434 | |
| 435 | Get Immediate Child Parameter From VMI Network Interface |
| 436 | [Documentation] Get immediate child parameter from VMI network interface. |
| 437 | [Arguments] ${parameter} ${valid_status_code}=${HTTP_OK} |
| 438 | |
| 439 | # Description of argument(s): |
| 440 | # parameter parameter for which value is required. Ex: DHCPEnabled, MACAddress etc. |
| 441 | # valid_status_code Expected valid status code from GET request. |
| 442 | |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 443 | ${active_channel_config}= Get Active Channel Config |
| 444 | ${resp}= Redfish.Get |
| 445 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 446 | ... valid_status_codes=[${valid_status_code}] |
| 447 | |
| 448 | ${ip_resp}= Evaluate json.loads('''${resp.text}''') json |
| 449 | ${value}= Set Variable If '${parameter}' != 'DHCPEnabled' ${ip_resp["${parameter}"]} |
| 450 | ... ${ip_resp["DHCPv4"]["${parameter}"]} |
| 451 | |
| 452 | [Return] ${value} |
| 453 | |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 454 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 455 | Verify VMI EthernetInterfaces |
| 456 | [Documentation] Verify VMI ethernet interfaces. |
| 457 | [Arguments] ${valid_status_code}=${HTTP_OK} |
| 458 | |
| 459 | # Description of argument(s): |
| 460 | # valid_status_code Expected valid status code from GET request. |
| 461 | |
| 462 | ${resp}= Redfish.Get /redfish/v1/Systems/hypervisor/EthernetInterfaces |
| 463 | ... valid_status_codes=[${valid_status_code}] |
| 464 | |
| 465 | ${resp}= Evaluate json.loads('''${resp.text}''') json |
| 466 | ${interfaces}= Set Variable ${resp["Members"]} |
| 467 | |
| 468 | Should Be Equal As Strings ${interfaces[0]}[@odata.id] |
Anves Kumar rayankula | aa33b05 | 2020-07-22 04:24:51 -0500 | [diff] [blame] | 469 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/eth0 |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 470 | Should Be Equal As Strings ${interfaces[1]}[@odata.id] |
Anves Kumar rayankula | aa33b05 | 2020-07-22 04:24:51 -0500 | [diff] [blame] | 471 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/eth1 |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 472 | |
| 473 | Should Be Equal ${resp["Members@odata.count"]} ${2} |
| 474 | |
| 475 | |
| 476 | Verify VMI Network Interface Details |
| 477 | [Documentation] Verify VMI network interface details. |
| 478 | [Arguments] ${ip} ${origin} ${gateway} ${netmask} |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 479 | ... ${valid_status_code}=${HTTP_OK} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 480 | |
| 481 | # Description of argument(s): |
| 482 | # ip VMI IPv4 address. |
| 483 | # origin Origin of IPv4 address eg. Static or DHCP. |
| 484 | # gateway Gateway for VMI IP. |
| 485 | # netmask Subnetmask for VMI IP. |
| 486 | # valid_status_code Expected valid status code from GET request. Default is HTTP_OK. |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 487 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 488 | ${vmi_ip}= Get VMI Network Interface Details ${valid_status_code} |
| 489 | Should Be Equal As Strings ${origin} ${vmi_ip["IPv4_AddressOrigin"]} |
| 490 | Should Be Equal As Strings ${gateway} ${vmi_ip["IPv4_Gateway"]} |
| 491 | Should Be Equal As Strings ${netmask} ${vmi_ip["IPv4_SubnetMask"]} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 492 | Should Be Equal As Strings ${ip} ${vmi_ip["IPv4_Address"]} |
| 493 | |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 494 | |
| 495 | Set Static IPv4 Address To VMI And Verify |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 496 | [Documentation] Set static IPv4 address to VMI. |
| 497 | [Arguments] ${ip} ${gateway} ${netmask} ${valid_status_code}=${HTTP_ACCEPTED} |
| 498 | |
| 499 | # Description of argument(s): |
| 500 | # ip VMI IPv4 address. |
| 501 | # gateway Gateway for VMI IP. |
| 502 | # netmask Subnetmask for VMI IP. |
| 503 | # valid_status_code Expected valid status code from GET request. Default is HTTP_ACCEPTED. |
| 504 | |
| 505 | ${data}= Set Variable |
| 506 | ... {"IPv4StaticAddresses": [{"Address": "${ip}","SubnetMask": "${netmask}","Gateway": "${gateway}"}]} |
| 507 | |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 508 | ${active_channel_config}= Get Active Channel Config |
| 509 | ${resp}= Redfish.Patch |
| 510 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 511 | ... body=${data} valid_status_codes=[${valid_status_code}] |
Prashanth Katti | 1ce6821 | 2020-11-13 00:39:03 -0600 | [diff] [blame] | 512 | |
| 513 | # Wait few seconds for new configuration to get populated on runtime. |
| 514 | Sleep ${wait_time} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 515 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 516 | Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED} |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 517 | ${host_power_state} ${host_state}= Redfish Get Host State |
| 518 | Run Keyword If '${host_power_state}' == 'On' and '${host_state}' == 'Enabled' |
| 519 | ... Verify VMI Network Interface Details ${ip} Static ${gateway} ${netmask} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 520 | |
| 521 | |
| 522 | Delete VMI IPv4 Address |
| 523 | [Documentation] Delete VMI IPv4 address. |
| 524 | [Arguments] ${delete_param}=IPv4StaticAddresses ${valid_status_code}=${HTTP_ACCEPTED} |
| 525 | |
| 526 | # Description of argument(s): |
| 527 | # delete_param Parameter to be deleted eg. IPv4StaticAddresses or IPv4Addresses. |
| 528 | # Default is IPv4StaticAddresses. |
| 529 | # valid_status_code Expected valid status code from PATCH request. Default is HTTP_OK. |
| 530 | |
| 531 | ${data}= Set Variable {"${delete_param}": [${Null}]} |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 532 | ${active_channel_config}= Get Active Channel Config |
| 533 | ${resp}= Redfish.Patch |
| 534 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 535 | ... body=${data} valid_status_codes=[${valid_status_code}] |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 536 | |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 537 | Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED} |
| 538 | ${resp}= Redfish.Get |
| 539 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 540 | Should Be Empty ${resp.dict["IPv4StaticAddresses"]} |
| 541 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 542 | |
| 543 | Set VMI IPv4 Origin |
| 544 | [Documentation] Set VMI IPv4 origin. |
| 545 | [Arguments] ${dhcp_enabled}=${False} ${valid_status_code}=${HTTP_ACCEPTED} |
| 546 | |
| 547 | # Description of argument(s): |
| 548 | # dhcp_enabled True if user wants to enable DHCP. Default is Static, hence value is set to False. |
| 549 | # valid_status_code Expected valid status code from PATCH request. Default is HTTP_OK. |
| 550 | |
| 551 | ${data}= Set Variable If ${dhcp_enabled} == ${False} ${DISABLE_DHCP} ${ENABLE_DHCP} |
Anves Kumar rayankula | aa33b05 | 2020-07-22 04:24:51 -0500 | [diff] [blame] | 552 | ${resp}= Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/eth0 body=${data} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 553 | ... valid_status_codes=[${valid_status_code}] |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 554 | Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED} |
| 555 | ${resp}= Redfish.Get |
| 556 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 557 | Should Be Equal ${resp.dict["DHCPv4"]["DHCPEnabled"]} ${dhcp_enabled} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 558 | |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 559 | Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED} |
| 560 | ${resp}= Redfish.Get |
| 561 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 562 | Should Be Equal ${resp.dict["DHCPv4"]["DHCPEnabled"]} ${dhcp_enabled} |
| 563 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 564 | |
| 565 | Switch VMI IPv4 Origin And Verify Details |
| 566 | [Documentation] Switch VMI IPv4 origin and verify details. |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 567 | |
| 568 | ${curr_mode}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 569 | ${dhcp_enabled}= Set Variable If ${curr_mode} == ${False} ${True} ${False} |
| 570 | |
| 571 | ${default}= Set Variable 0.0.0.0 |
| 572 | ${origin}= Set Variable If ${curr_mode} == ${False} DHCP Static |
| 573 | Set VMI IPv4 Origin ${dhcp_enabled} ${HTTP_ACCEPTED} |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 574 | Verify VMI Network Interface Details ${default} ${origin} ${default} ${default} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 575 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 576 | |
| 577 | Delete VMI Static IP Address Using Different Users |
| 578 | [Documentation] Update user role and delete vmi static IP address. |
| 579 | [Arguments] ${username} ${password} ${valid_status_code} |
| 580 | [Teardown] Run Keywords Redfish.Login AND |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 581 | ... Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 582 | ... ${test_netmask} ${HTTP_ACCEPTED} AND Redfish.Logout |
| 583 | |
| 584 | # Description of argument(s): |
| 585 | # username The host username. |
| 586 | # password The host password. |
| 587 | # valid_status_code The expected valid status code. |
| 588 | |
| 589 | Redfish.Login ${username} ${password} |
| 590 | Delete VMI IPv4 Address delete_param=IPv4StaticAddresses valid_status_code=${valid_status_code} |
| 591 | Redfish.Logout |
| 592 | |
| 593 | |
| 594 | Config VMI Static IP Address Using Different Users |
| 595 | [Documentation] Update user role and update vmi static ip address. |
| 596 | [Arguments] ${username} ${password} ${ip} ${gateway} ${netmask} |
| 597 | ... ${valid_status_code} |
| 598 | |
| 599 | # Description of argument(s): |
| 600 | # username The host username. |
| 601 | # password The host password. |
| 602 | # ip IP address to be added (e.g. "10.7.7.7"). |
| 603 | # subnet_mask Subnet mask for the IP to be added |
| 604 | # (e.g. "255.255.0.0"). |
| 605 | # gateway Gateway for the IP to be added (e.g. "10.7.7.1"). |
| 606 | # valid_status_code The expected valid status code. |
| 607 | |
| 608 | Redfish.Login ${username} ${password} |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 609 | Set Static IPv4 Address To VMI And Verify ${ip} ${gateway} ${netmask} ${valid_status_code} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 610 | Redfish.Logout |
| 611 | |
| 612 | |
| 613 | Read VMI Static IP Address Using Different Users |
| 614 | [Documentation] Update user role and read vmi static ip address. |
| 615 | [Arguments] ${username} ${password} ${valid_status_code} |
| 616 | |
| 617 | # Description of argument(s): |
| 618 | # username The host username. |
| 619 | # password The host password. |
| 620 | # valid_status_code The expected valid status code. |
| 621 | |
| 622 | Redfish.Login ${username} ${password} |
| 623 | Redfish.Get |
| 624 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 625 | ... valid_status_codes=[${valid_status_code}] |
| 626 | Redfish.Logout |
| 627 | |
| 628 | |
| 629 | Delete BMC Users Using Redfish |
| 630 | [Documentation] Delete BMC users via redfish. |
| 631 | |
| 632 | Redfish.Login |
| 633 | Delete BMC Users Via Redfish users=${USERS} |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 634 | |
| 635 | Update User Role And Set VMI IPv4 Origin |
| 636 | [Documentation] Update User Role And Set VMI IPv4 Origin. |
| 637 | [Arguments] ${username} ${password} ${dhcp_enabled} ${valid_status_code} |
| 638 | |
| 639 | # Description of argument(s): |
| 640 | # username The host username. |
| 641 | # password The host password. |
| 642 | # dhcp_enabled Indicates whether dhcp should be enabled |
| 643 | # (${True}, ${False}). |
| 644 | # valid_status_code The expected valid status code. |
| 645 | |
| 646 | Redfish.Login ${username} ${password} |
| 647 | Set VMI IPv4 Origin ${dhcp_enabled} ${valid_status_code} |
| 648 | Redfish.Logout |