Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 3 | Documentation VMI static/dynamic IP config tests. |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 4 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 5 | Resource ../../lib/external_intf/vmi_utils.robot |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 6 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 7 | Suite Setup Suite Setup Execution |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 8 | Test Teardown FFDC On Test Case Fail |
George Keishing | 4e0978d | 2022-07-27 10:21:18 -0500 | [diff] [blame] | 9 | Suite Teardown Run Keyword And Ignore Error Suite Teardown Execution |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 10 | |
George Keishing | 725e066 | 2022-07-20 22:18:14 -0500 | [diff] [blame] | 11 | Force Tags vmi_interface_test |
| 12 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 13 | *** Variables *** |
| 14 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 15 | # users User Name password |
| 16 | @{ADMIN} admin_user TestPwd123 |
| 17 | @{OPERATOR} operator_user TestPwd123 |
| 18 | @{ReadOnly} readonly_user TestPwd123 |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 19 | &{USERS} Administrator=${ADMIN} ReadOnly=${ReadOnly} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 20 | |
Prashanth Katti | 1ce6821 | 2020-11-13 00:39:03 -0600 | [diff] [blame] | 21 | ${test_ipv4} 10.6.6.6 |
| 22 | ${test_gateway} 10.6.6.1 |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 23 | ${test_netmask} 255.255.252.0 |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 24 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 25 | &{DHCP_ENABLED} DHCPEnabled=${${True}} |
| 26 | &{DHCP_DISABLED} DHCPEnabled=${${False}} |
| 27 | |
| 28 | &{ENABLE_DHCP} DHCPv4=&{DHCP_ENABLED} |
| 29 | &{DISABLE_DHCP} DHCPv4=&{DHCP_DISABLED} |
Prashanth Katti | 1ce6821 | 2020-11-13 00:39:03 -0600 | [diff] [blame] | 30 | ${wait_time} 10s |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 31 | |
Megha G N | 02cbfa1 | 2022-12-12 02:05:03 -0600 | [diff] [blame] | 32 | ${default} 0.0.0.0 |
| 33 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 34 | |
| 35 | *** Test Cases *** |
| 36 | |
| 37 | Verify All VMI EthernetInterfaces |
| 38 | [Documentation] Verify all VMI ethernet interfaces. |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 39 | [Tags] Verify_All_VMI_EthernetInterfaces |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 40 | |
| 41 | Verify VMI EthernetInterfaces |
| 42 | |
| 43 | |
| 44 | Verify Existing VMI Network Interface Details |
| 45 | [Documentation] Verify existing VMI network interface details. |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 46 | [Tags] Verify_Existing_VMI_Network_Interface_Details |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 47 | |
| 48 | ${vmi_ip}= Get VMI Network Interface Details |
| 49 | ${origin}= Set Variable If ${vmi_ip["DHCPv4"]} == ${False} Static DHCP |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 50 | Should Not Be Equal ${vmi_ip["DHCPv4"]} ${vmi_ip["IPv4StaticAddresses"]} |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 51 | Should Be Equal As Strings ${vmi_ip["Id"]} ${ethernet_interface} |
George Keishing | b3ea095 | 2020-07-01 05:03:56 -0500 | [diff] [blame] | 52 | Should Be Equal As Strings ${vmi_ip["Description"]} |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 53 | ... Hypervisor's Virtual Management Ethernet Interface |
| 54 | Should Be Equal As Strings ${vmi_ip["Name"]} Hypervisor Ethernet Interface |
Megha G N | 4927463 | 2023-01-27 03:22:20 -0600 | [diff] [blame] | 55 | Run Keyword If '${vmi_ip["IPv4_Address"]}' != '${default}' |
| 56 | ... Should Be True ${vmi_ip["InterfaceEnabled"]} |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 57 | Run Keyword If ${vmi_ip["IPv4StaticAddresses"]} != @{empty} |
| 58 | ... Verify VMI Network Interface Details ${vmi_ip["IPv4_Address"]} |
| 59 | ... ${origin} ${vmi_ip["IPv4_Gateway"]} ${vmi_ip["IPv4_SubnetMask"]} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 60 | |
| 61 | |
| 62 | Delete Existing Static VMI IP Address |
| 63 | [Documentation] Delete existing static VMI IP address. |
| 64 | [Tags] Delete_Existing_Static_VMI_IP_Address |
| 65 | |
| 66 | ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 67 | Run Keyword If ${curr_origin} == ${True} Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED} |
| 68 | |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 69 | Delete VMI IPv4 Address |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 70 | |
| 71 | |
| 72 | Verify User Cannot Delete ReadOnly Property IPv4Addresses |
| 73 | [Documentation] Verify user cannot delete readonly property IPv4Addresses. |
| 74 | [Tags] Verify_User_Cannot_Delete_ReadOnly_Property_IPv4Addresses |
| 75 | |
| 76 | ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 77 | Run Keyword If ${curr_origin} == ${True} Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED} |
| 78 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
shrsuman123 | b25343d | 2021-09-22 04:33:47 -0500 | [diff] [blame] | 79 | Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_FORBIDDEN} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 80 | |
| 81 | |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 82 | Assign Valid And Invalid Static IPv4 Address To VMI |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 83 | [Documentation] Assign static IPv4 address to VMI. |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 84 | [Tags] Assign_Valid_And_Invalid_Static_IPv4_Address_To_VMI |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 85 | [Template] Set Static IPv4 Address To VMI And Verify |
| 86 | [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 87 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 88 | # ip gateway netmask valid_status_code |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 89 | 10.5.20.30 10.5.20.1 255.255.252.0 ${HTTP_ACCEPTED} |
| 90 | a.3.118.94 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST} |
Anves Kumar rayankula | 81fd9db | 2021-05-10 02:39:51 -0500 | [diff] [blame] | 91 | 10.5.20 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST} |
| 92 | 10.5.20.-5 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 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 105 | Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface} |
shrsuman123 | 993a5c9 | 2021-04-19 06:40:16 -0500 | [diff] [blame] | 106 | ... body={'IPv4StaticAddresses':${ips}} valid_status_codes=[${HTTP_BAD_REQUEST}] |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 107 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 108 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 109 | Modify IP Addresses On VMI Interface And Verify |
| 110 | [Documentation] Modify IP addresses on VMI interface and verify. |
| 111 | [Tags] Modify_IP_Addresses_On_VMI_Interface_And_Verify |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 112 | [Template] Set Static IPv4 Address To VMI And Verify |
| 113 | [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 114 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 115 | # ip gateway netmask valid_status_code |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 116 | 10.5.5.10 10.5.5.1 255.255.252.0 ${HTTP_ACCEPTED} |
| 117 | 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] | 118 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 119 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 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} |
Anves Kumar rayankula | 7936eee | 2021-04-19 05:38:36 -0500 | [diff] [blame] | 134 | Redfish Power Off stack_mode=skip |
| 135 | Redfish Power On |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 136 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 137 | |
| 138 | # Verifying persistency of static address. |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 139 | Switch VMI IPv4 Origin And Verify Details |
Anves Kumar rayankula | 7936eee | 2021-04-19 05:38:36 -0500 | [diff] [blame] | 140 | Redfish Power Off stack_mode=skip |
| 141 | Redfish Power On |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 142 | 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] | 143 | |
| 144 | |
Anves Kumar rayankula | 9fa524a | 2020-08-18 06:40:18 -0500 | [diff] [blame] | 145 | Delete VMI Static IP Address And Verify |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 146 | [Documentation] Delete VMI static IP address and verify. |
| 147 | [Tags] Delete_VMI_Static_IP_Address_And_Verify |
| 148 | [Teardown] Test Teardown Execution |
Anves Kumar rayankula | 9fa524a | 2020-08-18 06:40:18 -0500 | [diff] [blame] | 149 | |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 150 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
| 151 | Delete VMI IPv4 Address |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 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 |
shrsuman123 | b25343d | 2021-09-22 04:33:47 -0500 | [diff] [blame] | 157 | [Teardown] Run keywords Delete VMI IPv4 Address 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 |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 165 | Redfish.Login |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 166 | Redfish Power Off |
| 167 | Redfish Power On |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 168 | |
| 169 | Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask} |
| 170 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 171 | |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 172 | Verify Persistency Of VMI DHCP IP Configuration After Multiple HOST Reboots |
| 173 | [Documentation] Verify Persistency Of VMI DHCP IP configuration After Multiple HOST Reboots |
| 174 | [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] | 175 | [Teardown] Test Teardown Execution |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 176 | |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 177 | Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED} |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 178 | ${vmi_ip_config}= Get VMI Network Interface Details |
| 179 | # Verifying persistency of dynamic address after multiple reboots. |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 180 | FOR ${i} IN RANGE ${2} |
| 181 | Redfish Power Off |
| 182 | Redfish Power On |
George Keishing | 538f174 | 2022-03-14 05:00:55 -0500 | [diff] [blame] | 183 | Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]} |
| 184 | ... DHCP ${vmi_ip_config["IPv4_Gateway"]} ${vmi_ip_config["IPv4_SubnetMask"]} |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 185 | END |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 186 | |
| 187 | |
| 188 | Enable DHCP When Static IP Configured And Verify Static IP |
| 189 | [Documentation] Enable DHCP when static ip configured and verify static ip |
George Keishing | 4203fad | 2022-01-31 12:22:33 -0600 | [diff] [blame] | 190 | [Tags] Enable_DHCP_When_Static_IP_Configured_And_Verify_Static_IP |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 191 | [Setup] Redfish Power On |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 192 | [Teardown] Test Teardown Execution |
| 193 | |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 194 | 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] | 195 | Set VMI IPv4 Origin ${True} |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 196 | ${vmi_network_conf}= Get VMI Network Interface Details |
| 197 | Should Not Be Equal As Strings ${test_ipv4} ${vmi_network_conf["IPv4_Address"]} |
| 198 | |
Anves Kumar rayankula | 9fa524a | 2020-08-18 06:40:18 -0500 | [diff] [blame] | 199 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 200 | Verify VMI Static IP Configuration Persist On BMC Reset Before Host Boot |
| 201 | [Documentation] Verify VMI static IP configuration persist on BMC reset. |
| 202 | [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] | 203 | [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 204 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 205 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
Megha GN | be42859 | 2022-07-21 10:33:02 -0500 | [diff] [blame] | 206 | Redfish OBMC Reboot (off) stack_mode=skip |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 207 | Redfish Power On |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 208 | # Verifying the VMI static configuration |
| 209 | Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask} |
| 210 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 211 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 212 | Add Static IP When Host Poweroff And Verify On Poweron |
| 213 | [Documentation] Add Static IP When Host Poweroff And Verify on power on |
| 214 | [Tags] Add_Static_IP_When_Host_Poweroff_And_Verify_On_Poweron |
| 215 | [Setup] Redfish Power Off |
| 216 | [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail |
| 217 | |
| 218 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
| 219 | Redfish Power On |
| 220 | Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask} |
| 221 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 222 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 223 | Add VMI Static IP When Host Poweroff And Verify Static IP On BMC Reset |
| 224 | [Documentation] Add Static IP When Host Poweroff And Verify Static IP On BMC Reset. |
| 225 | [Tags] Add_VMI_Static_IP_When_Host_Poweroff_And_Verify_Static_IP_On_BMC_Reset |
| 226 | [Setup] Redfish Power Off |
| 227 | [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail |
| 228 | |
| 229 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
Megha GN | be42859 | 2022-07-21 10:33:02 -0500 | [diff] [blame] | 230 | Redfish OBMC Reboot (off) stack_mode=skip |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 231 | Redfish Power On |
| 232 | Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask} |
| 233 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 234 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 235 | Enable DHCP When No Static IP Configured And Verify DHCP IP |
| 236 | [Documentation] Enable DHCP when no static ip configured and verify dhcp ip |
| 237 | [Tags] Enable_DHCP_When_No_Static_IP_Configured_And_Verify_DHCP_IP |
| 238 | [Setup] Run Keyword And Ignore Error Delete VMI IPv4 Address |
| 239 | [Teardown] Test Teardown Execution |
| 240 | |
| 241 | ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 242 | Run Keyword If ${curr_origin} == ${False} Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED} |
| 243 | ${vmi_ip_config}= Get VMI Network Interface Details |
George Keishing | 538f174 | 2022-03-14 05:00:55 -0500 | [diff] [blame] | 244 | Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]} |
| 245 | ... DHCP ${vmi_ip_config["IPv4_Gateway"]} ${vmi_ip_config["IPv4_SubnetMask"]} |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 246 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 247 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 248 | Verify User Cannot Delete VMI DHCP IP Address |
| 249 | [Documentation] Verify user cannot delete VMI DHCP IP Address |
| 250 | [Tags] Verify_User_Cannot_Delete_VMI_DHCP_IP_Address |
| 251 | [Setup] Set VMI IPv4 Origin ${True} |
| 252 | [Teardown] Test Teardown Execution |
| 253 | |
shrsuman123 | b25343d | 2021-09-22 04:33:47 -0500 | [diff] [blame] | 254 | Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_FORBIDDEN} |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 255 | ${resp}= Redfish.Get |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 256 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface} |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 257 | Should Not Be Empty ${resp.dict["IPv4Addresses"]} |
| 258 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 259 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 260 | Enable DHCP When Static IP Configured DHCP Server Unavailable And Verify IP |
| 261 | [Documentation] Enable DHCP When Static IP Configured And DHCP Server Unavailable And Verify No IP. |
| 262 | [Tags] Enable_DHCP_When_Static_IP_Configured_DHCP_Server_Unavailable_And_Verify_IP |
| 263 | [Teardown] Test Teardown Execution |
| 264 | |
| 265 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
| 266 | Set VMI IPv4 Origin ${True} |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 267 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
| 268 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 269 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 270 | Verify To Configure VMI Static IP Address With Different User Roles |
| 271 | [Documentation] Verify to configure vmi static ip address with different user roles. |
| 272 | [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Different_User_Roles |
Megha G N | 4e2b573 | 2023-02-02 04:52:27 -0600 | [diff] [blame] | 273 | [Setup] Run Keywords Delete BMC Users Using Redfish |
| 274 | ... AND Create Users With Different Roles users=${USERS} force=${True} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 275 | [Template] Config VMI Static IP Address Using Different Users |
| 276 | [Teardown] Delete BMC Users Using Redfish |
| 277 | |
| 278 | # username password ip_address gateway nemask valid_status_code |
| 279 | admin_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_ACCEPTED} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 280 | readonly_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 281 | |
| 282 | |
| 283 | Verify To Configure VMI Static IP Address With Operator User Role |
| 284 | [Documentation] Verify to configure vmi static ip address with operator user role. |
| 285 | [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Operator_User_Role |
| 286 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 287 | [Template] Config VMI Static IP Address Using Different Users |
| 288 | [Teardown] Delete BMC Users Using Redfish |
| 289 | |
| 290 | # username password ip_address gateway nemask valid_status_code |
| 291 | operator_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 292 | |
| 293 | |
| 294 | Verify To Delete VMI Static IP Address With Different User Roles |
| 295 | [Documentation] Verify to delete vmi static IP address with different user roles. |
| 296 | [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Different_User_Roles |
| 297 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 298 | [Template] Delete VMI Static IP Address Using Different Users |
| 299 | [Teardown] Delete BMC Users Using Redfish |
| 300 | |
| 301 | # username password valid_status_code |
| 302 | admin_user TestPwd123 ${HTTP_ACCEPTED} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 303 | readonly_user TestPwd123 ${HTTP_FORBIDDEN} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 304 | |
| 305 | |
| 306 | Verify To Delete VMI Static IP Address With Operator User Role |
| 307 | [Documentation] Verify to delete vmi static IP address with operator user role. |
| 308 | [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Operator_User_Role |
| 309 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 310 | [Template] Delete VMI Static IP Address Using Different Users |
| 311 | [Teardown] Delete BMC Users Using Redfish |
| 312 | |
| 313 | # username password valid_status_code |
| 314 | operator_user TestPwd123 ${HTTP_FORBIDDEN} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 315 | |
| 316 | |
| 317 | Verify To Update VMI Static IP Address With Different User Roles |
| 318 | [Documentation] Verify to update vmi static IP address with different user roles. |
George Keishing | 4203fad | 2022-01-31 12:22:33 -0600 | [diff] [blame] | 319 | [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Different_User_Roles |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 320 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 321 | [Template] Config VMI Static IP Address Using Different Users |
| 322 | [Teardown] Delete BMC Users Using Redfish |
| 323 | |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 324 | # username password ip_address gateway netmask valid_status_code |
| 325 | admin_user TestPwd123 10.5.10.20 10.5.10.1 255.255.0.0 ${HTTP_ACCEPTED} |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 326 | readonly_user TestPwd123 10.5.20.40 10.5.20.1 255.255.0.0 ${HTTP_FORBIDDEN} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 327 | |
| 328 | |
| 329 | Verify To Update VMI Static IP Address With Operator User Role |
| 330 | [Documentation] Verify to update vmi static IP address with operator user role. |
| 331 | [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Operator_User_Role |
| 332 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 333 | [Template] Config VMI Static IP Address Using Different Users |
| 334 | [Teardown] Delete BMC Users Using Redfish |
| 335 | |
| 336 | # username password ip_address gateway netmask valid_status_code |
| 337 | operator_user TestPwd123 10.5.10.30 10.5.10.1 255.255.0.0 ${HTTP_FORBIDDEN} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 338 | |
| 339 | |
| 340 | Verify To Read VMI Network Configuration With Different User Roles |
| 341 | [Documentation] Verify to read vmi network configuration with different user roles. |
George Keishing | 4203fad | 2022-01-31 12:22:33 -0600 | [diff] [blame] | 342 | [Tags] Verify_To_Read_VMI_Network_Configuration_With_Different_User_Roles |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 343 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 344 | [Template] Read VMI Static IP Address Using Different Users |
| 345 | [Teardown] Delete BMC Users Using Redfish |
| 346 | |
| 347 | # username password valid_status_code |
| 348 | admin_user TestPwd123 ${HTTP_OK} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 349 | readonly_user TestPwd123 ${HTTP_OK} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 350 | |
| 351 | |
| 352 | Verify To Read VMI Network Configuration With Operator User Role |
| 353 | [Documentation] Verify to read vmi network configuration with operator user role. |
| 354 | [Tags] Verify_To_Read_VMI_Network_Configuration_With_Operator_User_Role |
| 355 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 356 | [Template] Read VMI Static IP Address Using Different Users |
| 357 | [Teardown] Delete BMC Users Using Redfish |
| 358 | |
| 359 | # username password valid_status_code |
| 360 | operator_user TestPwd123 ${HTTP_FORBIDDEN} |
| 361 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 362 | |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 363 | Enable DHCP On VMI Network Via Different Users Roles And Verify |
| 364 | [Documentation] Enable DHCP On VMI Network Via Different Users Roles And Verify. |
| 365 | [Tags] Enable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify |
| 366 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 367 | [Template] Update User Role And Set VMI IPv4 Origin |
| 368 | [Teardown] Delete BMC Users Using Redfish |
| 369 | |
| 370 | # username password dhcp_enabled valid_status_code |
| 371 | admin_user TestPwd123 ${True} ${HTTP_ACCEPTED} |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 372 | readonly_user TestPwd123 ${True} ${HTTP_FORBIDDEN} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 373 | |
| 374 | |
| 375 | Enable DHCP On VMI Network Via Operator User Role And Verify |
| 376 | [Documentation] Enable DHCP On VMI Network Via Operator User Role And Verify. |
| 377 | [Tags] Enable_DHCP_On_VMI_Network_Via_Operator_User_Role_And_Verify |
| 378 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 379 | [Template] Update User Role And Set VMI IPv4 Origin |
| 380 | [Teardown] Delete BMC Users Using Redfish |
| 381 | |
| 382 | # username password dhcp_enabled valid_status_code |
| 383 | operator_user TestPwd123 ${True} ${HTTP_FORBIDDEN} |
| 384 | |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 385 | |
| 386 | Disable DHCP On VMI Network Via Different Users Roles And Verify |
| 387 | [Documentation] Disable DHCP On VMI Network Via Different Users Roles And Verify. |
| 388 | [Tags] Disable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify |
| 389 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 390 | [Template] Update User Role And Set VMI IPv4 Origin |
| 391 | [Teardown] Delete BMC Users Using Redfish |
| 392 | |
| 393 | # username password dhcp_enabled valid_status_code |
| 394 | admin_user TestPwd123 ${False} ${HTTP_ACCEPTED} |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 395 | readonly_user TestPwd123 ${False} ${HTTP_FORBIDDEN} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 396 | |
| 397 | |
| 398 | Disable DHCP On VMI Network Via Operator User Role And Verify |
| 399 | [Documentation] Disable DHCP On VMI Network Via Operator User Role And Verify. |
| 400 | [Tags] Disable_DHCP_On_VMI_Network_Via_Operator_User_Role_And_Verify |
| 401 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 402 | [Template] Update User Role And Set VMI IPv4 Origin |
| 403 | [Teardown] Delete BMC Users Using Redfish |
| 404 | |
| 405 | # username password dhcp_enabled valid_status_code |
| 406 | operator_user TestPwd123 ${False} ${HTTP_FORBIDDEN} |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 407 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 408 | |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 409 | Enable And Disable DHCP And Verify |
| 410 | [Documentation] verify enable DHCP and disable DHCP. |
George Keishing | 4203fad | 2022-01-31 12:22:33 -0600 | [diff] [blame] | 411 | [Tags] Enable_And_Disable_DHCP_And_Verify |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 412 | |
| 413 | Set VMI IPv4 Origin ${True} |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 414 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
| 415 | Set VMI IPv4 Origin ${False} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 416 | Verify VMI Network Interface Details ${default} Static ${default} ${default} |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 417 | |
| 418 | |
| 419 | Multiple Times Enable And Disable DHCP And Verify |
| 420 | [Documentation] Enable and Disable DHCP in a loop and verify VMI gets an IP address from DHCP |
| 421 | ... each time when DHCP is enabled |
| 422 | [Tags] Multiple_Times_Enable_And_Disable_DHCP_And_Verify |
| 423 | |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 424 | FOR ${i} IN RANGE ${2} |
| 425 | Set VMI IPv4 Origin ${True} |
| 426 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
| 427 | Set VMI IPv4 Origin ${False} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 428 | Verify VMI Network Interface Details ${default} Static ${default} ${default} |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 429 | END |
| 430 | |
| 431 | |
Anves Kumar rayankula | 81fd9db | 2021-05-10 02:39:51 -0500 | [diff] [blame] | 432 | Assign Static IPv4 Address With Invalid Netmask To VMI |
| 433 | [Documentation] Assign static IPv4 address with invalid netmask and expect error. |
| 434 | [Tags] Assign_Static_IPv4_Address_With_Invalid_Netmask_To_VMI |
| 435 | [Template] Set Static IPv4 Address To VMI And Verify |
| 436 | |
| 437 | # ip gateway netmask valid_status_code |
| 438 | ${test_ipv4} ${test_gateway} 255.256.255.0 ${HTTP_BAD_REQUEST} |
| 439 | ${test_ipv4} ${test_gateway} ff.ff.ff.ff ${HTTP_BAD_REQUEST} |
| 440 | ${test_ipv4} ${test_gateway} 255.255.253.0 ${HTTP_BAD_REQUEST} |
| 441 | |
| 442 | |
| 443 | Assign Static IPv4 Address With Invalid Gateway To VMI |
| 444 | [Documentation] Add static IPv4 address with invalid gateway and expect error. |
| 445 | [Tags] Assign_Static_IPv4_Address_With_Invalid_Gateway_To_VMI |
| 446 | [Template] Set Static IPv4 Address To VMI And Verify |
| 447 | |
| 448 | # ip gateway netmask valid_status_code |
| 449 | ${test_ipv4} @@@.%%.44.11 ${test_netmask} ${HTTP_BAD_REQUEST} |
| 450 | ${test_ipv4} 0xa.0xb.0xc.0xd ${test_netmask} ${HTTP_BAD_REQUEST} |
| 451 | ${test_ipv4} 10.3.36 ${test_netmask} ${HTTP_BAD_REQUEST} |
| 452 | ${test_ipv4} 10.3.36.-10 ${test_netmask} ${HTTP_BAD_REQUEST} |
| 453 | |
| 454 | |
Megha G N | 02cbfa1 | 2022-12-12 02:05:03 -0600 | [diff] [blame] | 455 | Enable DHCP When Host Is Off And Verify After Poweron |
| 456 | [Documentation] Enable DHCP when host is off and |
| 457 | ... check whether it is enabled after poweron. |
| 458 | [Tags] Enable_DHCP_When_Host_Is_Off_And_Verify_After_Poweron |
| 459 | [Setup] Redfish Power Off stack_mode=skip |
| 460 | |
| 461 | Set VMI IPv4 Origin ${True} |
| 462 | Redfish Power On stack_mode=skip |
| 463 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
| 464 | |
| 465 | |
Megha G N | 8917468 | 2023-01-24 23:28:27 -0600 | [diff] [blame] | 466 | Disable DHCP When Host Is Off And Verify New State Reflects After Power On |
| 467 | [Documentation] Disable DHCP when host is off and |
| 468 | ... get network info and verify that VMI origin is static. |
| 469 | [Tags] Disable_DHCP_When_Host_Is_Off_And_Verify_New_State_Reflects_After_Power_On |
| 470 | [Setup] Redfish Power Off stack_mode=skip |
| 471 | |
| 472 | Set VMI IPv4 Origin ${False} |
| 473 | Redfish Power On stack_mode=skip |
| 474 | Verify VMI Network Interface Details ${default} Static ${default} ${default} |
| 475 | |
| 476 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 477 | *** Keywords *** |
| 478 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 479 | Suite Setup Execution |
| 480 | [Documentation] Do test setup execution task. |
| 481 | |
| 482 | Redfish.Login |
| 483 | Redfish Power On |
| 484 | ${active_channel_config}= Get Active Channel Config |
| 485 | Set Suite Variable ${active_channel_config} |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 486 | Set Suite Variable ${ethernet_interface} ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 487 | ${resp}= Redfish.Get |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 488 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface} |
shrsuman123 | 62e5be5 | 2021-05-20 02:42:59 -0500 | [diff] [blame] | 489 | ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 490 | ${length}= Get Length ${ip_resp["IPv4StaticAddresses"]} |
| 491 | ${vmi_network_conf}= Run Keyword If ${length} != ${0} Get VMI Network Interface Details |
| 492 | Set Suite Variable ${vmi_network_conf} |
| 493 | |
| 494 | |
| 495 | Test Teardown Execution |
| 496 | [Documentation] Do test teardown execution task. |
| 497 | |
| 498 | FFDC On Test Case Fail |
| 499 | ${curr_mode}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 500 | Run Keyword If ${curr_mode} == ${True} Set VMI IPv4 Origin ${False} |
| 501 | Run Keyword If ${vmi_network_conf} != ${None} |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 502 | ... 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] | 503 | ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]} |
| 504 | |
| 505 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 506 | Get Immediate Child Parameter From VMI Network Interface |
| 507 | [Documentation] Get immediate child parameter from VMI network interface. |
| 508 | [Arguments] ${parameter} ${valid_status_code}=${HTTP_OK} |
| 509 | |
| 510 | # Description of argument(s): |
| 511 | # parameter parameter for which value is required. Ex: DHCPEnabled, MACAddress etc. |
| 512 | # valid_status_code Expected valid status code from GET request. |
| 513 | |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 514 | ${resp}= Redfish.Get |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 515 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 516 | ... valid_status_codes=[${valid_status_code}] |
| 517 | |
shrsuman123 | 62e5be5 | 2021-05-20 02:42:59 -0500 | [diff] [blame] | 518 | ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 519 | ${value}= Set Variable If '${parameter}' != 'DHCPEnabled' ${ip_resp["${parameter}"]} |
| 520 | ... ${ip_resp["DHCPv4"]["${parameter}"]} |
| 521 | |
| 522 | [Return] ${value} |
| 523 | |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 524 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 525 | Switch VMI IPv4 Origin And Verify Details |
| 526 | [Documentation] Switch VMI IPv4 origin and verify details. |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 527 | |
Anves Kumar rayankula | 7936eee | 2021-04-19 05:38:36 -0500 | [diff] [blame] | 528 | ${dhcp_mode_before}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
Anves Kumar rayankula | e7dc89a | 2021-04-28 04:29:38 -0500 | [diff] [blame] | 529 | ${dhcp_enabled}= Set Variable If ${dhcp_mode_before} == ${False} ${True} ${False} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 530 | |
Anves Kumar rayankula | e7dc89a | 2021-04-28 04:29:38 -0500 | [diff] [blame] | 531 | ${origin}= Set Variable If ${dhcp_mode_before} == ${False} DHCP Static |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 532 | Set VMI IPv4 Origin ${dhcp_enabled} ${HTTP_ACCEPTED} |
Anves Kumar rayankula | 7936eee | 2021-04-19 05:38:36 -0500 | [diff] [blame] | 533 | |
| 534 | ${dhcp_mode_after}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 535 | Should Not Be Equal ${dhcp_mode_before} ${dhcp_mode_after} |
| 536 | |
| 537 | Run Keyword If ${dhcp_mode_after} == ${True} |
| 538 | ... Verify VMI Network Interface Details ${default} ${origin} ${default} ${default} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 539 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 540 | |
| 541 | Delete VMI Static IP Address Using Different Users |
| 542 | [Documentation] Update user role and delete vmi static IP address. |
| 543 | [Arguments] ${username} ${password} ${valid_status_code} |
| 544 | [Teardown] Run Keywords Redfish.Login AND |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 545 | ... 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] | 546 | ... ${test_netmask} ${HTTP_ACCEPTED} AND Redfish.Logout |
| 547 | |
| 548 | # Description of argument(s): |
| 549 | # username The host username. |
| 550 | # password The host password. |
| 551 | # valid_status_code The expected valid status code. |
| 552 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 553 | # TODO: operator_user role is not yet supported. |
| 554 | Skip If '${username}' == 'operator_user' |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 555 | Redfish.Login ${username} ${password} |
| 556 | Delete VMI IPv4 Address delete_param=IPv4StaticAddresses valid_status_code=${valid_status_code} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 557 | |
| 558 | |
| 559 | Config VMI Static IP Address Using Different Users |
| 560 | [Documentation] Update user role and update vmi static ip address. |
| 561 | [Arguments] ${username} ${password} ${ip} ${gateway} ${netmask} |
| 562 | ... ${valid_status_code} |
| 563 | |
| 564 | # Description of argument(s): |
| 565 | # username The host username. |
| 566 | # password The host password. |
| 567 | # ip IP address to be added (e.g. "10.7.7.7"). |
| 568 | # subnet_mask Subnet mask for the IP to be added |
| 569 | # (e.g. "255.255.0.0"). |
| 570 | # gateway Gateway for the IP to be added (e.g. "10.7.7.1"). |
| 571 | # valid_status_code The expected valid status code. |
| 572 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 573 | # TODO: operator_user role is not yet supported. |
| 574 | Skip If '${username}' == 'operator_user' |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 575 | Redfish.Login ${username} ${password} |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 576 | 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] | 577 | |
| 578 | |
| 579 | Read VMI Static IP Address Using Different Users |
| 580 | [Documentation] Update user role and read vmi static ip address. |
| 581 | [Arguments] ${username} ${password} ${valid_status_code} |
| 582 | |
| 583 | # Description of argument(s): |
| 584 | # username The host username. |
| 585 | # password The host password. |
| 586 | # valid_status_code The expected valid status code. |
| 587 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 588 | # TODO: operator_user role is not yet supported. |
| 589 | Skip If '${username}' == 'operator_user' |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 590 | Redfish.Login ${username} ${password} |
| 591 | Redfish.Get |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 592 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 593 | ... valid_status_codes=[${valid_status_code}] |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 594 | |
| 595 | |
| 596 | Delete BMC Users Using Redfish |
| 597 | [Documentation] Delete BMC users via redfish. |
| 598 | |
| 599 | Redfish.Login |
| 600 | Delete BMC Users Via Redfish users=${USERS} |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 601 | |
Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 602 | |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 603 | Update User Role And Set VMI IPv4 Origin |
| 604 | [Documentation] Update User Role And Set VMI IPv4 Origin. |
| 605 | [Arguments] ${username} ${password} ${dhcp_enabled} ${valid_status_code} |
| 606 | |
| 607 | # Description of argument(s): |
| 608 | # username The host username. |
| 609 | # password The host password. |
| 610 | # dhcp_enabled Indicates whether dhcp should be enabled |
| 611 | # (${True}, ${False}). |
| 612 | # valid_status_code The expected valid status code. |
| 613 | |
Megha GN | be42859 | 2022-07-21 10:33:02 -0500 | [diff] [blame] | 614 | # TODO: operator_user role is not yet supported. |
| 615 | Skip If '${username}' == 'operator_user' |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 616 | Redfish.Login ${username} ${password} |
| 617 | Set VMI IPv4 Origin ${dhcp_enabled} ${valid_status_code} |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 618 | |
Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 619 | |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 620 | Suite Teardown Execution |
| 621 | [Documentation] Do suite teardown execution task. |
| 622 | |
| 623 | Run Keyword If ${vmi_network_conf} != ${None} |
| 624 | ... Set Static IPv4 Address To VMI And Verify ${vmi_network_conf["IPv4_Address"]} |
| 625 | ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]} |
shrsuman123 | b25343d | 2021-09-22 04:33:47 -0500 | [diff] [blame] | 626 | Delete All Redfish Sessions |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 627 | Redfish.Logout |