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 |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 91 | 10.5.20.30 10.5.20.1 255.255.252.0 ${HTTP_ACCEPTED} |
| 92 | a.3.118.94 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST} |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 93 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 94 | |
George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 95 | Add Multiple IP Addresses On VMI Interface And Verify |
| 96 | [Documentation] Add multiple IP addresses on VMI interface and verify. |
| 97 | [Tags] Add_Multiple_IP_Addresses_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 | |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 100 | ${ip1}= Create dictionary Address=10.5.5.10 SubnetMask=255.255.252.0 Gateway=10.5.5.1 |
| 101 | ${ip2}= Create dictionary Address=10.5.5.11 SubnetMask=255.255.252.0 Gateway=10.5.5.1 |
| 102 | ${ip3}= Create dictionary Address=10.5.5.12 SubnetMask=255.255.252.0 Gateway=10.5.5.1 |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 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 |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 117 | 10.5.5.10 10.5.5.1 255.255.252.0 ${HTTP_ACCEPTED} |
| 118 | 10.5.5.11 10.5.5.1 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 |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 190 | [Setup] Redfish Power On |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 191 | [Teardown] Test Teardown Execution |
| 192 | |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 193 | 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] | 194 | Set VMI IPv4 Origin ${True} |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 195 | ${vmi_network_conf}= Get VMI Network Interface Details |
| 196 | Should Not Be Equal As Strings ${test_ipv4} ${vmi_network_conf["IPv4_Address"]} |
| 197 | |
Anves Kumar rayankula | 9fa524a | 2020-08-18 06:40:18 -0500 | [diff] [blame] | 198 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 199 | Verify VMI Static IP Configuration Persist On BMC Reset Before Host Boot |
| 200 | [Documentation] Verify VMI static IP configuration persist on BMC reset. |
| 201 | [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] | 202 | [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 203 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 204 | 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] | 205 | OBMC Reboot (off) |
| 206 | Redfish Power On |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 207 | # Verifying the VMI static configuration |
| 208 | Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask} |
| 209 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 210 | Add Static IP When Host Poweroff And Verify On Poweron |
| 211 | [Documentation] Add Static IP When Host Poweroff And Verify on power on |
| 212 | [Tags] Add_Static_IP_When_Host_Poweroff_And_Verify_On_Poweron |
| 213 | [Setup] Redfish Power Off |
| 214 | [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail |
| 215 | |
| 216 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
| 217 | Redfish Power On |
| 218 | Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask} |
| 219 | |
| 220 | Add VMI Static IP When Host Poweroff And Verify Static IP On BMC Reset |
| 221 | [Documentation] Add Static IP When Host Poweroff And Verify Static IP On BMC Reset. |
| 222 | [Tags] Add_VMI_Static_IP_When_Host_Poweroff_And_Verify_Static_IP_On_BMC_Reset |
| 223 | [Setup] Redfish Power Off |
| 224 | [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail |
| 225 | |
| 226 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
| 227 | OBMC Reboot (off) |
| 228 | Redfish Power On |
| 229 | Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask} |
| 230 | |
| 231 | Enable DHCP When No Static IP Configured And Verify DHCP IP |
| 232 | [Documentation] Enable DHCP when no static ip configured and verify dhcp ip |
| 233 | [Tags] Enable_DHCP_When_No_Static_IP_Configured_And_Verify_DHCP_IP |
| 234 | [Setup] Run Keyword And Ignore Error Delete VMI IPv4 Address |
| 235 | [Teardown] Test Teardown Execution |
| 236 | |
| 237 | ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 238 | Run Keyword If ${curr_origin} == ${False} Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED} |
| 239 | ${vmi_ip_config}= Get VMI Network Interface Details |
| 240 | Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]} DHCP ${vmi_ip_config["IPv4_Gateway"]} |
| 241 | ... ${vmi_ip_config["IPv4_SubnetMask"]} |
| 242 | |
| 243 | Verify User Cannot Delete VMI DHCP IP Address |
| 244 | [Documentation] Verify user cannot delete VMI DHCP IP Address |
| 245 | [Tags] Verify_User_Cannot_Delete_VMI_DHCP_IP_Address |
| 246 | [Setup] Set VMI IPv4 Origin ${True} |
| 247 | [Teardown] Test Teardown Execution |
| 248 | |
| 249 | Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_BAD_REQUEST} |
| 250 | ${active_channel_config}= Get Active Channel Config |
| 251 | ${resp}= Redfish.Get |
| 252 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 253 | Should Not Be Empty ${resp.dict["IPv4Addresses"]} |
| 254 | |
| 255 | Enable DHCP When Static IP Configured DHCP Server Unavailable And Verify IP |
| 256 | [Documentation] Enable DHCP When Static IP Configured And DHCP Server Unavailable And Verify No IP. |
| 257 | [Tags] Enable_DHCP_When_Static_IP_Configured_DHCP_Server_Unavailable_And_Verify_IP |
| 258 | [Teardown] Test Teardown Execution |
| 259 | |
| 260 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
| 261 | Set VMI IPv4 Origin ${True} |
| 262 | ${default}= Set Variable 0.0.0.0 |
| 263 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
| 264 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 265 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 266 | Verify To Configure VMI Static IP Address With Different User Roles |
| 267 | [Documentation] Verify to configure vmi static ip address with different user roles. |
| 268 | [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Different_User_Roles |
| 269 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 270 | [Template] Config VMI Static IP Address Using Different Users |
| 271 | [Teardown] Delete BMC Users Using Redfish |
| 272 | |
| 273 | # username password ip_address gateway nemask valid_status_code |
| 274 | admin_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_ACCEPTED} |
| 275 | operator_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN} |
| 276 | readonly_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN} |
| 277 | noaccess_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN} |
| 278 | |
| 279 | |
| 280 | Verify To Delete VMI Static IP Address With Different User Roles |
| 281 | [Documentation] Verify to delete vmi static IP address with different user roles. |
| 282 | [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Different_User_Roles |
| 283 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 284 | [Template] Delete VMI Static IP Address Using Different Users |
| 285 | [Teardown] Delete BMC Users Using Redfish |
| 286 | |
| 287 | # username password valid_status_code |
| 288 | admin_user TestPwd123 ${HTTP_ACCEPTED} |
| 289 | operator_user TestPwd123 ${HTTP_FORBIDDEN} |
| 290 | readonly_user TestPwd123 ${HTTP_FORBIDDEN} |
| 291 | noaccess_user TestPwd123 ${HTTP_FORBIDDEN} |
| 292 | |
| 293 | |
| 294 | Verify To Update VMI Static IP Address With Different User Roles |
| 295 | [Documentation] Verify to update vmi static IP address with different user roles. |
| 296 | [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Different_User_Roles_And_Verify |
| 297 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 298 | [Template] Config VMI Static IP Address Using Different Users |
| 299 | [Teardown] Delete BMC Users Using Redfish |
| 300 | |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 301 | # username password ip_address gateway netmask valid_status_code |
| 302 | admin_user TestPwd123 10.5.10.20 10.5.10.1 255.255.0.0 ${HTTP_ACCEPTED} |
| 303 | operator_user TestPwd123 10.5.10.30 10.5.10.1 255.255.0.0 ${HTTP_FORBIDDEN} |
| 304 | readonly_user TestPwd123 10.5.20.40 10.5.20.1 255.255.0.0 ${HTTP_FORBIDDEN} |
| 305 | noaccess_user TestPwd123 10.5.30.50 10.5.30.1 255.255.0.0 ${HTTP_FORBIDDEN} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 306 | |
| 307 | |
| 308 | Verify To Read VMI Network Configuration With Different User Roles |
| 309 | [Documentation] Verify to read vmi network configuration with different user roles. |
| 310 | [Tags] Verify_To_Read_VMI_Network_Configuration_Via_Different_User_Roles |
| 311 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 312 | [Template] Read VMI Static IP Address Using Different Users |
| 313 | [Teardown] Delete BMC Users Using Redfish |
| 314 | |
| 315 | # username password valid_status_code |
| 316 | admin_user TestPwd123 ${HTTP_OK} |
| 317 | operator_user TestPwd123 ${HTTP_OK} |
| 318 | readonly_user TestPwd123 ${HTTP_OK} |
| 319 | noaccess_user TestPwd123 ${HTTP_FORBIDDEN} |
| 320 | |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 321 | Enable DHCP On VMI Network Via Different Users Roles And Verify |
| 322 | [Documentation] Enable DHCP On VMI Network Via Different Users Roles And Verify. |
| 323 | [Tags] Enable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify |
| 324 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 325 | [Template] Update User Role And Set VMI IPv4 Origin |
| 326 | [Teardown] Delete BMC Users Using Redfish |
| 327 | |
| 328 | # username password dhcp_enabled valid_status_code |
| 329 | admin_user TestPwd123 ${True} ${HTTP_ACCEPTED} |
| 330 | operator_user TestPwd123 ${True} ${HTTP_FORBIDDEN} |
| 331 | readonly_user TestPwd123 ${True} ${HTTP_FORBIDDEN} |
| 332 | noaccess_user TestPwd123 ${True} ${HTTP_FORBIDDEN} |
| 333 | |
| 334 | Disable DHCP On VMI Network Via Different Users Roles And Verify |
| 335 | [Documentation] Disable DHCP On VMI Network Via Different Users Roles And Verify. |
| 336 | [Tags] Disable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify |
| 337 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 338 | [Template] Update User Role And Set VMI IPv4 Origin |
| 339 | [Teardown] Delete BMC Users Using Redfish |
| 340 | |
| 341 | # username password dhcp_enabled valid_status_code |
| 342 | admin_user TestPwd123 ${False} ${HTTP_ACCEPTED} |
| 343 | operator_user TestPwd123 ${False} ${HTTP_FORBIDDEN} |
| 344 | readonly_user TestPwd123 ${False} ${HTTP_FORBIDDEN} |
| 345 | noaccess_user TestPwd123 ${False} ${HTTP_FORBIDDEN} |
| 346 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 347 | |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 348 | Enable And Disable DHCP And Verify |
| 349 | [Documentation] verify enable DHCP and disable DHCP. |
| 350 | [Tags] Enabled_And_Disabled_DHCP_Verify |
| 351 | |
| 352 | Set VMI IPv4 Origin ${True} |
| 353 | ${default}= Set Variable 0.0.0.0 |
| 354 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
| 355 | Set VMI IPv4 Origin ${False} |
shrsuman123 | 7a0e7f5 | 2021-01-07 00:43:11 -0600 | [diff] [blame] | 356 | ${resp}= Redfish.Get |
| 357 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 358 | Should Be Empty ${resp.dict["IPv4Addresses"]} |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 359 | |
| 360 | |
| 361 | Multiple Times Enable And Disable DHCP And Verify |
| 362 | [Documentation] Enable and Disable DHCP in a loop and verify VMI gets an IP address from DHCP |
| 363 | ... each time when DHCP is enabled |
| 364 | [Tags] Multiple_Times_Enable_And_Disable_DHCP_And_Verify |
| 365 | |
| 366 | ${default}= Set Variable 0.0.0.0 |
| 367 | FOR ${i} IN RANGE ${2} |
| 368 | Set VMI IPv4 Origin ${True} |
| 369 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
| 370 | Set VMI IPv4 Origin ${False} |
shrsuman123 | 7a0e7f5 | 2021-01-07 00:43:11 -0600 | [diff] [blame] | 371 | ${resp}= Redfish.Get |
| 372 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 373 | Should Be Empty ${resp.dict["IPv4Addresses"]} |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 374 | END |
| 375 | |
| 376 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 377 | *** Keywords *** |
| 378 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 379 | Suite Setup Execution |
| 380 | [Documentation] Do test setup execution task. |
| 381 | |
| 382 | Redfish.Login |
| 383 | Redfish Power On |
| 384 | ${active_channel_config}= Get Active Channel Config |
| 385 | Set Suite Variable ${active_channel_config} |
| 386 | ${resp}= Redfish.Get |
| 387 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 388 | ${ip_resp}= Evaluate json.loads('''${resp.text}''') json |
| 389 | ${length}= Get Length ${ip_resp["IPv4StaticAddresses"]} |
| 390 | ${vmi_network_conf}= Run Keyword If ${length} != ${0} Get VMI Network Interface Details |
| 391 | Set Suite Variable ${vmi_network_conf} |
| 392 | |
| 393 | |
| 394 | Test Teardown Execution |
| 395 | [Documentation] Do test teardown execution task. |
| 396 | |
| 397 | FFDC On Test Case Fail |
| 398 | ${curr_mode}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 399 | Run Keyword If ${curr_mode} == ${True} Set VMI IPv4 Origin ${False} |
| 400 | Run Keyword If ${vmi_network_conf} != ${None} |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 401 | ... 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] | 402 | ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]} |
| 403 | |
| 404 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 405 | Get VMI Network Interface Details |
| 406 | [Documentation] Get VMI network interface details. |
| 407 | [Arguments] ${valid_status_code}=${HTTP_OK} |
| 408 | |
| 409 | # Description of argument(s): |
| 410 | # valid_status_code Expected valid status code from GET request. |
| 411 | |
Anves Kumar rayankula | aa33b05 | 2020-07-22 04:24:51 -0500 | [diff] [blame] | 412 | # Note: It returns a dictionary of VMI eth0 parameters. |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 413 | |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 414 | ${active_channel_config}= Get Active Channel Config |
| 415 | ${resp}= Redfish.Get |
| 416 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 417 | ... valid_status_codes=[${valid_status_code}] |
| 418 | |
| 419 | ${ip_resp}= Evaluate json.loads('''${resp.text}''') json |
| 420 | |
| 421 | ${static_exists}= Run Keyword And Ignore Error |
| 422 | ... Set Variable ${ip_resp["IPv4StaticAddresses"][0]["Address"]} |
| 423 | ${static_exists}= Set Variable If '${static_exists[0]}' == 'PASS' ${True} ${False} |
| 424 | |
| 425 | ${vmi_ip}= Create Dictionary DHCPv4=${${ip_resp["DHCPv4"]["DHCPEnabled"]}} Id=${ip_resp["Id"]} |
| 426 | ... Description=${ip_resp["Description"]} IPv4_Address=${ip_resp["IPv4Addresses"][0]["Address"]} |
| 427 | ... IPv4_AddressOrigin=${ip_resp["IPv4Addresses"][0]["AddressOrigin"]} Name=${ip_resp["Name"]} |
Sushil Singh | 810234d | 2020-05-13 12:12:03 -0500 | [diff] [blame] | 428 | ... IPv4_Gateway=${ip_resp["IPv4Addresses"][0]["Gateway"]} |
| 429 | ... InterfaceEnabled=${${ip_resp["InterfaceEnabled"]}} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 430 | ... IPv4_SubnetMask=${ip_resp["IPv4Addresses"][0]["SubnetMask"]} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 431 | ... IPv4StaticAddresses=${${static_exists}} |
| 432 | |
| 433 | [Return] &{vmi_ip} |
| 434 | |
| 435 | |
| 436 | Get Immediate Child Parameter From VMI Network Interface |
| 437 | [Documentation] Get immediate child parameter from VMI network interface. |
| 438 | [Arguments] ${parameter} ${valid_status_code}=${HTTP_OK} |
| 439 | |
| 440 | # Description of argument(s): |
| 441 | # parameter parameter for which value is required. Ex: DHCPEnabled, MACAddress etc. |
| 442 | # valid_status_code Expected valid status code from GET request. |
| 443 | |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 444 | ${active_channel_config}= Get Active Channel Config |
| 445 | ${resp}= Redfish.Get |
| 446 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 447 | ... valid_status_codes=[${valid_status_code}] |
| 448 | |
| 449 | ${ip_resp}= Evaluate json.loads('''${resp.text}''') json |
| 450 | ${value}= Set Variable If '${parameter}' != 'DHCPEnabled' ${ip_resp["${parameter}"]} |
| 451 | ... ${ip_resp["DHCPv4"]["${parameter}"]} |
| 452 | |
| 453 | [Return] ${value} |
| 454 | |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 455 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 456 | Verify VMI EthernetInterfaces |
| 457 | [Documentation] Verify VMI ethernet interfaces. |
| 458 | [Arguments] ${valid_status_code}=${HTTP_OK} |
| 459 | |
| 460 | # Description of argument(s): |
| 461 | # valid_status_code Expected valid status code from GET request. |
| 462 | |
| 463 | ${resp}= Redfish.Get /redfish/v1/Systems/hypervisor/EthernetInterfaces |
| 464 | ... valid_status_codes=[${valid_status_code}] |
| 465 | |
| 466 | ${resp}= Evaluate json.loads('''${resp.text}''') json |
| 467 | ${interfaces}= Set Variable ${resp["Members"]} |
| 468 | |
| 469 | Should Be Equal As Strings ${interfaces[0]}[@odata.id] |
Anves Kumar rayankula | aa33b05 | 2020-07-22 04:24:51 -0500 | [diff] [blame] | 470 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/eth0 |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 471 | Should Be Equal As Strings ${interfaces[1]}[@odata.id] |
Anves Kumar rayankula | aa33b05 | 2020-07-22 04:24:51 -0500 | [diff] [blame] | 472 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/eth1 |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 473 | |
| 474 | Should Be Equal ${resp["Members@odata.count"]} ${2} |
| 475 | |
| 476 | |
| 477 | Verify VMI Network Interface Details |
| 478 | [Documentation] Verify VMI network interface details. |
| 479 | [Arguments] ${ip} ${origin} ${gateway} ${netmask} |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 480 | ... ${valid_status_code}=${HTTP_OK} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 481 | |
| 482 | # Description of argument(s): |
| 483 | # ip VMI IPv4 address. |
| 484 | # origin Origin of IPv4 address eg. Static or DHCP. |
| 485 | # gateway Gateway for VMI IP. |
| 486 | # netmask Subnetmask for VMI IP. |
| 487 | # 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] | 488 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 489 | ${vmi_ip}= Get VMI Network Interface Details ${valid_status_code} |
| 490 | Should Be Equal As Strings ${origin} ${vmi_ip["IPv4_AddressOrigin"]} |
| 491 | Should Be Equal As Strings ${gateway} ${vmi_ip["IPv4_Gateway"]} |
| 492 | Should Be Equal As Strings ${netmask} ${vmi_ip["IPv4_SubnetMask"]} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 493 | Should Be Equal As Strings ${ip} ${vmi_ip["IPv4_Address"]} |
| 494 | |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 495 | |
| 496 | Set Static IPv4 Address To VMI And Verify |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 497 | [Documentation] Set static IPv4 address to VMI. |
| 498 | [Arguments] ${ip} ${gateway} ${netmask} ${valid_status_code}=${HTTP_ACCEPTED} |
| 499 | |
| 500 | # Description of argument(s): |
| 501 | # ip VMI IPv4 address. |
| 502 | # gateway Gateway for VMI IP. |
| 503 | # netmask Subnetmask for VMI IP. |
| 504 | # valid_status_code Expected valid status code from GET request. Default is HTTP_ACCEPTED. |
| 505 | |
| 506 | ${data}= Set Variable |
| 507 | ... {"IPv4StaticAddresses": [{"Address": "${ip}","SubnetMask": "${netmask}","Gateway": "${gateway}"}]} |
| 508 | |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 509 | ${active_channel_config}= Get Active Channel Config |
| 510 | ${resp}= Redfish.Patch |
| 511 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 512 | ... body=${data} valid_status_codes=[${valid_status_code}] |
Prashanth Katti | 1ce6821 | 2020-11-13 00:39:03 -0600 | [diff] [blame] | 513 | |
| 514 | # Wait few seconds for new configuration to get populated on runtime. |
| 515 | Sleep ${wait_time} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 516 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 517 | Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED} |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 518 | ${host_power_state} ${host_state}= Redfish Get Host State |
| 519 | Run Keyword If '${host_power_state}' == 'On' and '${host_state}' == 'Enabled' |
| 520 | ... Verify VMI Network Interface Details ${ip} Static ${gateway} ${netmask} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 521 | |
| 522 | |
| 523 | Delete VMI IPv4 Address |
| 524 | [Documentation] Delete VMI IPv4 address. |
| 525 | [Arguments] ${delete_param}=IPv4StaticAddresses ${valid_status_code}=${HTTP_ACCEPTED} |
| 526 | |
| 527 | # Description of argument(s): |
| 528 | # delete_param Parameter to be deleted eg. IPv4StaticAddresses or IPv4Addresses. |
| 529 | # Default is IPv4StaticAddresses. |
| 530 | # valid_status_code Expected valid status code from PATCH request. Default is HTTP_OK. |
| 531 | |
| 532 | ${data}= Set Variable {"${delete_param}": [${Null}]} |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 533 | ${active_channel_config}= Get Active Channel Config |
| 534 | ${resp}= Redfish.Patch |
| 535 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 536 | ... body=${data} valid_status_codes=[${valid_status_code}] |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 537 | |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 538 | Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED} |
| 539 | ${resp}= Redfish.Get |
| 540 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 541 | Should Be Empty ${resp.dict["IPv4StaticAddresses"]} |
| 542 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 543 | |
| 544 | Set VMI IPv4 Origin |
| 545 | [Documentation] Set VMI IPv4 origin. |
| 546 | [Arguments] ${dhcp_enabled}=${False} ${valid_status_code}=${HTTP_ACCEPTED} |
| 547 | |
| 548 | # Description of argument(s): |
| 549 | # dhcp_enabled True if user wants to enable DHCP. Default is Static, hence value is set to False. |
| 550 | # valid_status_code Expected valid status code from PATCH request. Default is HTTP_OK. |
| 551 | |
| 552 | ${data}= Set Variable If ${dhcp_enabled} == ${False} ${DISABLE_DHCP} ${ENABLE_DHCP} |
Anves Kumar rayankula | aa33b05 | 2020-07-22 04:24:51 -0500 | [diff] [blame] | 553 | ${resp}= Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/eth0 body=${data} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 554 | ... valid_status_codes=[${valid_status_code}] |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 555 | Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED} |
| 556 | ${resp}= Redfish.Get |
| 557 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 558 | Should Be Equal ${resp.dict["DHCPv4"]["DHCPEnabled"]} ${dhcp_enabled} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 559 | |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 560 | Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED} |
| 561 | ${resp}= Redfish.Get |
| 562 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 563 | Should Be Equal ${resp.dict["DHCPv4"]["DHCPEnabled"]} ${dhcp_enabled} |
| 564 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 565 | |
| 566 | Switch VMI IPv4 Origin And Verify Details |
| 567 | [Documentation] Switch VMI IPv4 origin and verify details. |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 568 | |
| 569 | ${curr_mode}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 570 | ${dhcp_enabled}= Set Variable If ${curr_mode} == ${False} ${True} ${False} |
| 571 | |
| 572 | ${default}= Set Variable 0.0.0.0 |
| 573 | ${origin}= Set Variable If ${curr_mode} == ${False} DHCP Static |
| 574 | Set VMI IPv4 Origin ${dhcp_enabled} ${HTTP_ACCEPTED} |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 575 | Verify VMI Network Interface Details ${default} ${origin} ${default} ${default} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 576 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 577 | |
| 578 | Delete VMI Static IP Address Using Different Users |
| 579 | [Documentation] Update user role and delete vmi static IP address. |
| 580 | [Arguments] ${username} ${password} ${valid_status_code} |
| 581 | [Teardown] Run Keywords Redfish.Login AND |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 582 | ... 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] | 583 | ... ${test_netmask} ${HTTP_ACCEPTED} AND Redfish.Logout |
| 584 | |
| 585 | # Description of argument(s): |
| 586 | # username The host username. |
| 587 | # password The host password. |
| 588 | # valid_status_code The expected valid status code. |
| 589 | |
| 590 | Redfish.Login ${username} ${password} |
| 591 | Delete VMI IPv4 Address delete_param=IPv4StaticAddresses valid_status_code=${valid_status_code} |
| 592 | Redfish.Logout |
| 593 | |
| 594 | |
| 595 | Config VMI Static IP Address Using Different Users |
| 596 | [Documentation] Update user role and update vmi static ip address. |
| 597 | [Arguments] ${username} ${password} ${ip} ${gateway} ${netmask} |
| 598 | ... ${valid_status_code} |
| 599 | |
| 600 | # Description of argument(s): |
| 601 | # username The host username. |
| 602 | # password The host password. |
| 603 | # ip IP address to be added (e.g. "10.7.7.7"). |
| 604 | # subnet_mask Subnet mask for the IP to be added |
| 605 | # (e.g. "255.255.0.0"). |
| 606 | # gateway Gateway for the IP to be added (e.g. "10.7.7.1"). |
| 607 | # valid_status_code The expected valid status code. |
| 608 | |
| 609 | Redfish.Login ${username} ${password} |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 610 | 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] | 611 | Redfish.Logout |
| 612 | |
| 613 | |
| 614 | Read VMI Static IP Address Using Different Users |
| 615 | [Documentation] Update user role and read vmi static ip address. |
| 616 | [Arguments] ${username} ${password} ${valid_status_code} |
| 617 | |
| 618 | # Description of argument(s): |
| 619 | # username The host username. |
| 620 | # password The host password. |
| 621 | # valid_status_code The expected valid status code. |
| 622 | |
| 623 | Redfish.Login ${username} ${password} |
| 624 | Redfish.Get |
| 625 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 626 | ... valid_status_codes=[${valid_status_code}] |
| 627 | Redfish.Logout |
| 628 | |
| 629 | |
| 630 | Delete BMC Users Using Redfish |
| 631 | [Documentation] Delete BMC users via redfish. |
| 632 | |
| 633 | Redfish.Login |
| 634 | Delete BMC Users Via Redfish users=${USERS} |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 635 | |
| 636 | Update User Role And Set VMI IPv4 Origin |
| 637 | [Documentation] Update User Role And Set VMI IPv4 Origin. |
| 638 | [Arguments] ${username} ${password} ${dhcp_enabled} ${valid_status_code} |
| 639 | |
| 640 | # Description of argument(s): |
| 641 | # username The host username. |
| 642 | # password The host password. |
| 643 | # dhcp_enabled Indicates whether dhcp should be enabled |
| 644 | # (${True}, ${False}). |
| 645 | # valid_status_code The expected valid status code. |
| 646 | |
| 647 | Redfish.Login ${username} ${password} |
| 648 | Set VMI IPv4 Origin ${dhcp_enabled} ${valid_status_code} |
| 649 | Redfish.Logout |