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 | |
Megha G N | f986714 | 2025-02-03 23:10:57 -0600 | [diff] [blame] | 11 | Test Tags Vmi |
George Keishing | 725e066 | 2022-07-20 22:18:14 -0500 | [diff] [blame] | 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} |
| 30 | |
Megha G N | 38acd84 | 2024-10-14 14:28:11 -0500 | [diff] [blame] | 31 | &{SLAAC_ENABLED} IPv6AutoConfigEnabled=${True} |
| 32 | &{SLAAC_DISABLED} IPv6AutoConfigEnabled=${False} |
| 33 | |
| 34 | &{ENABLE_SLAAC} StatelessAddressAutoConfig=&{SLAAC_ENABLED} |
| 35 | &{DISABLE_SLAAC} StatelessAddressAutoConfig=&{SLAAC_DISABLED} |
| 36 | |
Megha G N | df25564 | 2025-01-10 02:12:21 -0600 | [diff] [blame] | 37 | &{DHCPv6_ENABLED} OperatingMode=Enabled |
| 38 | &{DHCPv6_DISABLED} OperatingMode=Disabled |
| 39 | |
| 40 | &{ENABLE_DHCPv6} DHCPv6=&{DHCPv6_ENABLED} |
| 41 | &{DISABLE_DHCPv6} DHCPv6=&{DHCPv6_DISABLED} |
| 42 | |
Megha G N | 02cbfa1 | 2022-12-12 02:05:03 -0600 | [diff] [blame] | 43 | ${default} 0.0.0.0 |
Megha G N | a37b8da | 2025-01-06 00:23:15 -0600 | [diff] [blame] | 44 | ${default_ipv6addr} :: |
Sridevi Ramesh | 70f087b | 2025-01-26 00:27:05 -0600 | [diff] [blame] | 45 | ${prefix_length} ${64} |
Megha G N | 97af3bf | 2025-02-27 10:32:08 -0600 | [diff] [blame^] | 46 | ${test_vmi_ipv6addr} 2001:db8:1111:2222:10:5:5:6 |
Megha G N | 02cbfa1 | 2022-12-12 02:05:03 -0600 | [diff] [blame] | 47 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 48 | |
| 49 | *** Test Cases *** |
| 50 | |
| 51 | Verify All VMI EthernetInterfaces |
| 52 | [Documentation] Verify all VMI ethernet interfaces. |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 53 | [Tags] Verify_All_VMI_EthernetInterfaces |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 54 | |
| 55 | Verify VMI EthernetInterfaces |
| 56 | |
| 57 | |
| 58 | Verify Existing VMI Network Interface Details |
| 59 | [Documentation] Verify existing VMI network interface details. |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 60 | [Tags] Verify_Existing_VMI_Network_Interface_Details |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 61 | |
| 62 | ${vmi_ip}= Get VMI Network Interface Details |
| 63 | ${origin}= Set Variable If ${vmi_ip["DHCPv4"]} == ${False} Static DHCP |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 64 | Should Not Be Equal ${vmi_ip["DHCPv4"]} ${vmi_ip["IPv4StaticAddresses"]} |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 65 | Should Be Equal As Strings ${vmi_ip["Id"]} ${ethernet_interface} |
George Keishing | b3ea095 | 2020-07-01 05:03:56 -0500 | [diff] [blame] | 66 | Should Be Equal As Strings ${vmi_ip["Description"]} |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 67 | ... Hypervisor's Virtual Management Ethernet Interface |
| 68 | Should Be Equal As Strings ${vmi_ip["Name"]} Hypervisor Ethernet Interface |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 69 | Run Keyword If ${vmi_ip["IPv4StaticAddresses"]} != @{empty} |
| 70 | ... Verify VMI Network Interface Details ${vmi_ip["IPv4_Address"]} |
| 71 | ... ${origin} ${vmi_ip["IPv4_Gateway"]} ${vmi_ip["IPv4_SubnetMask"]} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 72 | |
| 73 | |
| 74 | Delete Existing Static VMI IP Address |
| 75 | [Documentation] Delete existing static VMI IP address. |
| 76 | [Tags] Delete_Existing_Static_VMI_IP_Address |
| 77 | |
| 78 | ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 79 | Run Keyword If ${curr_origin} == ${True} Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED} |
| 80 | |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 81 | Delete VMI IPv4 Address |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 82 | |
| 83 | |
| 84 | Verify User Cannot Delete ReadOnly Property IPv4Addresses |
| 85 | [Documentation] Verify user cannot delete readonly property IPv4Addresses. |
| 86 | [Tags] Verify_User_Cannot_Delete_ReadOnly_Property_IPv4Addresses |
| 87 | |
| 88 | ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 89 | Run Keyword If ${curr_origin} == ${True} Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED} |
| 90 | 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] | 91 | Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_FORBIDDEN} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 92 | |
| 93 | |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 94 | Assign Valid And Invalid Static IPv4 Address To VMI |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 95 | [Documentation] Assign static IPv4 address to VMI. |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 96 | [Tags] Assign_Valid_And_Invalid_Static_IPv4_Address_To_VMI |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 97 | [Template] Set Static IPv4 Address To VMI And Verify |
| 98 | [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 99 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 100 | # ip gateway netmask valid_status_code |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 101 | 10.5.20.30 10.5.20.1 255.255.252.0 ${HTTP_ACCEPTED} |
| 102 | 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] | 103 | 10.5.20 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST} |
| 104 | 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] | 105 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 106 | |
George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 107 | Add Multiple IP Addresses On VMI Interface And Verify |
| 108 | [Documentation] Add multiple IP addresses on VMI interface and verify. |
| 109 | [Tags] Add_Multiple_IP_Addresses_On_VMI_Interface_And_Verify |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 110 | [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 111 | |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 112 | ${ip1}= Create dictionary Address=10.5.5.10 SubnetMask=255.255.252.0 Gateway=10.5.5.1 |
| 113 | ${ip2}= Create dictionary Address=10.5.5.11 SubnetMask=255.255.252.0 Gateway=10.5.5.1 |
| 114 | ${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] | 115 | ${ips}= Create List ${ip1} ${ip2} ${ip3} |
| 116 | |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 117 | Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface} |
shrsuman123 | 993a5c9 | 2021-04-19 06:40:16 -0500 | [diff] [blame] | 118 | ... body={'IPv4StaticAddresses':${ips}} valid_status_codes=[${HTTP_BAD_REQUEST}] |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 119 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 120 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 121 | Modify IP Addresses On VMI Interface And Verify |
| 122 | [Documentation] Modify IP addresses on VMI interface and verify. |
| 123 | [Tags] Modify_IP_Addresses_On_VMI_Interface_And_Verify |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 124 | [Template] Set Static IPv4 Address To VMI And Verify |
| 125 | [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 126 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 127 | # ip gateway netmask valid_status_code |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 128 | 10.5.5.10 10.5.5.1 255.255.252.0 ${HTTP_ACCEPTED} |
| 129 | 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] | 130 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 131 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 132 | Switch Between IP Origins On VMI And Verify Details |
| 133 | [Documentation] Switch between IP origins on VMI and verify details. |
| 134 | [Tags] Switch_Between_IP_Origins_On_VMI_And_Verify_Details |
| 135 | |
| 136 | Switch VMI IPv4 Origin And Verify Details |
| 137 | Switch VMI IPv4 Origin And Verify Details |
| 138 | |
| 139 | |
| 140 | Verify Persistency Of VMI IPv4 Details After Host Reboot |
| 141 | [Documentation] Verify persistency of VMI IPv4 details after host reboot. |
| 142 | [Tags] Verify_Persistency_Of_VMI_IPv4_Details_After_Host_Reboot |
| 143 | |
| 144 | # Verifying persistency of dynamic address. |
| 145 | Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED} |
Anves Kumar rayankula | 7936eee | 2021-04-19 05:38:36 -0500 | [diff] [blame] | 146 | Redfish Power Off stack_mode=skip |
| 147 | Redfish Power On |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 148 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 149 | |
| 150 | # Verifying persistency of static address. |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 151 | Switch VMI IPv4 Origin And Verify Details |
Anves Kumar rayankula | 7936eee | 2021-04-19 05:38:36 -0500 | [diff] [blame] | 152 | Redfish Power Off stack_mode=skip |
| 153 | Redfish Power On |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 154 | 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] | 155 | |
| 156 | |
Anves Kumar rayankula | 9fa524a | 2020-08-18 06:40:18 -0500 | [diff] [blame] | 157 | Delete VMI Static IP Address And Verify |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 158 | [Documentation] Delete VMI static IP address and verify. |
| 159 | [Tags] Delete_VMI_Static_IP_Address_And_Verify |
| 160 | [Teardown] Test Teardown Execution |
Anves Kumar rayankula | 9fa524a | 2020-08-18 06:40:18 -0500 | [diff] [blame] | 161 | |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 162 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
| 163 | Delete VMI IPv4 Address |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 164 | |
Anves Kumar rayankula | 9fa524a | 2020-08-18 06:40:18 -0500 | [diff] [blame] | 165 | |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 166 | Verify Successful VMI IP Static Configuration On HOST Boot After Session Delete |
| 167 | [Documentation] Verify VMI IP static Configuration On HOST Boot After session deleted. |
| 168 | [Tags] Verify_Successful_VMI_IP_Static_Configuration_On_HOST_Boot_After_Session_Delete |
shrsuman123 | b25343d | 2021-09-22 04:33:47 -0500 | [diff] [blame] | 169 | [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 170 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 171 | 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] | 172 | |
| 173 | ${session_info}= Get Redfish Session Info |
| 174 | Redfish.Delete ${session_info["location"]} |
| 175 | |
| 176 | # Create a new Redfish session |
shrsuman123 | 5c7e4d7 | 2021-04-16 05:42:57 -0500 | [diff] [blame] | 177 | Redfish.Login |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 178 | Redfish Power Off |
| 179 | Redfish Power On |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 180 | |
| 181 | Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask} |
| 182 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 183 | |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 184 | Verify Persistency Of VMI DHCP IP Configuration After Multiple HOST Reboots |
| 185 | [Documentation] Verify Persistency Of VMI DHCP IP configuration After Multiple HOST Reboots |
| 186 | [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] | 187 | [Teardown] Test Teardown Execution |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 188 | |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 189 | Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED} |
shrsuman123 | c1d3fe3 | 2020-09-08 05:04:07 -0500 | [diff] [blame] | 190 | ${vmi_ip_config}= Get VMI Network Interface Details |
| 191 | # Verifying persistency of dynamic address after multiple reboots. |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 192 | FOR ${i} IN RANGE ${2} |
| 193 | Redfish Power Off |
| 194 | Redfish Power On |
George Keishing | 538f174 | 2022-03-14 05:00:55 -0500 | [diff] [blame] | 195 | Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]} |
| 196 | ... DHCP ${vmi_ip_config["IPv4_Gateway"]} ${vmi_ip_config["IPv4_SubnetMask"]} |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 197 | END |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 198 | |
| 199 | |
| 200 | Enable DHCP When Static IP Configured And Verify Static IP |
| 201 | [Documentation] Enable DHCP when static ip configured and verify static ip |
George Keishing | 4203fad | 2022-01-31 12:22:33 -0600 | [diff] [blame] | 202 | [Tags] Enable_DHCP_When_Static_IP_Configured_And_Verify_Static_IP |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 203 | [Setup] Redfish Power On |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 204 | [Teardown] Test Teardown Execution |
| 205 | |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 206 | 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] | 207 | Set VMI IPv4 Origin ${True} |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 208 | ${vmi_network_conf}= Get VMI Network Interface Details |
| 209 | Should Not Be Equal As Strings ${test_ipv4} ${vmi_network_conf["IPv4_Address"]} |
| 210 | |
Anves Kumar rayankula | 9fa524a | 2020-08-18 06:40:18 -0500 | [diff] [blame] | 211 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 212 | Verify VMI Static IP Configuration Persist On BMC Reset Before Host Boot |
| 213 | [Documentation] Verify VMI static IP configuration persist on BMC reset. |
| 214 | [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] | 215 | [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 216 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 217 | 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] | 218 | Redfish OBMC Reboot (off) stack_mode=skip |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 219 | Redfish Power On |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 220 | # Verifying the VMI static configuration |
| 221 | Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask} |
| 222 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 223 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 224 | Add Static IP When Host Poweroff And Verify On Poweron |
| 225 | [Documentation] Add Static IP When Host Poweroff And Verify on power on |
| 226 | [Tags] Add_Static_IP_When_Host_Poweroff_And_Verify_On_Poweron |
| 227 | [Setup] Redfish Power Off |
| 228 | [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail |
| 229 | |
| 230 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
| 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 | Add VMI Static IP When Host Poweroff And Verify Static IP On BMC Reset |
| 236 | [Documentation] Add Static IP When Host Poweroff And Verify Static IP On BMC Reset. |
| 237 | [Tags] Add_VMI_Static_IP_When_Host_Poweroff_And_Verify_Static_IP_On_BMC_Reset |
| 238 | [Setup] Redfish Power Off |
| 239 | [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail |
| 240 | |
| 241 | 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] | 242 | Redfish OBMC Reboot (off) stack_mode=skip |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 243 | Redfish Power On |
| 244 | Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask} |
| 245 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 246 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 247 | Enable DHCP When No Static IP Configured And Verify DHCP IP |
| 248 | [Documentation] Enable DHCP when no static ip configured and verify dhcp ip |
| 249 | [Tags] Enable_DHCP_When_No_Static_IP_Configured_And_Verify_DHCP_IP |
| 250 | [Setup] Run Keyword And Ignore Error Delete VMI IPv4 Address |
| 251 | [Teardown] Test Teardown Execution |
| 252 | |
| 253 | ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 254 | Run Keyword If ${curr_origin} == ${False} Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED} |
| 255 | ${vmi_ip_config}= Get VMI Network Interface Details |
George Keishing | 538f174 | 2022-03-14 05:00:55 -0500 | [diff] [blame] | 256 | Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]} |
| 257 | ... DHCP ${vmi_ip_config["IPv4_Gateway"]} ${vmi_ip_config["IPv4_SubnetMask"]} |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 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 | Verify User Cannot Delete VMI DHCP IP Address |
| 261 | [Documentation] Verify user cannot delete VMI DHCP IP Address |
| 262 | [Tags] Verify_User_Cannot_Delete_VMI_DHCP_IP_Address |
| 263 | [Setup] Set VMI IPv4 Origin ${True} |
| 264 | [Teardown] Test Teardown Execution |
| 265 | |
shrsuman123 | b25343d | 2021-09-22 04:33:47 -0500 | [diff] [blame] | 266 | Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_FORBIDDEN} |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 267 | ${resp}= Redfish.Get |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 268 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface} |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 269 | Should Not Be Empty ${resp.dict["IPv4Addresses"]} |
| 270 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 271 | |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 272 | Enable DHCP When Static IP Configured DHCP Server Unavailable And Verify IP |
| 273 | [Documentation] Enable DHCP When Static IP Configured And DHCP Server Unavailable And Verify No IP. |
| 274 | [Tags] Enable_DHCP_When_Static_IP_Configured_DHCP_Server_Unavailable_And_Verify_IP |
| 275 | [Teardown] Test Teardown Execution |
| 276 | |
| 277 | Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
| 278 | Set VMI IPv4 Origin ${True} |
shrsuman123 | 75e7706 | 2020-09-18 01:08:45 -0500 | [diff] [blame] | 279 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
| 280 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 281 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 282 | Verify To Configure VMI Static IP Address With Different User Roles |
| 283 | [Documentation] Verify to configure vmi static ip address with different user roles. |
| 284 | [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] | 285 | [Setup] Run Keywords Delete BMC Users Using Redfish |
| 286 | ... AND Create Users With Different Roles users=${USERS} force=${True} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 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 | admin_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_ACCEPTED} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 292 | readonly_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 293 | |
| 294 | |
| 295 | Verify To Configure VMI Static IP Address With Operator User Role |
| 296 | [Documentation] Verify to configure vmi static ip address with operator user role. |
| 297 | [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Operator_User_Role |
| 298 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 299 | [Template] Config VMI Static IP Address Using Different Users |
| 300 | [Teardown] Delete BMC Users Using Redfish |
| 301 | |
| 302 | # username password ip_address gateway nemask valid_status_code |
| 303 | operator_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 304 | |
| 305 | |
| 306 | Verify To Delete VMI Static IP Address With Different User Roles |
| 307 | [Documentation] Verify to delete vmi static IP address with different user roles. |
| 308 | [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Different_User_Roles |
| 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 | admin_user TestPwd123 ${HTTP_ACCEPTED} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 315 | readonly_user TestPwd123 ${HTTP_FORBIDDEN} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 316 | |
| 317 | |
| 318 | Verify To Delete VMI Static IP Address With Operator User Role |
| 319 | [Documentation] Verify to delete vmi static IP address with operator user role. |
| 320 | [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Operator_User_Role |
| 321 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 322 | [Template] Delete VMI Static IP Address Using Different Users |
| 323 | [Teardown] Delete BMC Users Using Redfish |
| 324 | |
| 325 | # username password valid_status_code |
| 326 | operator_user TestPwd123 ${HTTP_FORBIDDEN} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 327 | |
| 328 | |
| 329 | Verify To Update VMI Static IP Address With Different User Roles |
| 330 | [Documentation] Verify to update vmi static IP address with different user roles. |
George Keishing | 4203fad | 2022-01-31 12:22:33 -0600 | [diff] [blame] | 331 | [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] | 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 | |
Shradha Suman | c7df7db | 2021-03-08 05:16:44 -0600 | [diff] [blame] | 336 | # username password ip_address gateway netmask valid_status_code |
| 337 | 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] | 338 | 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] | 339 | |
| 340 | |
| 341 | Verify To Update VMI Static IP Address With Operator User Role |
| 342 | [Documentation] Verify to update vmi static IP address with operator user role. |
| 343 | [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Operator_User_Role |
| 344 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 345 | [Template] Config VMI Static IP Address Using Different Users |
| 346 | [Teardown] Delete BMC Users Using Redfish |
| 347 | |
| 348 | # username password ip_address gateway netmask valid_status_code |
| 349 | 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] | 350 | |
| 351 | |
| 352 | Verify To Read VMI Network Configuration With Different User Roles |
| 353 | [Documentation] Verify to read vmi network configuration with different user roles. |
George Keishing | 4203fad | 2022-01-31 12:22:33 -0600 | [diff] [blame] | 354 | [Tags] Verify_To_Read_VMI_Network_Configuration_With_Different_User_Roles |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 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 | admin_user TestPwd123 ${HTTP_OK} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 361 | readonly_user TestPwd123 ${HTTP_OK} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 362 | |
| 363 | |
| 364 | Verify To Read VMI Network Configuration With Operator User Role |
| 365 | [Documentation] Verify to read vmi network configuration with operator user role. |
| 366 | [Tags] Verify_To_Read_VMI_Network_Configuration_With_Operator_User_Role |
| 367 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 368 | [Template] Read VMI Static IP Address Using Different Users |
| 369 | [Teardown] Delete BMC Users Using Redfish |
| 370 | |
| 371 | # username password valid_status_code |
| 372 | operator_user TestPwd123 ${HTTP_FORBIDDEN} |
| 373 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 374 | |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 375 | Enable DHCP On VMI Network Via Different Users Roles And Verify |
| 376 | [Documentation] Enable DHCP On VMI Network Via Different Users Roles And Verify. |
| 377 | [Tags] Enable_DHCP_On_VMI_Network_Via_Different_Users_Roles_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 | admin_user TestPwd123 ${True} ${HTTP_ACCEPTED} |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 384 | readonly_user TestPwd123 ${True} ${HTTP_FORBIDDEN} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 385 | |
| 386 | |
| 387 | Enable DHCP On VMI Network Via Operator User Role And Verify |
| 388 | [Documentation] Enable DHCP On VMI Network Via Operator User Role And Verify. |
| 389 | [Tags] Enable_DHCP_On_VMI_Network_Via_Operator_User_Role_And_Verify |
| 390 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 391 | [Template] Update User Role And Set VMI IPv4 Origin |
| 392 | [Teardown] Delete BMC Users Using Redfish |
| 393 | |
| 394 | # username password dhcp_enabled valid_status_code |
| 395 | operator_user TestPwd123 ${True} ${HTTP_FORBIDDEN} |
| 396 | |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 397 | |
| 398 | Disable DHCP On VMI Network Via Different Users Roles And Verify |
| 399 | [Documentation] Disable DHCP On VMI Network Via Different Users Roles And Verify. |
| 400 | [Tags] Disable_DHCP_On_VMI_Network_Via_Different_Users_Roles_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 | admin_user TestPwd123 ${False} ${HTTP_ACCEPTED} |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 407 | readonly_user TestPwd123 ${False} ${HTTP_FORBIDDEN} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 408 | |
| 409 | |
| 410 | Disable DHCP On VMI Network Via Operator User Role And Verify |
| 411 | [Documentation] Disable DHCP On VMI Network Via Operator User Role And Verify. |
| 412 | [Tags] Disable_DHCP_On_VMI_Network_Via_Operator_User_Role_And_Verify |
| 413 | [Setup] Create Users With Different Roles users=${USERS} force=${True} |
| 414 | [Template] Update User Role And Set VMI IPv4 Origin |
| 415 | [Teardown] Delete BMC Users Using Redfish |
| 416 | |
| 417 | # username password dhcp_enabled valid_status_code |
| 418 | operator_user TestPwd123 ${False} ${HTTP_FORBIDDEN} |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 419 | |
shrsuman123 | e37b0cc | 2020-09-02 00:33:42 -0500 | [diff] [blame] | 420 | |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 421 | Enable And Disable DHCP And Verify |
| 422 | [Documentation] verify enable DHCP and disable DHCP. |
George Keishing | 4203fad | 2022-01-31 12:22:33 -0600 | [diff] [blame] | 423 | [Tags] Enable_And_Disable_DHCP_And_Verify |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 424 | |
| 425 | Set VMI IPv4 Origin ${True} |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 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 | |
| 430 | |
| 431 | Multiple Times Enable And Disable DHCP And Verify |
| 432 | [Documentation] Enable and Disable DHCP in a loop and verify VMI gets an IP address from DHCP |
| 433 | ... each time when DHCP is enabled |
| 434 | [Tags] Multiple_Times_Enable_And_Disable_DHCP_And_Verify |
| 435 | |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 436 | FOR ${i} IN RANGE ${2} |
| 437 | Set VMI IPv4 Origin ${True} |
| 438 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
| 439 | Set VMI IPv4 Origin ${False} |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 440 | Verify VMI Network Interface Details ${default} Static ${default} ${default} |
Anves Kumar rayankula | 55b939e | 2020-08-12 04:19:01 -0500 | [diff] [blame] | 441 | END |
| 442 | |
| 443 | |
Anves Kumar rayankula | 81fd9db | 2021-05-10 02:39:51 -0500 | [diff] [blame] | 444 | Assign Static IPv4 Address With Invalid Netmask To VMI |
| 445 | [Documentation] Assign static IPv4 address with invalid netmask and expect error. |
| 446 | [Tags] Assign_Static_IPv4_Address_With_Invalid_Netmask_To_VMI |
| 447 | [Template] Set Static IPv4 Address To VMI And Verify |
| 448 | |
| 449 | # ip gateway netmask valid_status_code |
| 450 | ${test_ipv4} ${test_gateway} 255.256.255.0 ${HTTP_BAD_REQUEST} |
| 451 | ${test_ipv4} ${test_gateway} ff.ff.ff.ff ${HTTP_BAD_REQUEST} |
| 452 | ${test_ipv4} ${test_gateway} 255.255.253.0 ${HTTP_BAD_REQUEST} |
| 453 | |
| 454 | |
| 455 | Assign Static IPv4 Address With Invalid Gateway To VMI |
| 456 | [Documentation] Add static IPv4 address with invalid gateway and expect error. |
| 457 | [Tags] Assign_Static_IPv4_Address_With_Invalid_Gateway_To_VMI |
| 458 | [Template] Set Static IPv4 Address To VMI And Verify |
| 459 | |
| 460 | # ip gateway netmask valid_status_code |
| 461 | ${test_ipv4} @@@.%%.44.11 ${test_netmask} ${HTTP_BAD_REQUEST} |
| 462 | ${test_ipv4} 0xa.0xb.0xc.0xd ${test_netmask} ${HTTP_BAD_REQUEST} |
| 463 | ${test_ipv4} 10.3.36 ${test_netmask} ${HTTP_BAD_REQUEST} |
| 464 | ${test_ipv4} 10.3.36.-10 ${test_netmask} ${HTTP_BAD_REQUEST} |
| 465 | |
| 466 | |
Megha G N | 02cbfa1 | 2022-12-12 02:05:03 -0600 | [diff] [blame] | 467 | Enable DHCP When Host Is Off And Verify After Poweron |
| 468 | [Documentation] Enable DHCP when host is off and |
| 469 | ... check whether it is enabled after poweron. |
| 470 | [Tags] Enable_DHCP_When_Host_Is_Off_And_Verify_After_Poweron |
| 471 | [Setup] Redfish Power Off stack_mode=skip |
| 472 | |
| 473 | Set VMI IPv4 Origin ${True} |
| 474 | Redfish Power On stack_mode=skip |
| 475 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
| 476 | |
| 477 | |
Megha G N | 8917468 | 2023-01-24 23:28:27 -0600 | [diff] [blame] | 478 | Disable DHCP When Host Is Off And Verify New State Reflects After Power On |
| 479 | [Documentation] Disable DHCP when host is off and |
| 480 | ... get network info and verify that VMI origin is static. |
| 481 | [Tags] Disable_DHCP_When_Host_Is_Off_And_Verify_New_State_Reflects_After_Power_On |
| 482 | [Setup] Redfish Power Off stack_mode=skip |
| 483 | |
| 484 | Set VMI IPv4 Origin ${False} |
| 485 | Redfish Power On stack_mode=skip |
| 486 | Verify VMI Network Interface Details ${default} Static ${default} ${default} |
| 487 | |
| 488 | |
Megha G N | 38acd84 | 2024-10-14 14:28:11 -0500 | [diff] [blame] | 489 | Enable VMI Stateless Address AutoConfig And Verify |
| 490 | [Documentation] Enable VMI SLAACv6 and verify an origin. |
| 491 | [Tags] Enable_VMI_Stateless_Address_AutoConfig_And_Verify |
| 492 | |
| 493 | Set VMI SLAACv6 Origin ${True} |
| 494 | |
| 495 | # Check origin is set to slaac and address are getting displayed. |
| 496 | Verify VMI IPv6 Address SLAAC |
| 497 | |
| 498 | |
Megha G N | e8c0e42 | 2024-12-04 03:12:55 -0600 | [diff] [blame] | 499 | Disable VMI Stateless Address AutoConfig And Verify |
| 500 | [Documentation] Disable VMI SLAACv6 and verify an origin. |
| 501 | [Tags] Disable_VMI_Stateless_Address_AutoConfig_And_Verify |
| 502 | [Setup] Set VMI SLAACv6 Origin ${True} |
| 503 | |
| 504 | Set VMI SLAACv6 Origin ${False} |
| 505 | |
| 506 | # Check origin is set to static and slaacv6 address are getting erased. |
| 507 | Verify VMI IPv6 Address Static |
| 508 | |
| 509 | |
Megha G N | a37b8da | 2025-01-06 00:23:15 -0600 | [diff] [blame] | 510 | Enable VMI SLAAC And Check Persistency On BMC Reboot |
| 511 | [Documentation] Enable VMI SLAACv6 and verify its persistency |
| 512 | ... on BMC reboot and this works on the setup where router |
Megha G N | a727d5b | 2025-02-06 04:41:47 -0600 | [diff] [blame] | 513 | ... advertises network prefix. |
Megha G N | a37b8da | 2025-01-06 00:23:15 -0600 | [diff] [blame] | 514 | [Tags] Enable_VMI_SLAAC_And_Check_Persistency_On_BMC_Reboot |
| 515 | |
| 516 | Set VMI SLAACv6 Origin ${True} |
| 517 | |
| 518 | # Reboot BMC and verify persistency. |
| 519 | OBMC Reboot (off) |
| 520 | Redfish Power On |
| 521 | Wait For Host Boot Progress To Reach Required State |
Megha G N | a727d5b | 2025-02-06 04:41:47 -0600 | [diff] [blame] | 522 | Sleep 5s |
Megha G N | a37b8da | 2025-01-06 00:23:15 -0600 | [diff] [blame] | 523 | |
| 524 | # Check origin is set to slaac and address are getting displayed. |
| 525 | ${vmi_ipv6addr}= Verify VMI IPv6 Address SLAAC |
| 526 | Should Not Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr} |
| 527 | |
| 528 | |
Megha G N | 4965738 | 2025-01-07 23:10:42 -0600 | [diff] [blame] | 529 | Disable VMI SLAAC And Check Persistency On BMC Reboot |
| 530 | [Documentation] Disable VMI SLAACv6 and verify its persistency |
| 531 | ... on BMC reboot. |
| 532 | [Tags] Disable_VMI_SLAAC_And_Check_Persistency_On_BMC_Reboot |
| 533 | |
| 534 | Set VMI SLAACv6 Origin ${False} |
| 535 | |
| 536 | # Reboot BMC and verify persistency. |
| 537 | OBMC Reboot (off) |
| 538 | Redfish Power On |
| 539 | Wait For Host Boot Progress To Reach Required State |
| 540 | |
| 541 | # Check if origin is set to static and SLAAC address are getting erased. |
| 542 | ${vmi_ipv6addr}= Verify VMI IPv6 Address Static |
| 543 | Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr} |
| 544 | |
| 545 | |
Megha G N | 503fa35 | 2025-01-08 04:43:09 -0600 | [diff] [blame] | 546 | Disable VMI DHCPv4 When SLAAC Is Enabled And Verify |
| 547 | [Documentation] Disable VMI DHCPv4 parameter when SLAACv6 is enabled |
| 548 | ... and check whether the IPv4 address origin is set to static and |
| 549 | ... DHCPv4 address is getting erased. |
| 550 | [Tags] Disable_VMI_DHCPv4_When_SLAAC_Is_Enabled_And_Verify |
| 551 | [Setup] Set VMI IPv4 Origin ${True} |
| 552 | |
| 553 | # Set IPv6 origin to SLAAC. |
| 554 | Set VMI SLAACv6 Origin ${True} |
| 555 | Verify VMI IPv6 Address SLAAC |
| 556 | |
| 557 | # Disable VMI DHCPv4 and check IPv4 address origin is set to static. |
| 558 | Set VMI IPv4 Origin ${False} |
| 559 | Verify VMI Network Interface Details ${default} Static ${default} ${default} |
| 560 | |
| 561 | |
Megha G N | df25564 | 2025-01-10 02:12:21 -0600 | [diff] [blame] | 562 | Enable VMI SLAAC When DHCPv6 Is Enabled And Verify |
| 563 | [Documentation] Enable VMI SLAACv6 when VMI DHCPv6 is enabled and |
| 564 | ... check IPv6 gets Slaac address and this works on the setup |
| 565 | ... where router advertise network prefix. |
| 566 | [Tags] Enable_VMI_SLAAC_When_DHCPv6_Is_Enabled_And_Verify |
| 567 | |
| 568 | Set VMI DHCPv6 Property Enabled |
| 569 | |
| 570 | # Enable SLAAC and check whether IPv6 origin is set to SLAAC. |
| 571 | Set VMI SLAACv6 Origin ${True} |
| 572 | |
| 573 | # Check if origin is set to slaac and address are getting displayed. |
| 574 | ${vmi_ipv6addr}= Verify VMI IPv6 Address SLAAC |
| 575 | Should Not Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr} |
| 576 | Should Be Equal ${vmi_ipv6addr["PrefixLength"]} ${prefix_length} |
| 577 | |
| 578 | |
Megha G N | 80b4af3 | 2025-01-15 00:47:35 -0600 | [diff] [blame] | 579 | Disable VMI DHCPv6 Property And Verify |
George Keishing | 4ebb328 | 2025-01-17 10:01:34 +0530 | [diff] [blame] | 580 | [Documentation] Disable VMI DHCPv6 property and verify IPv6 address |
| 581 | ... origin is set to static and DHCPv6 address is erased. |
| 582 | [Tags] Disable_VMI_DHCPv6_Property_And_Verify |
Megha G N | 80b4af3 | 2025-01-15 00:47:35 -0600 | [diff] [blame] | 583 | [Setup] Set VMI DHCPv6 Property Enabled |
| 584 | |
| 585 | Set VMI DHCPv6 Property Disabled |
| 586 | |
| 587 | # Verify IPv6 address origin is set to static and DHCPv6 address is erased. |
| 588 | ${vmi_ipv6addr}= Verify VMI IPv6 Address Static |
| 589 | Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr} |
| 590 | |
| 591 | |
Megha G N | 58be512 | 2025-01-16 08:26:53 -0600 | [diff] [blame] | 592 | Enable VMI SLAAC When DHCPv4 Is Enabled And Verify |
| 593 | [Documentation] On VMI enable SLAAC when DHCPv4 is enabled and verify DHCPv4 settings are intact |
| 594 | ... and IPv6 origin is set to SLAAC & it gets assigned with SLAAC IPv6 address and this |
| 595 | ... works on the setup where router advertise network prefix. |
| 596 | [Tags] Enable_VMI_SLAAC_When_DHCPv4_Is_Enabled_And_Verify |
| 597 | [Setup] Set VMI IPv4 Origin ${True} |
| 598 | |
| 599 | # Enable Autoconfig address and check whether IPv6 address origin is set to SLAAC. |
| 600 | Set VMI SLAACv6 Origin ${True} |
| 601 | Verify VMI IPv6 Address SLAAC |
| 602 | |
| 603 | # Check there is no impact on IPv4 settings, IPv4 address origin should be DHCP. |
| 604 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
| 605 | |
| 606 | |
Megha G N | f986714 | 2025-02-03 23:10:57 -0600 | [diff] [blame] | 607 | Disable VMI DHCPv6 Property And Check Persistency On BMC Reboot |
| 608 | [Documentation] Disable VMI DHCPv6 property and verify its persistency on |
| 609 | ... BMC reboot. |
| 610 | [Tags] Disable_VMI_DHCPv6_Property_And_Check_Persistency_On_BMC_Reboot |
| 611 | [Setup] Set VMI DHCPv6 Property Enabled |
| 612 | |
| 613 | Set VMI DHCPv6 Property Disabled |
| 614 | |
| 615 | # Reboot BMC and verify persistency. |
| 616 | OBMC Reboot (off) |
| 617 | |
| 618 | # Verify IPv6 address origin is set to Static and DHCPv6 address is erased. |
| 619 | ${vmi_ipv6addr}= Verify VMI IPv6 Address Static |
| 620 | Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr} |
| 621 | |
| 622 | |
Megha G N | 95e37d8 | 2025-02-06 03:56:04 -0600 | [diff] [blame] | 623 | Enable VMI SLAAC When IPv4 Origin Is Static And Verify |
| 624 | [Documentation] On VMI enable SLAAC when IPv4 origin is static and verify IPv4 settings are intact |
| 625 | ... and IPv6 origin is set to SLAAC & it gets assigned with SLAAC IPv6 address and this works |
| 626 | ... on the setup where router advertise network prefix. |
| 627 | [Tags] Enable_VMI_SLAAC_When_IPv4_Origin_Is_Static_And_Verify |
| 628 | [Setup] Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask} |
| 629 | [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution |
| 630 | |
| 631 | # Enable Autoconfig address and check whether IPv6 address origin is set to SLAAC. |
| 632 | Set VMI SLAACv6 Origin ${True} |
| 633 | Verify VMI IPv6 Address SLAAC |
| 634 | |
| 635 | # Check there is no impact on IPv4 settings, IPv4 address origin should be Static. |
| 636 | Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask} |
| 637 | |
| 638 | |
Megha G N | 97af3bf | 2025-02-27 10:32:08 -0600 | [diff] [blame^] | 639 | Configure Static VMI IPv6 Address And Verify |
| 640 | [Documentation] Add static VMI IPv6 address and check whether IPv6 origin is set to static |
| 641 | ... and Static IPv6 address is assigned. |
| 642 | [Tags] Configure_Static_VMI_IPv6_Address_And_Verify |
| 643 | |
| 644 | Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length} |
| 645 | |
| 646 | # Verify IPv6 address origin is set to static and static IPv6 address is assigned. |
| 647 | ${vmi_ipv6addr}= Verify VMI IPv6 Address Static |
| 648 | Should Not Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr} |
| 649 | Should Be Equal ${vmi_ipv6addr["PrefixLength"]} ${prefix_length} |
| 650 | |
| 651 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 652 | *** Keywords *** |
| 653 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 654 | Suite Setup Execution |
| 655 | [Documentation] Do test setup execution task. |
| 656 | |
| 657 | Redfish.Login |
Megha G N | d0b4da9 | 2024-02-08 15:04:24 -0600 | [diff] [blame] | 658 | |
| 659 | Redfish Power Off |
| 660 | Set BIOS Attribute pvm_hmc_managed Enabled |
Megha G N | 1e53824 | 2024-06-11 03:42:03 -0500 | [diff] [blame] | 661 | Set BIOS Attribute pvm_stop_at_standby Disabled |
| 662 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 663 | Redfish Power On |
Megha G N | 1e53824 | 2024-06-11 03:42:03 -0500 | [diff] [blame] | 664 | Wait For Host Boot Progress To Reach Required State |
Megha G N | 86507da | 2024-02-07 23:16:27 -0600 | [diff] [blame] | 665 | |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 666 | ${active_channel_config}= Get Active Channel Config |
| 667 | Set Suite Variable ${active_channel_config} |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 668 | Set Suite Variable ${ethernet_interface} ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 669 | ${resp}= Redfish.Get |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 670 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface} |
shrsuman123 | 62e5be5 | 2021-05-20 02:42:59 -0500 | [diff] [blame] | 671 | ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json |
Anves Kumar rayankula | d7deb89 | 2020-08-24 02:58:20 -0500 | [diff] [blame] | 672 | ${length}= Get Length ${ip_resp["IPv4StaticAddresses"]} |
| 673 | ${vmi_network_conf}= Run Keyword If ${length} != ${0} Get VMI Network Interface Details |
| 674 | Set Suite Variable ${vmi_network_conf} |
| 675 | |
| 676 | |
| 677 | Test Teardown Execution |
| 678 | [Documentation] Do test teardown execution task. |
| 679 | |
| 680 | FFDC On Test Case Fail |
| 681 | ${curr_mode}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 682 | Run Keyword If ${curr_mode} == ${True} Set VMI IPv4 Origin ${False} |
Megha G N | 1e53824 | 2024-06-11 03:42:03 -0500 | [diff] [blame] | 683 | Run Keyword If '${vmi_network_conf["IPv4_Address"]}' != '${default}' |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 684 | ... 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] | 685 | ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]} |
| 686 | |
| 687 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 688 | Get Immediate Child Parameter From VMI Network Interface |
| 689 | [Documentation] Get immediate child parameter from VMI network interface. |
| 690 | [Arguments] ${parameter} ${valid_status_code}=${HTTP_OK} |
| 691 | |
| 692 | # Description of argument(s): |
| 693 | # parameter parameter for which value is required. Ex: DHCPEnabled, MACAddress etc. |
| 694 | # valid_status_code Expected valid status code from GET request. |
| 695 | |
Anves Kumar rayankula | 358c41d | 2020-08-14 04:53:06 -0500 | [diff] [blame] | 696 | ${resp}= Redfish.Get |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 697 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 698 | ... valid_status_codes=[${valid_status_code}] |
| 699 | |
shrsuman123 | 62e5be5 | 2021-05-20 02:42:59 -0500 | [diff] [blame] | 700 | ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 701 | ${value}= Set Variable If '${parameter}' != 'DHCPEnabled' ${ip_resp["${parameter}"]} |
| 702 | ... ${ip_resp["DHCPv4"]["${parameter}"]} |
| 703 | |
George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 704 | RETURN ${value} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 705 | |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 706 | |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 707 | Switch VMI IPv4 Origin And Verify Details |
| 708 | [Documentation] Switch VMI IPv4 origin and verify details. |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 709 | |
Anves Kumar rayankula | 7936eee | 2021-04-19 05:38:36 -0500 | [diff] [blame] | 710 | ${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] | 711 | ${dhcp_enabled}= Set Variable If ${dhcp_mode_before} == ${False} ${True} ${False} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 712 | |
Anves Kumar rayankula | e7dc89a | 2021-04-28 04:29:38 -0500 | [diff] [blame] | 713 | ${origin}= Set Variable If ${dhcp_mode_before} == ${False} DHCP Static |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 714 | Set VMI IPv4 Origin ${dhcp_enabled} ${HTTP_ACCEPTED} |
Anves Kumar rayankula | 7936eee | 2021-04-19 05:38:36 -0500 | [diff] [blame] | 715 | |
| 716 | ${dhcp_mode_after}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled |
| 717 | Should Not Be Equal ${dhcp_mode_before} ${dhcp_mode_after} |
| 718 | |
| 719 | Run Keyword If ${dhcp_mode_after} == ${True} |
| 720 | ... Verify VMI Network Interface Details ${default} ${origin} ${default} ${default} |
Vijay | 06a169d | 2020-04-23 09:28:24 -0500 | [diff] [blame] | 721 | |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 722 | |
| 723 | Delete VMI Static IP Address Using Different Users |
| 724 | [Documentation] Update user role and delete vmi static IP address. |
| 725 | [Arguments] ${username} ${password} ${valid_status_code} |
| 726 | [Teardown] Run Keywords Redfish.Login AND |
shrsuman123 | f559cbe | 2021-01-06 05:40:45 -0600 | [diff] [blame] | 727 | ... 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] | 728 | ... ${test_netmask} ${HTTP_ACCEPTED} AND Redfish.Logout |
| 729 | |
| 730 | # Description of argument(s): |
| 731 | # username The host username. |
| 732 | # password The host password. |
| 733 | # valid_status_code The expected valid status code. |
| 734 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 735 | # TODO: operator_user role is not yet supported. |
| 736 | Skip If '${username}' == 'operator_user' |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 737 | Redfish.Login ${username} ${password} |
| 738 | 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] | 739 | |
| 740 | |
| 741 | Config VMI Static IP Address Using Different Users |
| 742 | [Documentation] Update user role and update vmi static ip address. |
| 743 | [Arguments] ${username} ${password} ${ip} ${gateway} ${netmask} |
| 744 | ... ${valid_status_code} |
| 745 | |
| 746 | # Description of argument(s): |
| 747 | # username The host username. |
| 748 | # password The host password. |
| 749 | # ip IP address to be added (e.g. "10.7.7.7"). |
| 750 | # subnet_mask Subnet mask for the IP to be added |
| 751 | # (e.g. "255.255.0.0"). |
| 752 | # gateway Gateway for the IP to be added (e.g. "10.7.7.1"). |
| 753 | # valid_status_code The expected valid status code. |
| 754 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 755 | # TODO: operator_user role is not yet supported. |
| 756 | Skip If '${username}' == 'operator_user' |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 757 | Redfish.Login ${username} ${password} |
Anves Kumar rayankula | 1b64d94 | 2020-11-17 02:44:02 -0600 | [diff] [blame] | 758 | 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] | 759 | |
| 760 | |
| 761 | Read VMI Static IP Address Using Different Users |
| 762 | [Documentation] Update user role and read vmi static ip address. |
| 763 | [Arguments] ${username} ${password} ${valid_status_code} |
| 764 | |
| 765 | # Description of argument(s): |
| 766 | # username The host username. |
| 767 | # password The host password. |
| 768 | # valid_status_code The expected valid status code. |
| 769 | |
Megha GN | 80ef5ca | 2022-06-09 00:29:57 -0500 | [diff] [blame] | 770 | # TODO: operator_user role is not yet supported. |
| 771 | Skip If '${username}' == 'operator_user' |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 772 | Redfish.Login ${username} ${password} |
| 773 | Redfish.Get |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 774 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface} |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 775 | ... valid_status_codes=[${valid_status_code}] |
Anves Kumar rayankula | d5de207 | 2020-09-30 06:24:11 -0500 | [diff] [blame] | 776 | |
| 777 | |
| 778 | Delete BMC Users Using Redfish |
| 779 | [Documentation] Delete BMC users via redfish. |
| 780 | |
| 781 | Redfish.Login |
| 782 | Delete BMC Users Via Redfish users=${USERS} |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 783 | |
Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 784 | |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 785 | Update User Role And Set VMI IPv4 Origin |
| 786 | [Documentation] Update User Role And Set VMI IPv4 Origin. |
| 787 | [Arguments] ${username} ${password} ${dhcp_enabled} ${valid_status_code} |
| 788 | |
| 789 | # Description of argument(s): |
| 790 | # username The host username. |
| 791 | # password The host password. |
| 792 | # dhcp_enabled Indicates whether dhcp should be enabled |
| 793 | # (${True}, ${False}). |
| 794 | # valid_status_code The expected valid status code. |
| 795 | |
Megha GN | be42859 | 2022-07-21 10:33:02 -0500 | [diff] [blame] | 796 | # TODO: operator_user role is not yet supported. |
| 797 | Skip If '${username}' == 'operator_user' |
shrsuman123 | b361d41 | 2020-09-30 06:17:23 -0500 | [diff] [blame] | 798 | Redfish.Login ${username} ${password} |
| 799 | Set VMI IPv4 Origin ${dhcp_enabled} ${valid_status_code} |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 800 | |
Sweta Potthuri | d52b273 | 2021-08-12 12:48:24 -0500 | [diff] [blame] | 801 | |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 802 | Suite Teardown Execution |
| 803 | [Documentation] Do suite teardown execution task. |
| 804 | |
| 805 | Run Keyword If ${vmi_network_conf} != ${None} |
| 806 | ... Set Static IPv4 Address To VMI And Verify ${vmi_network_conf["IPv4_Address"]} |
| 807 | ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]} |
shrsuman123 | b25343d | 2021-09-22 04:33:47 -0500 | [diff] [blame] | 808 | Delete All Redfish Sessions |
shrsuman123 | bfb851b | 2021-07-02 04:59:16 -0500 | [diff] [blame] | 809 | Redfish.Logout |
Megha G N | 38acd84 | 2024-10-14 14:28:11 -0500 | [diff] [blame] | 810 | |
| 811 | |
| 812 | Set VMI SLAACv6 Origin |
| 813 | [Documentation] Set VMI SLAACv6 origin. |
| 814 | [Arguments] ${slaac_enabled}=${False} ${valid_status_code}=${HTTP_ACCEPTED} |
| 815 | ... ${interface}=${ethernet_interface} |
| 816 | |
| 817 | # Description of argument(s): |
| 818 | # slaacv6_enabled True if user wants to enable SLAACv6. Default is Static, hence value is set to False. |
| 819 | # valid_status_code Expected valid status code from PATCH request. Default is HTTP_OK. |
| 820 | # interface VMI interface (eg. eth0 or eth1). |
| 821 | |
| 822 | ${data}= Set Variable If ${slaac_enabled} == ${False} ${DISABLE_SLAAC} ${ENABLE_SLAAC} |
| 823 | ${resp}= Redfish.Patch |
| 824 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| 825 | ... body=${data} valid_status_codes=[${valid_status_code}] |
| 826 | |
| 827 | Sleep ${wait_time} |
| 828 | Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED} |
| 829 | ${resp}= Redfish.Get |
| 830 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| 831 | Should Be Equal ${resp.dict["StatelessAddressAutoConfig"]["IPv6AutoConfigEnabled"]} ${slaac_enabled} |
| 832 | |
| 833 | |
| 834 | Verify VMI IPv6 Address |
| 835 | [Documentation] Verify VMI IPv6 address configurations. |
| 836 | [Arguments] ${ipv6_origin} ${interface}=${ethernet_interface} |
| 837 | |
| 838 | # Description of argument(s): |
| 839 | # ipv6_origin Origin of IPv6 address eg. Static or DHCPv6 or SLAAC. |
| 840 | # interface VMI interface (eg. eth0 or eth1). |
| 841 | |
| 842 | ${resp}= Redfish.Get /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| 843 | |
| 844 | @{vmi_ipv6_configurations}= Get From Dictionary ${resp.dict} IPv6Addresses |
| 845 | ${vmi_ipv6_config}= Get From List ${vmi_ipv6_configurations} 0 |
| 846 | Should Not Be Empty ${vmi_ipv6_config["Address"]} |
| 847 | Should Be Equal As Strings ${vmi_ipv6_config["AddressOrigin"]} ${ipv6_origin} |
Megha G N | a37b8da | 2025-01-06 00:23:15 -0600 | [diff] [blame] | 848 | RETURN &{vmi_ipv6_config} |
Megha G N | df25564 | 2025-01-10 02:12:21 -0600 | [diff] [blame] | 849 | |
| 850 | |
| 851 | Set VMI DHCPv6 Property |
| 852 | [Documentation] Set VMI DHCPv6 attribute. |
| 853 | [Arguments] ${dhcpv6_operatingmode}=${Disabled} ${valid_status_code}=${HTTP_ACCEPTED} |
| 854 | ... ${interface}=${ethernet_interface} |
| 855 | |
| 856 | # Description of argument(s): |
| 857 | # dhcpv6_operatingmode Enabled if user wants to enable DHCPv6. |
| 858 | # ... Default is Static, hence value is set to Disabled. |
| 859 | # valid_status_code Expected valid status code from PATCH request. Default is HTTP_OK. |
| 860 | # interface VMI interface (eg. eth0 or eth1). |
| 861 | |
| 862 | ${data}= Set Variable If '${dhcpv6_operatingmode}' == 'Disabled' ${DISABLE_DHCPv6} ${ENABLE_DHCPv6} |
| 863 | ${resp}= Redfish.Patch |
| 864 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| 865 | ... body=${data} valid_status_codes=[${valid_status_code}] |
| 866 | |
| 867 | Sleep ${wait_time} |
| 868 | Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED} |
| 869 | ${resp}= Redfish.Get |
| 870 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| 871 | Should Be Equal ${resp.dict["DHCPv6"]["OperatingMode"]} ${dhcpv6_operatingmode} |
Megha G N | 97af3bf | 2025-02-27 10:32:08 -0600 | [diff] [blame^] | 872 | |
| 873 | |
| 874 | Set Static VMI IPv6 Address |
| 875 | [Documentation] Add static VMI IPv6 address. |
| 876 | [Arguments] ${vmi_ipv6_addr} ${prefix_len} ${valid_status_codes}=${HTTP_ACCEPTED} |
| 877 | ... ${interface}=${ethernet_interface} |
| 878 | |
| 879 | # Description of argument(s): |
| 880 | # vmi_ipv6_addr VMI IPv6 address to be added. |
| 881 | # prefix_len Prefix length for the VMI IPv6 to be added. |
| 882 | # valid_status_codes Expected valid status code from PATCH request. |
| 883 | # interface VMI interface (eg. eth0 or eth1). |
| 884 | |
| 885 | ${prefix_length}= Convert To Integer ${prefix_len} |
| 886 | ${empty_dict}= Create Dictionary |
| 887 | ${vmi_ipv6_data}= Create Dictionary Address=${vmi_ipv6_addr} |
| 888 | ... PrefixLength=${prefix_length} |
| 889 | |
| 890 | ${patch_list}= Create List |
| 891 | |
| 892 | Append To List ${patch_list} ${vmi_ipv6_data} |
| 893 | ${data}= Create Dictionary IPv6StaticAddresses=${patch_list} |
| 894 | |
| 895 | ${active_channel_config}= Get Active Channel Config |
| 896 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 897 | |
| 898 | Redfish.patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| 899 | ... body=&{data} valid_status_codes=[${valid_status_codes}] |