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 | |
| 32 | |
| 33 | *** Test Cases *** |
| 34 | |
| 35 | Verify All VMI EthernetInterfaces |
| 36 | [Documentation] Verify all VMI ethernet interfaces. |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 37 | [Tags] Verify_All_VMI_EthernetInterfaces |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 38 | |
| 39 | Verify VMI EthernetInterfaces |
| 40 | |
| 41 | |
| 42 | Verify Existing VMI Network Interface Details |
| 43 | [Documentation] Verify existing VMI network interface details. |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 44 | [Tags] Verify_Existing_VMI_Network_Interface_Details |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 45 | |
| 46 | ${vmi_ip}= Get VMI Network Interface Details |
| 47 | ${origin}= Set Variable If ${vmi_ip["DHCPv4"]} == ${False} Static DHCP |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 48 | Should Not Be Equal ${vmi_ip["DHCPv4"]} ${vmi_ip["IPv4StaticAddresses"]} |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 49 | Should Be Equal As Strings ${vmi_ip["Id"]} ${ethernet_interface} |
George Keishing | b3ea095 | 2020-07-01 05:03:56 -0500 | [diff] [blame] | 50 | Should Be Equal As Strings ${vmi_ip["Description"]} |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 51 | ... Hypervisor's Virtual Management Ethernet Interface |
| 52 | Should Be Equal As Strings ${vmi_ip["Name"]} Hypervisor Ethernet Interface |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 53 | Should Be True ${vmi_ip["InterfaceEnabled"]} |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 54 | Run Keyword If ${vmi_ip["IPv4StaticAddresses"]} != @{empty} |
| 55 | ... Verify VMI Network Interface Details ${vmi_ip["IPv4_Address"]} |
| 56 | ... ${origin} ${vmi_ip["IPv4_Gateway"]} ${vmi_ip["IPv4_SubnetMask"]} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 57 | |
| 58 | |
| 59 | Delete Existing Static VMI IP Address |
| 60 | [Documentation] Delete existing static VMI IP address. |
| 61 | [Tags] Delete_Existing_Static_VMI_IP_Address |
| 62 | |
| 63 | ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 64 | Run Keyword If ${curr_origin} == ${True} Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED} |
| 65 | |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 66 | Delete VMI IPv4 Address |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 67 | |
| 68 | |
| 69 | Verify User Cannot Delete ReadOnly Property IPv4Addresses |
| 70 | [Documentation] Verify user cannot delete readonly property IPv4Addresses. |
| 71 | [Tags] Verify_User_Cannot_Delete_ReadOnly_Property_IPv4Addresses |
| 72 | |
| 73 | ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 74 | Run Keyword If ${curr_origin} == ${True} Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED} |
| 75 | 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] | 76 | Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_FORBIDDEN} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 77 | |
| 78 | |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 79 | Assign Valid And Invalid Static IPv4 Address To VMI |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 80 | [Documentation] Assign static IPv4 address to VMI. |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 81 | [Tags] Assign_Valid_And_Invalid_Static_IPv4_Address_To_VMI |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 82 | [Template] Set Static IPv4 Address To VMI And Verify |
| 83 | [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 84 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 85 | # ip gateway netmask valid_status_code |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 86 | 10.5.20.30 10.5.20.1 255.255.252.0 ${HTTP_ACCEPTED} |
| 87 | 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] | 88 | 10.5.20 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST} |
| 89 | 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] | 90 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 91 | |
George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 92 | Add Multiple IP Addresses On VMI Interface And Verify |
| 93 | [Documentation] Add multiple IP addresses on VMI interface and verify. |
| 94 | [Tags] Add_Multiple_IP_Addresses_On_VMI_Interface_And_Verify |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 95 | [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 96 | |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 97 | ${ip1}= Create dictionary Address=10.5.5.10 SubnetMask=255.255.252.0 Gateway=10.5.5.1 |
| 98 | ${ip2}= Create dictionary Address=10.5.5.11 SubnetMask=255.255.252.0 Gateway=10.5.5.1 |
| 99 | ${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] | 100 | ${ips}= Create List ${ip1} ${ip2} ${ip3} |
| 101 | |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 102 | Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface} |
shrsuman123 | 993a5c9 | 2021-04-19 06:40:16 -0500 | [diff] [blame] | 103 | ... body={'IPv4StaticAddresses':${ips}} valid_status_codes=[${HTTP_BAD_REQUEST}] |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 104 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 105 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 106 | Modify IP Addresses On VMI Interface And Verify |
| 107 | [Documentation] Modify IP addresses on VMI interface and verify. |
| 108 | [Tags] Modify_IP_Addresses_On_VMI_Interface_And_Verify |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 109 | [Template] Set Static IPv4 Address To VMI And Verify |
| 110 | [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 111 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 112 | # ip gateway netmask valid_status_code |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 113 | 10.5.5.10 10.5.5.1 255.255.252.0 ${HTTP_ACCEPTED} |
| 114 | 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] | 115 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 116 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 117 | Switch Between IP Origins On VMI And Verify Details |
| 118 | [Documentation] Switch between IP origins on VMI and verify details. |
| 119 | [Tags] Switch_Between_IP_Origins_On_VMI_And_Verify_Details |
| 120 | |
| 121 | Switch VMI IPv4 Origin And Verify Details |
| 122 | Switch VMI IPv4 Origin And Verify Details |
| 123 | |
| 124 | |
| 125 | Verify Persistency Of VMI IPv4 Details After Host Reboot |
| 126 | [Documentation] Verify persistency of VMI IPv4 details after host reboot. |
| 127 | [Tags] Verify_Persistency_Of_VMI_IPv4_Details_After_Host_Reboot |
| 128 | |
| 129 | # Verifying persistency of dynamic address. |
| 130 | Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED} |
Anves Kumar rayankula | 7936eee | 2021-04-19 05:38:36 -0500 | [diff] [blame] | 131 | Redfish Power Off stack_mode=skip |
| 132 | Redfish Power On |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 133 | ${default}= Set Variable 0.0.0.0 |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 134 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 135 | |
| 136 | # Verifying persistency of static address. |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 137 | Switch VMI IPv4 Origin And Verify Details |
Anves Kumar rayankula | 7936eee | 2021-04-19 05:38:36 -0500 | [diff] [blame] | 138 | Redfish Power Off stack_mode=skip |
| 139 | Redfish Power On |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 140 | 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] | 141 | |
| 142 | |
Anves Kumar rayankula | 9fa524a | 2020-08-18 06:40:18 -0500 | [diff] [blame] | 143 | Delete VMI Static IP Address And Verify |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 144 | [Documentation] Delete VMI static IP address and verify. |
| 145 | [Tags] Delete_VMI_Static_IP_Address_And_Verify |
| 146 | [Teardown] Test Teardown Execution |
Anves Kumar rayankula | 9fa524a | 2020-08-18 06:40:18 -0500 | [diff] [blame] | 147 | |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 148 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
| 149 | Delete VMI IPv4 Address |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 150 | |
Anves Kumar rayankula | 9fa524a | 2020-08-18 06:40:18 -0500 | [diff] [blame] | 151 | |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 152 | Verify Successful VMI IP Static Configuration On HOST Boot After Session Delete |
| 153 | [Documentation] Verify VMI IP static Configuration On HOST Boot After session deleted. |
| 154 | [Tags] Verify_Successful_VMI_IP_Static_Configuration_On_HOST_Boot_After_Session_Delete |
shrsuman123 | b25343d | 2021-09-22 04:33:47 -0500 | [diff] [blame] | 155 | [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 156 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 157 | 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] | 158 | |
| 159 | ${session_info}= Get Redfish Session Info |
| 160 | Redfish.Delete ${session_info["location"]} |
| 161 | |
| 162 | # Create a new Redfish session |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 163 | Redfish.Login |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 164 | Redfish Power Off |
| 165 | Redfish Power On |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 166 | |
| 167 | Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask} |
| 168 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 169 | |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 170 | Verify Persistency Of VMI DHCP IP Configuration After Multiple HOST Reboots |
| 171 | [Documentation] Verify Persistency Of VMI DHCP IP configuration After Multiple HOST Reboots |
| 172 | [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] | 173 | [Teardown] Test Teardown Execution |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 174 | |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 175 | Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED} |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 176 | ${vmi_ip_config}= Get VMI Network Interface Details |
| 177 | # Verifying persistency of dynamic address after multiple reboots. |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 178 | FOR ${i} IN RANGE ${2} |
| 179 | Redfish Power Off |
| 180 | Redfish Power On |
George Keishing | 538f174 | 2022-03-14 05:00:55 -0500 | [diff] [blame] | 181 | Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]} |
| 182 | ... DHCP ${vmi_ip_config["IPv4_Gateway"]} ${vmi_ip_config["IPv4_SubnetMask"]} |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 183 | END |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 184 | |
| 185 | |
| 186 | Enable DHCP When Static IP Configured And Verify Static IP |
| 187 | [Documentation] Enable DHCP when static ip configured and verify static ip |
George Keishing | 4203fad | 2022-01-31 12:22:33 -0600 | [diff] [blame] | 188 | [Tags] Enable_DHCP_When_Static_IP_Configured_And_Verify_Static_IP |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 189 | [Setup] Redfish Power On |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 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} |
Megha GN | be42859 | 2022-07-21 10:33:02 -0500 | [diff] [blame] | 204 | Redfish OBMC Reboot (off) stack_mode=skip |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 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 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 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 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 220 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 221 | Add VMI Static IP When Host Poweroff And Verify Static IP On BMC Reset |
| 222 | [Documentation] Add Static IP When Host Poweroff And Verify Static IP On BMC Reset. |
| 223 | [Tags] Add_VMI_Static_IP_When_Host_Poweroff_And_Verify_Static_IP_On_BMC_Reset |
| 224 | [Setup] Redfish Power Off |
| 225 | [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail |
| 226 | |
| 227 | 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] | 228 | Redfish OBMC Reboot (off) stack_mode=skip |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 229 | Redfish Power On |
| 230 | Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask} |
| 231 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 232 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 233 | Enable DHCP When No Static IP Configured And Verify DHCP IP |
| 234 | [Documentation] Enable DHCP when no static ip configured and verify dhcp ip |
| 235 | [Tags] Enable_DHCP_When_No_Static_IP_Configured_And_Verify_DHCP_IP |
| 236 | [Setup] Run Keyword And Ignore Error Delete VMI IPv4 Address |
| 237 | [Teardown] Test Teardown Execution |
| 238 | |
| 239 | ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 240 | Run Keyword If ${curr_origin} == ${False} Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED} |
| 241 | ${vmi_ip_config}= Get VMI Network Interface Details |
George Keishing | 538f174 | 2022-03-14 05:00:55 -0500 | [diff] [blame] | 242 | Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]} |
| 243 | ... DHCP ${vmi_ip_config["IPv4_Gateway"]} ${vmi_ip_config["IPv4_SubnetMask"]} |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 244 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 245 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 246 | Verify User Cannot Delete VMI DHCP IP Address |
| 247 | [Documentation] Verify user cannot delete VMI DHCP IP Address |
| 248 | [Tags] Verify_User_Cannot_Delete_VMI_DHCP_IP_Address |
| 249 | [Setup] Set VMI IPv4 Origin ${True} |
| 250 | [Teardown] Test Teardown Execution |
| 251 | |
shrsuman123 | b25343d | 2021-09-22 04:33:47 -0500 | [diff] [blame] | 252 | Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_FORBIDDEN} |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 253 | ${resp}= Redfish.Get |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 254 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface} |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 255 | Should Not Be Empty ${resp.dict["IPv4Addresses"]} |
| 256 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 257 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 258 | Enable DHCP When Static IP Configured DHCP Server Unavailable And Verify IP |
| 259 | [Documentation] Enable DHCP When Static IP Configured And DHCP Server Unavailable And Verify No IP. |
| 260 | [Tags] Enable_DHCP_When_Static_IP_Configured_DHCP_Server_Unavailable_And_Verify_IP |
| 261 | [Teardown] Test Teardown Execution |
| 262 | |
| 263 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
| 264 | Set VMI IPv4 Origin ${True} |
| 265 | ${default}= Set Variable 0.0.0.0 |
| 266 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
| 267 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 268 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 269 | Verify To Configure VMI Static IP Address With Different User Roles |
| 270 | [Documentation] Verify to configure vmi static ip address with different user roles. |
| 271 | [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Different_User_Roles |
| 272 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 273 | [Template] Config VMI Static IP Address Using Different Users |
| 274 | [Teardown] Delete BMC Users Using Redfish |
| 275 | |
| 276 | # username password ip_address gateway nemask valid_status_code |
| 277 | admin_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_ACCEPTED} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 278 | readonly_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 279 | |
| 280 | |
| 281 | Verify To Configure VMI Static IP Address With Operator User Role |
| 282 | [Documentation] Verify to configure vmi static ip address with operator user role. |
| 283 | [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Operator_User_Role |
| 284 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 285 | [Template] Config VMI Static IP Address Using Different Users |
| 286 | [Teardown] Delete BMC Users Using Redfish |
| 287 | |
| 288 | # username password ip_address gateway nemask valid_status_code |
| 289 | operator_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 290 | |
| 291 | |
| 292 | Verify To Delete VMI Static IP Address With Different User Roles |
| 293 | [Documentation] Verify to delete vmi static IP address with different user roles. |
| 294 | [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Different_User_Roles |
| 295 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 296 | [Template] Delete VMI Static IP Address Using Different Users |
| 297 | [Teardown] Delete BMC Users Using Redfish |
| 298 | |
| 299 | # username password valid_status_code |
| 300 | admin_user TestPwd123 ${HTTP_ACCEPTED} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 301 | readonly_user TestPwd123 ${HTTP_FORBIDDEN} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 302 | |
| 303 | |
| 304 | Verify To Delete VMI Static IP Address With Operator User Role |
| 305 | [Documentation] Verify to delete vmi static IP address with operator user role. |
| 306 | [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Operator_User_Role |
| 307 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 308 | [Template] Delete VMI Static IP Address Using Different Users |
| 309 | [Teardown] Delete BMC Users Using Redfish |
| 310 | |
| 311 | # username password valid_status_code |
| 312 | operator_user TestPwd123 ${HTTP_FORBIDDEN} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 313 | |
| 314 | |
| 315 | Verify To Update VMI Static IP Address With Different User Roles |
| 316 | [Documentation] Verify to update vmi static IP address with different user roles. |
George Keishing | 4203fad | 2022-01-31 12:22:33 -0600 | [diff] [blame] | 317 | [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] | 318 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 319 | [Template] Config VMI Static IP Address Using Different Users |
| 320 | [Teardown] Delete BMC Users Using Redfish |
| 321 | |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 322 | # username password ip_address gateway netmask valid_status_code |
| 323 | 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] | 324 | 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] | 325 | |
| 326 | |
| 327 | Verify To Update VMI Static IP Address With Operator User Role |
| 328 | [Documentation] Verify to update vmi static IP address with operator user role. |
| 329 | [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Operator_User_Role |
| 330 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 331 | [Template] Config VMI Static IP Address Using Different Users |
| 332 | [Teardown] Delete BMC Users Using Redfish |
| 333 | |
| 334 | # username password ip_address gateway netmask valid_status_code |
| 335 | 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] | 336 | |
| 337 | |
| 338 | Verify To Read VMI Network Configuration With Different User Roles |
| 339 | [Documentation] Verify to read vmi network configuration with different user roles. |
George Keishing | 4203fad | 2022-01-31 12:22:33 -0600 | [diff] [blame] | 340 | [Tags] Verify_To_Read_VMI_Network_Configuration_With_Different_User_Roles |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 341 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 342 | [Template] Read VMI Static IP Address Using Different Users |
| 343 | [Teardown] Delete BMC Users Using Redfish |
| 344 | |
| 345 | # username password valid_status_code |
| 346 | admin_user TestPwd123 ${HTTP_OK} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 347 | readonly_user TestPwd123 ${HTTP_OK} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 348 | |
| 349 | |
| 350 | Verify To Read VMI Network Configuration With Operator User Role |
| 351 | [Documentation] Verify to read vmi network configuration with operator user role. |
| 352 | [Tags] Verify_To_Read_VMI_Network_Configuration_With_Operator_User_Role |
| 353 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 354 | [Template] Read VMI Static IP Address Using Different Users |
| 355 | [Teardown] Delete BMC Users Using Redfish |
| 356 | |
| 357 | # username password valid_status_code |
| 358 | operator_user TestPwd123 ${HTTP_FORBIDDEN} |
| 359 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 360 | |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 361 | Enable DHCP On VMI Network Via Different Users Roles And Verify |
| 362 | [Documentation] Enable DHCP On VMI Network Via Different Users Roles And Verify. |
| 363 | [Tags] Enable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify |
| 364 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 365 | [Template] Update User Role And Set VMI IPv4 Origin |
| 366 | [Teardown] Delete BMC Users Using Redfish |
| 367 | |
| 368 | # username password dhcp_enabled valid_status_code |
| 369 | admin_user TestPwd123 ${True} ${HTTP_ACCEPTED} |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 370 | readonly_user TestPwd123 ${True} ${HTTP_FORBIDDEN} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 371 | |
| 372 | |
| 373 | Enable DHCP On VMI Network Via Operator User Role And Verify |
| 374 | [Documentation] Enable DHCP On VMI Network Via Operator User Role And Verify. |
| 375 | [Tags] Enable_DHCP_On_VMI_Network_Via_Operator_User_Role_And_Verify |
| 376 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 377 | [Template] Update User Role And Set VMI IPv4 Origin |
| 378 | [Teardown] Delete BMC Users Using Redfish |
| 379 | |
| 380 | # username password dhcp_enabled valid_status_code |
| 381 | operator_user TestPwd123 ${True} ${HTTP_FORBIDDEN} |
| 382 | |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 383 | |
| 384 | Disable DHCP On VMI Network Via Different Users Roles And Verify |
| 385 | [Documentation] Disable DHCP On VMI Network Via Different Users Roles And Verify. |
| 386 | [Tags] Disable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify |
| 387 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 388 | [Template] Update User Role And Set VMI IPv4 Origin |
| 389 | [Teardown] Delete BMC Users Using Redfish |
| 390 | |
| 391 | # username password dhcp_enabled valid_status_code |
| 392 | admin_user TestPwd123 ${False} ${HTTP_ACCEPTED} |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 393 | readonly_user TestPwd123 ${False} ${HTTP_FORBIDDEN} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 394 | |
| 395 | |
| 396 | Disable DHCP On VMI Network Via Operator User Role And Verify |
| 397 | [Documentation] Disable DHCP On VMI Network Via Operator User Role And Verify. |
| 398 | [Tags] Disable_DHCP_On_VMI_Network_Via_Operator_User_Role_And_Verify |
| 399 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 400 | [Template] Update User Role And Set VMI IPv4 Origin |
| 401 | [Teardown] Delete BMC Users Using Redfish |
| 402 | |
| 403 | # username password dhcp_enabled valid_status_code |
| 404 | operator_user TestPwd123 ${False} ${HTTP_FORBIDDEN} |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 405 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 406 | |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 407 | Enable And Disable DHCP And Verify |
| 408 | [Documentation] verify enable DHCP and disable DHCP. |
George Keishing | 4203fad | 2022-01-31 12:22:33 -0600 | [diff] [blame] | 409 | [Tags] Enable_And_Disable_DHCP_And_Verify |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 410 | |
| 411 | Set VMI IPv4 Origin ${True} |
| 412 | ${default}= Set Variable 0.0.0.0 |
| 413 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
| 414 | Set VMI IPv4 Origin ${False} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 415 | Verify VMI Network Interface Details ${default} Static ${default} ${default} |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 416 | |
| 417 | |
| 418 | Multiple Times Enable And Disable DHCP And Verify |
| 419 | [Documentation] Enable and Disable DHCP in a loop and verify VMI gets an IP address from DHCP |
| 420 | ... each time when DHCP is enabled |
| 421 | [Tags] Multiple_Times_Enable_And_Disable_DHCP_And_Verify |
| 422 | |
| 423 | ${default}= Set Variable 0.0.0.0 |
| 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 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 455 | *** Keywords *** |
| 456 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 457 | Suite Setup Execution |
| 458 | [Documentation] Do test setup execution task. |
| 459 | |
| 460 | Redfish.Login |
| 461 | Redfish Power On |
| 462 | ${active_channel_config}= Get Active Channel Config |
| 463 | Set Suite Variable ${active_channel_config} |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 464 | Set Suite Variable ${ethernet_interface} ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 465 | ${resp}= Redfish.Get |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 466 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface} |
shrsuman123 | 62e5be5 | 2021-05-20 02:42:59 -0500 | [diff] [blame] | 467 | ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 468 | ${length}= Get Length ${ip_resp["IPv4StaticAddresses"]} |
| 469 | ${vmi_network_conf}= Run Keyword If ${length} != ${0} Get VMI Network Interface Details |
| 470 | Set Suite Variable ${vmi_network_conf} |
| 471 | |
| 472 | |
| 473 | Test Teardown Execution |
| 474 | [Documentation] Do test teardown execution task. |
| 475 | |
| 476 | FFDC On Test Case Fail |
| 477 | ${curr_mode}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 478 | Run Keyword If ${curr_mode} == ${True} Set VMI IPv4 Origin ${False} |
| 479 | Run Keyword If ${vmi_network_conf} != ${None} |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 480 | ... 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] | 481 | ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]} |
| 482 | |
| 483 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 484 | Get Immediate Child Parameter From VMI Network Interface |
| 485 | [Documentation] Get immediate child parameter from VMI network interface. |
| 486 | [Arguments] ${parameter} ${valid_status_code}=${HTTP_OK} |
| 487 | |
| 488 | # Description of argument(s): |
| 489 | # parameter parameter for which value is required. Ex: DHCPEnabled, MACAddress etc. |
| 490 | # valid_status_code Expected valid status code from GET request. |
| 491 | |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 492 | ${resp}= Redfish.Get |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 493 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 494 | ... valid_status_codes=[${valid_status_code}] |
| 495 | |
shrsuman123 | 62e5be5 | 2021-05-20 02:42:59 -0500 | [diff] [blame] | 496 | ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 497 | ${value}= Set Variable If '${parameter}' != 'DHCPEnabled' ${ip_resp["${parameter}"]} |
| 498 | ... ${ip_resp["DHCPv4"]["${parameter}"]} |
| 499 | |
| 500 | [Return] ${value} |
| 501 | |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 502 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 503 | Switch VMI IPv4 Origin And Verify Details |
| 504 | [Documentation] Switch VMI IPv4 origin and verify details. |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 505 | |
Anves Kumar rayankula | 7936eee | 2021-04-19 05:38:36 -0500 | [diff] [blame] | 506 | ${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] | 507 | ${dhcp_enabled}= Set Variable If ${dhcp_mode_before} == ${False} ${True} ${False} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 508 | |
| 509 | ${default}= Set Variable 0.0.0.0 |
Anves Kumar rayankula | e7dc89a | 2021-04-28 04:29:38 -0500 | [diff] [blame] | 510 | ${origin}= Set Variable If ${dhcp_mode_before} == ${False} DHCP Static |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 511 | Set VMI IPv4 Origin ${dhcp_enabled} ${HTTP_ACCEPTED} |
Anves Kumar rayankula | 7936eee | 2021-04-19 05:38:36 -0500 | [diff] [blame] | 512 | |
| 513 | ${dhcp_mode_after}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 514 | Should Not Be Equal ${dhcp_mode_before} ${dhcp_mode_after} |
| 515 | |
| 516 | Run Keyword If ${dhcp_mode_after} == ${True} |
| 517 | ... Verify VMI Network Interface Details ${default} ${origin} ${default} ${default} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 518 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 519 | |
| 520 | Delete VMI Static IP Address Using Different Users |
| 521 | [Documentation] Update user role and delete vmi static IP address. |
| 522 | [Arguments] ${username} ${password} ${valid_status_code} |
| 523 | [Teardown] Run Keywords Redfish.Login AND |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 524 | ... 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] | 525 | ... ${test_netmask} ${HTTP_ACCEPTED} AND Redfish.Logout |
| 526 | |
| 527 | # Description of argument(s): |
| 528 | # username The host username. |
| 529 | # password The host password. |
| 530 | # valid_status_code The expected valid status code. |
| 531 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 532 | # TODO: operator_user role is not yet supported. |
| 533 | Skip If '${username}' == 'operator_user' |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 534 | Redfish.Login ${username} ${password} |
| 535 | 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] | 536 | |
| 537 | |
| 538 | Config VMI Static IP Address Using Different Users |
| 539 | [Documentation] Update user role and update vmi static ip address. |
| 540 | [Arguments] ${username} ${password} ${ip} ${gateway} ${netmask} |
| 541 | ... ${valid_status_code} |
| 542 | |
| 543 | # Description of argument(s): |
| 544 | # username The host username. |
| 545 | # password The host password. |
| 546 | # ip IP address to be added (e.g. "10.7.7.7"). |
| 547 | # subnet_mask Subnet mask for the IP to be added |
| 548 | # (e.g. "255.255.0.0"). |
| 549 | # gateway Gateway for the IP to be added (e.g. "10.7.7.1"). |
| 550 | # valid_status_code The expected valid status code. |
| 551 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 552 | # TODO: operator_user role is not yet supported. |
| 553 | Skip If '${username}' == 'operator_user' |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 554 | Redfish.Login ${username} ${password} |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 555 | 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] | 556 | |
| 557 | |
| 558 | Read VMI Static IP Address Using Different Users |
| 559 | [Documentation] Update user role and read vmi static ip address. |
| 560 | [Arguments] ${username} ${password} ${valid_status_code} |
| 561 | |
| 562 | # Description of argument(s): |
| 563 | # username The host username. |
| 564 | # password The host password. |
| 565 | # valid_status_code The expected valid status code. |
| 566 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 567 | # TODO: operator_user role is not yet supported. |
| 568 | Skip If '${username}' == 'operator_user' |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 569 | Redfish.Login ${username} ${password} |
| 570 | Redfish.Get |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 571 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 572 | ... valid_status_codes=[${valid_status_code}] |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 573 | |
| 574 | |
| 575 | Delete BMC Users Using Redfish |
| 576 | [Documentation] Delete BMC users via redfish. |
| 577 | |
| 578 | Redfish.Login |
| 579 | Delete BMC Users Via Redfish users=${USERS} |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 580 | |
Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 581 | |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 582 | Update User Role And Set VMI IPv4 Origin |
| 583 | [Documentation] Update User Role And Set VMI IPv4 Origin. |
| 584 | [Arguments] ${username} ${password} ${dhcp_enabled} ${valid_status_code} |
| 585 | |
| 586 | # Description of argument(s): |
| 587 | # username The host username. |
| 588 | # password The host password. |
| 589 | # dhcp_enabled Indicates whether dhcp should be enabled |
| 590 | # (${True}, ${False}). |
| 591 | # valid_status_code The expected valid status code. |
| 592 | |
Megha GN | be42859 | 2022-07-21 10:33:02 -0500 | [diff] [blame] | 593 | # TODO: operator_user role is not yet supported. |
| 594 | Skip If '${username}' == 'operator_user' |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 595 | Redfish.Login ${username} ${password} |
| 596 | Set VMI IPv4 Origin ${dhcp_enabled} ${valid_status_code} |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 597 | |
Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 598 | |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 599 | Suite Teardown Execution |
| 600 | [Documentation] Do suite teardown execution task. |
| 601 | |
| 602 | Run Keyword If ${vmi_network_conf} != ${None} |
| 603 | ... Set Static IPv4 Address To VMI And Verify ${vmi_network_conf["IPv4_Address"]} |
| 604 | ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]} |
shrsuman123 | b25343d | 2021-09-22 04:33:47 -0500 | [diff] [blame] | 605 | Delete All Redfish Sessions |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 606 | Redfish.Logout |