blob: e6ca5f9fff48c175f79bc4f1845cf69da7e6d404 [file] [log] [blame]
Vijay06a169d2020-04-23 09:28:24 -05001*** Settings ***
2
Megha GN80ef5ca2022-06-09 00:29:57 -05003Documentation VMI static/dynamic IP config tests.
Vijay06a169d2020-04-23 09:28:24 -05004
Megha GN80ef5ca2022-06-09 00:29:57 -05005Resource ../../lib/external_intf/vmi_utils.robot
Vijay06a169d2020-04-23 09:28:24 -05006
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -05007Suite Setup Suite Setup Execution
Vijay06a169d2020-04-23 09:28:24 -05008Test Teardown FFDC On Test Case Fail
George Keishing4e0978d2022-07-27 10:21:18 -05009Suite Teardown Run Keyword And Ignore Error Suite Teardown Execution
Vijay06a169d2020-04-23 09:28:24 -050010
Megha G Nf9867142025-02-03 23:10:57 -060011Test Tags Vmi
George Keishing725e0662022-07-20 22:18:14 -050012
Vijay06a169d2020-04-23 09:28:24 -050013*** Variables ***
14
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -050015# users User Name password
16@{ADMIN} admin_user TestPwd123
17@{OPERATOR} operator_user TestPwd123
18@{ReadOnly} readonly_user TestPwd123
Megha GN80ef5ca2022-06-09 00:29:57 -050019&{USERS} Administrator=${ADMIN} ReadOnly=${ReadOnly}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -050020
Prashanth Katti1ce68212020-11-13 00:39:03 -060021${test_ipv4} 10.6.6.6
22${test_gateway} 10.6.6.1
shrsuman123c1d3fe32020-09-08 05:04:07 -050023${test_netmask} 255.255.252.0
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050024
Vijay06a169d2020-04-23 09:28:24 -050025&{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 N02cbfa12022-12-12 02:05:03 -060031${default} 0.0.0.0
Megha G Na37b8da2025-01-06 00:23:15 -060032${default_ipv6addr} ::
Sridevi Ramesh70f087b2025-01-26 00:27:05 -060033${prefix_length} ${64}
Megha G N97af3bf2025-02-27 10:32:08 -060034${test_vmi_ipv6addr} 2001:db8:1111:2222:10:5:5:6
Megha G Ne0e055d2025-02-28 02:16:06 -060035${test_vmi_ipv6gateway} 2001:db8:1111:2222::1
Megha G N02cbfa12022-12-12 02:05:03 -060036
Vijay06a169d2020-04-23 09:28:24 -050037
38*** Test Cases ***
39
40Verify All VMI EthernetInterfaces
41 [Documentation] Verify all VMI ethernet interfaces.
shrsuman1235c7e4d72021-04-16 05:42:57 -050042 [Tags] Verify_All_VMI_EthernetInterfaces
Vijay06a169d2020-04-23 09:28:24 -050043
44 Verify VMI EthernetInterfaces
45
46
47Verify Existing VMI Network Interface Details
48 [Documentation] Verify existing VMI network interface details.
shrsuman1235c7e4d72021-04-16 05:42:57 -050049 [Tags] Verify_Existing_VMI_Network_Interface_Details
Vijay06a169d2020-04-23 09:28:24 -050050
51 ${vmi_ip}= Get VMI Network Interface Details
52 ${origin}= Set Variable If ${vmi_ip["DHCPv4"]} == ${False} Static DHCP
Vijay06a169d2020-04-23 09:28:24 -050053 Should Not Be Equal ${vmi_ip["DHCPv4"]} ${vmi_ip["IPv4StaticAddresses"]}
shrsuman123bfb851b2021-07-02 04:59:16 -050054 Should Be Equal As Strings ${vmi_ip["Id"]} ${ethernet_interface}
George Keishingb3ea0952020-07-01 05:03:56 -050055 Should Be Equal As Strings ${vmi_ip["Description"]}
shrsuman1235c7e4d72021-04-16 05:42:57 -050056 ... Hypervisor's Virtual Management Ethernet Interface
57 Should Be Equal As Strings ${vmi_ip["Name"]} Hypervisor Ethernet Interface
shrsuman1235c7e4d72021-04-16 05:42:57 -050058 Run Keyword If ${vmi_ip["IPv4StaticAddresses"]} != @{empty}
59 ... Verify VMI Network Interface Details ${vmi_ip["IPv4_Address"]}
60 ... ${origin} ${vmi_ip["IPv4_Gateway"]} ${vmi_ip["IPv4_SubnetMask"]}
Vijay06a169d2020-04-23 09:28:24 -050061
62
63Delete Existing Static VMI IP Address
64 [Documentation] Delete existing static VMI IP address.
65 [Tags] Delete_Existing_Static_VMI_IP_Address
66
67 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
68 Run Keyword If ${curr_origin} == ${True} Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED}
69
shrsuman1235c7e4d72021-04-16 05:42:57 -050070 Delete VMI IPv4 Address
Vijay06a169d2020-04-23 09:28:24 -050071
72
73Verify User Cannot Delete ReadOnly Property IPv4Addresses
74 [Documentation] Verify user cannot delete readonly property IPv4Addresses.
75 [Tags] Verify_User_Cannot_Delete_ReadOnly_Property_IPv4Addresses
76
77 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
shrsuman1235c7e4d72021-04-16 05:42:57 -050078 Run Keyword If ${curr_origin} == ${True} Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED}
79 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
shrsuman123b25343d2021-09-22 04:33:47 -050080 Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_FORBIDDEN}
Vijay06a169d2020-04-23 09:28:24 -050081
82
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -050083Assign Valid And Invalid Static IPv4 Address To VMI
Vijay06a169d2020-04-23 09:28:24 -050084 [Documentation] Assign static IPv4 address to VMI.
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -050085 [Tags] Assign_Valid_And_Invalid_Static_IPv4_Address_To_VMI
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -060086 [Template] Set Static IPv4 Address To VMI And Verify
87 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
Vijay06a169d2020-04-23 09:28:24 -050088
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050089 # ip gateway netmask valid_status_code
Shradha Sumanc7df7db2021-03-08 05:16:44 -060090 10.5.20.30 10.5.20.1 255.255.252.0 ${HTTP_ACCEPTED}
91 a.3.118.94 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
Anves Kumar rayankula81fd9db2021-05-10 02:39:51 -050092 10.5.20 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
93 10.5.20.-5 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050094
Vijay06a169d2020-04-23 09:28:24 -050095
George Keishing16b3c7b2021-01-28 09:23:37 -060096Add Multiple IP Addresses On VMI Interface And Verify
97 [Documentation] Add multiple IP addresses on VMI interface and verify.
98 [Tags] Add_Multiple_IP_Addresses_On_VMI_Interface_And_Verify
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -060099 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123e37b0cc2020-09-02 00:33:42 -0500100
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600101 ${ip1}= Create dictionary Address=10.5.5.10 SubnetMask=255.255.252.0 Gateway=10.5.5.1
102 ${ip2}= Create dictionary Address=10.5.5.11 SubnetMask=255.255.252.0 Gateway=10.5.5.1
103 ${ip3}= Create dictionary Address=10.5.5.12 SubnetMask=255.255.252.0 Gateway=10.5.5.1
shrsuman123e37b0cc2020-09-02 00:33:42 -0500104 ${ips}= Create List ${ip1} ${ip2} ${ip3}
105
shrsuman123bfb851b2021-07-02 04:59:16 -0500106 Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
shrsuman123993a5c92021-04-19 06:40:16 -0500107 ... body={'IPv4StaticAddresses':${ips}} valid_status_codes=[${HTTP_BAD_REQUEST}]
shrsuman123e37b0cc2020-09-02 00:33:42 -0500108
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500109
shrsuman123e37b0cc2020-09-02 00:33:42 -0500110Modify IP Addresses On VMI Interface And Verify
111 [Documentation] Modify IP addresses on VMI interface and verify.
112 [Tags] Modify_IP_Addresses_On_VMI_Interface_And_Verify
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600113 [Template] Set Static IPv4 Address To VMI And Verify
114 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123e37b0cc2020-09-02 00:33:42 -0500115
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500116 # ip gateway netmask valid_status_code
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600117 10.5.5.10 10.5.5.1 255.255.252.0 ${HTTP_ACCEPTED}
118 10.5.5.11 10.5.5.1 255.255.252.0 ${HTTP_ACCEPTED}
Vijay06a169d2020-04-23 09:28:24 -0500119
Megha GN80ef5ca2022-06-09 00:29:57 -0500120
Vijay06a169d2020-04-23 09:28:24 -0500121Switch Between IP Origins On VMI And Verify Details
122 [Documentation] Switch between IP origins on VMI and verify details.
123 [Tags] Switch_Between_IP_Origins_On_VMI_And_Verify_Details
124
125 Switch VMI IPv4 Origin And Verify Details
126 Switch VMI IPv4 Origin And Verify Details
127
128
129Verify Persistency Of VMI IPv4 Details After Host Reboot
130 [Documentation] Verify persistency of VMI IPv4 details after host reboot.
131 [Tags] Verify_Persistency_Of_VMI_IPv4_Details_After_Host_Reboot
132
133 # Verifying persistency of dynamic address.
134 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500135 Redfish Power Off stack_mode=skip
136 Redfish Power On
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500137 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
Vijay06a169d2020-04-23 09:28:24 -0500138
139 # Verifying persistency of static address.
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600140 Switch VMI IPv4 Origin And Verify Details
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500141 Redfish Power Off stack_mode=skip
142 Redfish Power On
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600143 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Vijay06a169d2020-04-23 09:28:24 -0500144
145
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500146Delete VMI Static IP Address And Verify
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500147 [Documentation] Delete VMI static IP address and verify.
148 [Tags] Delete_VMI_Static_IP_Address_And_Verify
149 [Teardown] Test Teardown Execution
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500150
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600151 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
152 Delete VMI IPv4 Address
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500153
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500154
shrsuman123c1d3fe32020-09-08 05:04:07 -0500155Verify Successful VMI IP Static Configuration On HOST Boot After Session Delete
156 [Documentation] Verify VMI IP static Configuration On HOST Boot After session deleted.
157 [Tags] Verify_Successful_VMI_IP_Static_Configuration_On_HOST_Boot_After_Session_Delete
shrsuman123b25343d2021-09-22 04:33:47 -0500158 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123c1d3fe32020-09-08 05:04:07 -0500159
shrsuman12375e77062020-09-18 01:08:45 -0500160 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
shrsuman123c1d3fe32020-09-08 05:04:07 -0500161
162 ${session_info}= Get Redfish Session Info
163 Redfish.Delete ${session_info["location"]}
164
165 # Create a new Redfish session
shrsuman1235c7e4d72021-04-16 05:42:57 -0500166 Redfish.Login
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500167 Redfish Power Off
168 Redfish Power On
shrsuman123c1d3fe32020-09-08 05:04:07 -0500169
170 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
171
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500172
shrsuman123c1d3fe32020-09-08 05:04:07 -0500173Verify Persistency Of VMI DHCP IP Configuration After Multiple HOST Reboots
174 [Documentation] Verify Persistency Of VMI DHCP IP configuration After Multiple HOST Reboots
175 [Tags] Verify_Persistency_Of_VMI_DHCP_IP_Configuration_After_Multiple_HOST_Reboots
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500176 [Teardown] Test Teardown Execution
shrsuman123c1d3fe32020-09-08 05:04:07 -0500177
shrsuman123c1d3fe32020-09-08 05:04:07 -0500178 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
shrsuman123c1d3fe32020-09-08 05:04:07 -0500179 ${vmi_ip_config}= Get VMI Network Interface Details
180 # Verifying persistency of dynamic address after multiple reboots.
shrsuman123f559cbe2021-01-06 05:40:45 -0600181 FOR ${i} IN RANGE ${2}
182 Redfish Power Off
183 Redfish Power On
George Keishing538f1742022-03-14 05:00:55 -0500184 Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]}
185 ... DHCP ${vmi_ip_config["IPv4_Gateway"]} ${vmi_ip_config["IPv4_SubnetMask"]}
shrsuman123f559cbe2021-01-06 05:40:45 -0600186 END
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500187
188
189Enable DHCP When Static IP Configured And Verify Static IP
190 [Documentation] Enable DHCP when static ip configured and verify static ip
George Keishing4203fad2022-01-31 12:22:33 -0600191 [Tags] Enable_DHCP_When_Static_IP_Configured_And_Verify_Static_IP
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600192 [Setup] Redfish Power On
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500193 [Teardown] Test Teardown Execution
194
shrsuman123f559cbe2021-01-06 05:40:45 -0600195 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500196 Set VMI IPv4 Origin ${True}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500197 ${vmi_network_conf}= Get VMI Network Interface Details
198 Should Not Be Equal As Strings ${test_ipv4} ${vmi_network_conf["IPv4_Address"]}
199
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500200
shrsuman123e37b0cc2020-09-02 00:33:42 -0500201Verify VMI Static IP Configuration Persist On BMC Reset Before Host Boot
202 [Documentation] Verify VMI static IP configuration persist on BMC reset.
203 [Tags] Verify_VMI_Static_IP_Configuration_Persist_On_BMC_Reset_Before_Host_Boot
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600204 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
shrsuman123e37b0cc2020-09-02 00:33:42 -0500205
shrsuman12375e77062020-09-18 01:08:45 -0500206 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Megha GNbe428592022-07-21 10:33:02 -0500207 Redfish OBMC Reboot (off) stack_mode=skip
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500208 Redfish Power On
shrsuman123e37b0cc2020-09-02 00:33:42 -0500209 # Verifying the VMI static configuration
210 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
211
Megha GN80ef5ca2022-06-09 00:29:57 -0500212
shrsuman12375e77062020-09-18 01:08:45 -0500213Add Static IP When Host Poweroff And Verify On Poweron
214 [Documentation] Add Static IP When Host Poweroff And Verify on power on
215 [Tags] Add_Static_IP_When_Host_Poweroff_And_Verify_On_Poweron
216 [Setup] Redfish Power Off
217 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
218
219 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
220 Redfish Power On
221 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
222
Megha GN80ef5ca2022-06-09 00:29:57 -0500223
shrsuman12375e77062020-09-18 01:08:45 -0500224Add VMI Static IP When Host Poweroff And Verify Static IP On BMC Reset
225 [Documentation] Add Static IP When Host Poweroff And Verify Static IP On BMC Reset.
226 [Tags] Add_VMI_Static_IP_When_Host_Poweroff_And_Verify_Static_IP_On_BMC_Reset
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}
Megha GNbe428592022-07-21 10:33:02 -0500231 Redfish OBMC Reboot (off) stack_mode=skip
shrsuman12375e77062020-09-18 01:08:45 -0500232 Redfish Power On
233 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
234
Megha GN80ef5ca2022-06-09 00:29:57 -0500235
shrsuman12375e77062020-09-18 01:08:45 -0500236Enable DHCP When No Static IP Configured And Verify DHCP IP
237 [Documentation] Enable DHCP when no static ip configured and verify dhcp ip
238 [Tags] Enable_DHCP_When_No_Static_IP_Configured_And_Verify_DHCP_IP
239 [Setup] Run Keyword And Ignore Error Delete VMI IPv4 Address
240 [Teardown] Test Teardown Execution
241
242 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
243 Run Keyword If ${curr_origin} == ${False} Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
244 ${vmi_ip_config}= Get VMI Network Interface Details
George Keishing538f1742022-03-14 05:00:55 -0500245 Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]}
246 ... DHCP ${vmi_ip_config["IPv4_Gateway"]} ${vmi_ip_config["IPv4_SubnetMask"]}
shrsuman12375e77062020-09-18 01:08:45 -0500247
Megha GN80ef5ca2022-06-09 00:29:57 -0500248
shrsuman12375e77062020-09-18 01:08:45 -0500249Verify User Cannot Delete VMI DHCP IP Address
250 [Documentation] Verify user cannot delete VMI DHCP IP Address
251 [Tags] Verify_User_Cannot_Delete_VMI_DHCP_IP_Address
252 [Setup] Set VMI IPv4 Origin ${True}
253 [Teardown] Test Teardown Execution
254
shrsuman123b25343d2021-09-22 04:33:47 -0500255 Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_FORBIDDEN}
shrsuman12375e77062020-09-18 01:08:45 -0500256 ${resp}= Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500257 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
shrsuman12375e77062020-09-18 01:08:45 -0500258 Should Not Be Empty ${resp.dict["IPv4Addresses"]}
259
Megha GN80ef5ca2022-06-09 00:29:57 -0500260
shrsuman12375e77062020-09-18 01:08:45 -0500261Enable DHCP When Static IP Configured DHCP Server Unavailable And Verify IP
262 [Documentation] Enable DHCP When Static IP Configured And DHCP Server Unavailable And Verify No IP.
263 [Tags] Enable_DHCP_When_Static_IP_Configured_DHCP_Server_Unavailable_And_Verify_IP
264 [Teardown] Test Teardown Execution
265
266 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
267 Set VMI IPv4 Origin ${True}
shrsuman12375e77062020-09-18 01:08:45 -0500268 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
269
shrsuman123e37b0cc2020-09-02 00:33:42 -0500270
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500271Verify To Configure VMI Static IP Address With Different User Roles
272 [Documentation] Verify to configure vmi static ip address with different user roles.
273 [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Different_User_Roles
Megha G N4e2b5732023-02-02 04:52:27 -0600274 [Setup] Run Keywords Delete BMC Users Using Redfish
275 ... AND Create Users With Different Roles users=${USERS} force=${True}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500276 [Template] Config VMI Static IP Address Using Different Users
277 [Teardown] Delete BMC Users Using Redfish
278
279 # username password ip_address gateway nemask valid_status_code
280 admin_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_ACCEPTED}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500281 readonly_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500282
283
284Verify To Configure VMI Static IP Address With Operator User Role
285 [Documentation] Verify to configure vmi static ip address with operator user role.
286 [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Operator_User_Role
287 [Setup] Create Users With Different Roles users=${USERS} force=${True}
288 [Template] Config VMI Static IP Address Using Different Users
289 [Teardown] Delete BMC Users Using Redfish
290
291 # username password ip_address gateway nemask valid_status_code
292 operator_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500293
294
295Verify To Delete VMI Static IP Address With Different User Roles
296 [Documentation] Verify to delete vmi static IP address with different user roles.
297 [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Different_User_Roles
298 [Setup] Create Users With Different Roles users=${USERS} force=${True}
299 [Template] Delete VMI Static IP Address Using Different Users
300 [Teardown] Delete BMC Users Using Redfish
301
302 # username password valid_status_code
303 admin_user TestPwd123 ${HTTP_ACCEPTED}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500304 readonly_user TestPwd123 ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500305
306
307Verify To Delete VMI Static IP Address With Operator User Role
308 [Documentation] Verify to delete vmi static IP address with operator user role.
309 [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Operator_User_Role
310 [Setup] Create Users With Different Roles users=${USERS} force=${True}
311 [Template] Delete VMI Static IP Address Using Different Users
312 [Teardown] Delete BMC Users Using Redfish
313
314 # username password valid_status_code
315 operator_user TestPwd123 ${HTTP_FORBIDDEN}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500316
317
318Verify To Update VMI Static IP Address With Different User Roles
319 [Documentation] Verify to update vmi static IP address with different user roles.
George Keishing4203fad2022-01-31 12:22:33 -0600320 [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Different_User_Roles
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500321 [Setup] Create Users With Different Roles users=${USERS} force=${True}
322 [Template] Config VMI Static IP Address Using Different Users
323 [Teardown] Delete BMC Users Using Redfish
324
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600325 # username password ip_address gateway netmask valid_status_code
326 admin_user TestPwd123 10.5.10.20 10.5.10.1 255.255.0.0 ${HTTP_ACCEPTED}
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600327 readonly_user TestPwd123 10.5.20.40 10.5.20.1 255.255.0.0 ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500328
329
330Verify To Update VMI Static IP Address With Operator User Role
331 [Documentation] Verify to update vmi static IP address with operator user role.
332 [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Operator_User_Role
333 [Setup] Create Users With Different Roles users=${USERS} force=${True}
334 [Template] Config VMI Static IP Address Using Different Users
335 [Teardown] Delete BMC Users Using Redfish
336
337 # username password ip_address gateway netmask valid_status_code
338 operator_user TestPwd123 10.5.10.30 10.5.10.1 255.255.0.0 ${HTTP_FORBIDDEN}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500339
340
341Verify To Read VMI Network Configuration With Different User Roles
342 [Documentation] Verify to read vmi network configuration with different user roles.
George Keishing4203fad2022-01-31 12:22:33 -0600343 [Tags] Verify_To_Read_VMI_Network_Configuration_With_Different_User_Roles
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500344 [Setup] Create Users With Different Roles users=${USERS} force=${True}
345 [Template] Read VMI Static IP Address Using Different Users
346 [Teardown] Delete BMC Users Using Redfish
347
348 # username password valid_status_code
349 admin_user TestPwd123 ${HTTP_OK}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500350 readonly_user TestPwd123 ${HTTP_OK}
Megha GN80ef5ca2022-06-09 00:29:57 -0500351
352
353Verify To Read VMI Network Configuration With Operator User Role
354 [Documentation] Verify to read vmi network configuration with operator user role.
355 [Tags] Verify_To_Read_VMI_Network_Configuration_With_Operator_User_Role
356 [Setup] Create Users With Different Roles users=${USERS} force=${True}
357 [Template] Read VMI Static IP Address Using Different Users
358 [Teardown] Delete BMC Users Using Redfish
359
360 # username password valid_status_code
361 operator_user TestPwd123 ${HTTP_FORBIDDEN}
362
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500363
shrsuman123b361d412020-09-30 06:17:23 -0500364Enable DHCP On VMI Network Via Different Users Roles And Verify
365 [Documentation] Enable DHCP On VMI Network Via Different Users Roles And Verify.
366 [Tags] Enable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify
367 [Setup] Create Users With Different Roles users=${USERS} force=${True}
368 [Template] Update User Role And Set VMI IPv4 Origin
369 [Teardown] Delete BMC Users Using Redfish
370
371 # username password dhcp_enabled valid_status_code
372 admin_user TestPwd123 ${True} ${HTTP_ACCEPTED}
shrsuman123b361d412020-09-30 06:17:23 -0500373 readonly_user TestPwd123 ${True} ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500374
375
376Enable DHCP On VMI Network Via Operator User Role And Verify
377 [Documentation] Enable DHCP On VMI Network Via Operator User Role And Verify.
378 [Tags] Enable_DHCP_On_VMI_Network_Via_Operator_User_Role_And_Verify
379 [Setup] Create Users With Different Roles users=${USERS} force=${True}
380 [Template] Update User Role And Set VMI IPv4 Origin
381 [Teardown] Delete BMC Users Using Redfish
382
383 # username password dhcp_enabled valid_status_code
384 operator_user TestPwd123 ${True} ${HTTP_FORBIDDEN}
385
shrsuman123b361d412020-09-30 06:17:23 -0500386
387Disable DHCP On VMI Network Via Different Users Roles And Verify
388 [Documentation] Disable DHCP On VMI Network Via Different Users Roles And Verify.
389 [Tags] Disable_DHCP_On_VMI_Network_Via_Different_Users_Roles_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 admin_user TestPwd123 ${False} ${HTTP_ACCEPTED}
shrsuman123b361d412020-09-30 06:17:23 -0500396 readonly_user TestPwd123 ${False} ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500397
398
399Disable DHCP On VMI Network Via Operator User Role And Verify
400 [Documentation] Disable DHCP On VMI Network Via Operator User Role And Verify.
401 [Tags] Disable_DHCP_On_VMI_Network_Via_Operator_User_Role_And_Verify
402 [Setup] Create Users With Different Roles users=${USERS} force=${True}
403 [Template] Update User Role And Set VMI IPv4 Origin
404 [Teardown] Delete BMC Users Using Redfish
405
406 # username password dhcp_enabled valid_status_code
407 operator_user TestPwd123 ${False} ${HTTP_FORBIDDEN}
shrsuman123b361d412020-09-30 06:17:23 -0500408
shrsuman123e37b0cc2020-09-02 00:33:42 -0500409
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500410Enable And Disable DHCP And Verify
411 [Documentation] verify enable DHCP and disable DHCP.
George Keishing4203fad2022-01-31 12:22:33 -0600412 [Tags] Enable_And_Disable_DHCP_And_Verify
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500413
414 Set VMI IPv4 Origin ${True}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500415 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
416 Set VMI IPv4 Origin ${False}
Megha GN80ef5ca2022-06-09 00:29:57 -0500417 Verify VMI Network Interface Details ${default} Static ${default} ${default}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500418
419
420Multiple Times Enable And Disable DHCP And Verify
421 [Documentation] Enable and Disable DHCP in a loop and verify VMI gets an IP address from DHCP
422 ... each time when DHCP is enabled
423 [Tags] Multiple_Times_Enable_And_Disable_DHCP_And_Verify
424
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500425 FOR ${i} IN RANGE ${2}
426 Set VMI IPv4 Origin ${True}
427 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
428 Set VMI IPv4 Origin ${False}
Megha GN80ef5ca2022-06-09 00:29:57 -0500429 Verify VMI Network Interface Details ${default} Static ${default} ${default}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500430 END
431
432
Anves Kumar rayankula81fd9db2021-05-10 02:39:51 -0500433Assign Static IPv4 Address With Invalid Netmask To VMI
434 [Documentation] Assign static IPv4 address with invalid netmask and expect error.
435 [Tags] Assign_Static_IPv4_Address_With_Invalid_Netmask_To_VMI
436 [Template] Set Static IPv4 Address To VMI And Verify
437
438 # ip gateway netmask valid_status_code
439 ${test_ipv4} ${test_gateway} 255.256.255.0 ${HTTP_BAD_REQUEST}
440 ${test_ipv4} ${test_gateway} ff.ff.ff.ff ${HTTP_BAD_REQUEST}
441 ${test_ipv4} ${test_gateway} 255.255.253.0 ${HTTP_BAD_REQUEST}
442
443
444Assign Static IPv4 Address With Invalid Gateway To VMI
445 [Documentation] Add static IPv4 address with invalid gateway and expect error.
446 [Tags] Assign_Static_IPv4_Address_With_Invalid_Gateway_To_VMI
447 [Template] Set Static IPv4 Address To VMI And Verify
448
449 # ip gateway netmask valid_status_code
450 ${test_ipv4} @@@.%%.44.11 ${test_netmask} ${HTTP_BAD_REQUEST}
451 ${test_ipv4} 0xa.0xb.0xc.0xd ${test_netmask} ${HTTP_BAD_REQUEST}
452 ${test_ipv4} 10.3.36 ${test_netmask} ${HTTP_BAD_REQUEST}
453 ${test_ipv4} 10.3.36.-10 ${test_netmask} ${HTTP_BAD_REQUEST}
454
455
Megha G N02cbfa12022-12-12 02:05:03 -0600456Enable DHCP When Host Is Off And Verify After Poweron
457 [Documentation] Enable DHCP when host is off and
458 ... check whether it is enabled after poweron.
459 [Tags] Enable_DHCP_When_Host_Is_Off_And_Verify_After_Poweron
460 [Setup] Redfish Power Off stack_mode=skip
461
462 Set VMI IPv4 Origin ${True}
463 Redfish Power On stack_mode=skip
464 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
465
466
Megha G N89174682023-01-24 23:28:27 -0600467Disable DHCP When Host Is Off And Verify New State Reflects After Power On
468 [Documentation] Disable DHCP when host is off and
469 ... get network info and verify that VMI origin is static.
470 [Tags] Disable_DHCP_When_Host_Is_Off_And_Verify_New_State_Reflects_After_Power_On
471 [Setup] Redfish Power Off stack_mode=skip
472
473 Set VMI IPv4 Origin ${False}
474 Redfish Power On stack_mode=skip
475 Verify VMI Network Interface Details ${default} Static ${default} ${default}
476
477
Megha G N38acd842024-10-14 14:28:11 -0500478Enable VMI Stateless Address AutoConfig And Verify
479 [Documentation] Enable VMI SLAACv6 and verify an origin.
480 [Tags] Enable_VMI_Stateless_Address_AutoConfig_And_Verify
481
482 Set VMI SLAACv6 Origin ${True}
483
484 # Check origin is set to slaac and address are getting displayed.
485 Verify VMI IPv6 Address SLAAC
486
487
Megha G Ne8c0e422024-12-04 03:12:55 -0600488Disable VMI Stateless Address AutoConfig And Verify
489 [Documentation] Disable VMI SLAACv6 and verify an origin.
490 [Tags] Disable_VMI_Stateless_Address_AutoConfig_And_Verify
491 [Setup] Set VMI SLAACv6 Origin ${True}
492
493 Set VMI SLAACv6 Origin ${False}
494
495 # Check origin is set to static and slaacv6 address are getting erased.
496 Verify VMI IPv6 Address Static
497
498
Megha G Na37b8da2025-01-06 00:23:15 -0600499Enable VMI SLAAC And Check Persistency On BMC Reboot
500 [Documentation] Enable VMI SLAACv6 and verify its persistency
501 ... on BMC reboot and this works on the setup where router
Megha G Na727d5b2025-02-06 04:41:47 -0600502 ... advertises network prefix.
Megha G Na37b8da2025-01-06 00:23:15 -0600503 [Tags] Enable_VMI_SLAAC_And_Check_Persistency_On_BMC_Reboot
504
505 Set VMI SLAACv6 Origin ${True}
506
507 # Reboot BMC and verify persistency.
508 OBMC Reboot (off)
509 Redfish Power On
510 Wait For Host Boot Progress To Reach Required State
Megha G Na727d5b2025-02-06 04:41:47 -0600511 Sleep 5s
Megha G Na37b8da2025-01-06 00:23:15 -0600512
513 # Check origin is set to slaac and address are getting displayed.
514 ${vmi_ipv6addr}= Verify VMI IPv6 Address SLAAC
515 Should Not Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
516
517
Megha G N49657382025-01-07 23:10:42 -0600518Disable VMI SLAAC And Check Persistency On BMC Reboot
519 [Documentation] Disable VMI SLAACv6 and verify its persistency
520 ... on BMC reboot.
521 [Tags] Disable_VMI_SLAAC_And_Check_Persistency_On_BMC_Reboot
522
523 Set VMI SLAACv6 Origin ${False}
524
525 # Reboot BMC and verify persistency.
526 OBMC Reboot (off)
527 Redfish Power On
528 Wait For Host Boot Progress To Reach Required State
529
530 # Check if origin is set to static and SLAAC address are getting erased.
531 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
532 Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
533
534
Megha G N503fa352025-01-08 04:43:09 -0600535Disable VMI DHCPv4 When SLAAC Is Enabled And Verify
536 [Documentation] Disable VMI DHCPv4 parameter when SLAACv6 is enabled
537 ... and check whether the IPv4 address origin is set to static and
538 ... DHCPv4 address is getting erased.
539 [Tags] Disable_VMI_DHCPv4_When_SLAAC_Is_Enabled_And_Verify
540 [Setup] Set VMI IPv4 Origin ${True}
541
542 # Set IPv6 origin to SLAAC.
543 Set VMI SLAACv6 Origin ${True}
544 Verify VMI IPv6 Address SLAAC
545
546 # Disable VMI DHCPv4 and check IPv4 address origin is set to static.
547 Set VMI IPv4 Origin ${False}
548 Verify VMI Network Interface Details ${default} Static ${default} ${default}
549
550
Megha G Ndf255642025-01-10 02:12:21 -0600551Enable VMI SLAAC When DHCPv6 Is Enabled And Verify
552 [Documentation] Enable VMI SLAACv6 when VMI DHCPv6 is enabled and
553 ... check IPv6 gets Slaac address and this works on the setup
554 ... where router advertise network prefix.
555 [Tags] Enable_VMI_SLAAC_When_DHCPv6_Is_Enabled_And_Verify
556
557 Set VMI DHCPv6 Property Enabled
558
559 # Enable SLAAC and check whether IPv6 origin is set to SLAAC.
560 Set VMI SLAACv6 Origin ${True}
561
562 # Check if origin is set to slaac and address are getting displayed.
563 ${vmi_ipv6addr}= Verify VMI IPv6 Address SLAAC
564 Should Not Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
565 Should Be Equal ${vmi_ipv6addr["PrefixLength"]} ${prefix_length}
566
567
Megha G N80b4af32025-01-15 00:47:35 -0600568Disable VMI DHCPv6 Property And Verify
George Keishing4ebb3282025-01-17 10:01:34 +0530569 [Documentation] Disable VMI DHCPv6 property and verify IPv6 address
570 ... origin is set to static and DHCPv6 address is erased.
571 [Tags] Disable_VMI_DHCPv6_Property_And_Verify
Megha G N80b4af32025-01-15 00:47:35 -0600572 [Setup] Set VMI DHCPv6 Property Enabled
573
574 Set VMI DHCPv6 Property Disabled
575
576 # Verify IPv6 address origin is set to static and DHCPv6 address is erased.
577 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
578 Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
579
580
Megha G N58be5122025-01-16 08:26:53 -0600581Enable VMI SLAAC When DHCPv4 Is Enabled And Verify
582 [Documentation] On VMI enable SLAAC when DHCPv4 is enabled and verify DHCPv4 settings are intact
583 ... and IPv6 origin is set to SLAAC & it gets assigned with SLAAC IPv6 address and this
584 ... works on the setup where router advertise network prefix.
585 [Tags] Enable_VMI_SLAAC_When_DHCPv4_Is_Enabled_And_Verify
586 [Setup] Set VMI IPv4 Origin ${True}
587
588 # Enable Autoconfig address and check whether IPv6 address origin is set to SLAAC.
589 Set VMI SLAACv6 Origin ${True}
590 Verify VMI IPv6 Address SLAAC
591
592 # Check there is no impact on IPv4 settings, IPv4 address origin should be DHCP.
593 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
594
595
Megha G Nf9867142025-02-03 23:10:57 -0600596Disable VMI DHCPv6 Property And Check Persistency On BMC Reboot
597 [Documentation] Disable VMI DHCPv6 property and verify its persistency on
598 ... BMC reboot.
599 [Tags] Disable_VMI_DHCPv6_Property_And_Check_Persistency_On_BMC_Reboot
600 [Setup] Set VMI DHCPv6 Property Enabled
601
602 Set VMI DHCPv6 Property Disabled
603
604 # Reboot BMC and verify persistency.
605 OBMC Reboot (off)
606
607 # Verify IPv6 address origin is set to Static and DHCPv6 address is erased.
608 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
609 Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
610
611
Megha G N95e37d82025-02-06 03:56:04 -0600612Enable VMI SLAAC When IPv4 Origin Is Static And Verify
613 [Documentation] On VMI enable SLAAC when IPv4 origin is static and verify IPv4 settings are intact
614 ... and IPv6 origin is set to SLAAC & it gets assigned with SLAAC IPv6 address and this works
615 ... on the setup where router advertise network prefix.
616 [Tags] Enable_VMI_SLAAC_When_IPv4_Origin_Is_Static_And_Verify
617 [Setup] Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
618 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
619
620 # Enable Autoconfig address and check whether IPv6 address origin is set to SLAAC.
621 Set VMI SLAACv6 Origin ${True}
622 Verify VMI IPv6 Address SLAAC
623
624 # Check there is no impact on IPv4 settings, IPv4 address origin should be Static.
625 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
626
627
Megha G N97af3bf2025-02-27 10:32:08 -0600628Configure Static VMI IPv6 Address And Verify
629 [Documentation] Add static VMI IPv6 address and check whether IPv6 origin is set to static
630 ... and Static IPv6 address is assigned.
631 [Tags] Configure_Static_VMI_IPv6_Address_And_Verify
632
633 Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
634
635 # Verify IPv6 address origin is set to static and static IPv6 address is assigned.
636 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
637 Should Not Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
638 Should Be Equal ${vmi_ipv6addr["PrefixLength"]} ${prefix_length}
639
640
Megha G Ne0e055d2025-02-28 02:16:06 -0600641Configure IPv6 Static Default Gateway On VMI And Verify
642 [Documentation] Configure IPv6 static default gateway on VMI and verify.
643 [Tags] Configure_IPv6_Static_Default_Gateway_On_VMI_And_Verify
644
645 Set VMI IPv6 Static Default Gateway ${test_vmi_ipv6gateway}
646
647 ${resp}= Redfish.Get
648 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
649 ${vmi_ipv6_gateway}= Get From Dictionary ${resp.dict} IPv6StaticDefaultGateways
650 Should Be Equal ${vmi_ipv6_gateway} ${test_vmi_ipv6gateway}
651
652
Megha G Na2148332025-03-06 07:28:15 -0600653Delete VMI Static IPv6 Address And Verify
654 [Documentation] Delete VMI static IPv6 address and verify address is erased.
655 [Tags] Delete_VMI_Static_IPv6_Address_And_Verify
656 [Setup] Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
657
658 # Delete VMI static IPv6 address.
659 Delete VMI IPv6 Static Address
660
661 # Verify VMI static IPv6 address is erased.
662 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
663 Should Not Be Equal ${vmi_ipv6addr["Address"]} ${test_vmi_ipv6addr}
664 Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
665
666
Megha G Nd9ba2b42025-03-07 05:27:10 -0600667Enable VMI DHCPv6 When IPv6 Origin Is Static And Verify
668 [Documentation] Enable VMI DHCPv6 when IPv6 origin is in static and verify
669 ... origin is set to DHCP and check if static IPv6 address is erased.
670 [Tags] Enable_VMI_DHCPv6_When_IPv6_Origin_Is_Static_And_Verify
671
672 Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
673 ${vmi_ipv6addr_static}= Verify VMI IPv6 Address Static
674
675 Sleep 5s
676
677 # Enable DHCPv6 property.
678 Set VMI DHCPv6 Property Enabled
679
680 # Check origin is set to DHCP and static IPv6 address is erased.
681 ${vmi_dhcpv6addr}= Verify VMI IPv6 Address DHCPv6
682 Should Not Be Equal ${vmi_dhcpv6addr["Address"]} ${vmi_ipv6addr_static["Address"]}
683
684
Vijay06a169d2020-04-23 09:28:24 -0500685*** Keywords ***
686
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500687Suite Setup Execution
688 [Documentation] Do test setup execution task.
689
690 Redfish.Login
Megha G Nd0b4da92024-02-08 15:04:24 -0600691
692 Redfish Power Off
693 Set BIOS Attribute pvm_hmc_managed Enabled
Megha G N1e538242024-06-11 03:42:03 -0500694 Set BIOS Attribute pvm_stop_at_standby Disabled
695
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500696 Redfish Power On
Megha G N1e538242024-06-11 03:42:03 -0500697 Wait For Host Boot Progress To Reach Required State
Megha G N86507da2024-02-07 23:16:27 -0600698
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500699 ${active_channel_config}= Get Active Channel Config
700 Set Suite Variable ${active_channel_config}
shrsuman123bfb851b2021-07-02 04:59:16 -0500701 Set Suite Variable ${ethernet_interface} ${active_channel_config['${CHANNEL_NUMBER}']['name']}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500702 ${resp}= Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500703 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
shrsuman12362e5be52021-05-20 02:42:59 -0500704 ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500705 ${length}= Get Length ${ip_resp["IPv4StaticAddresses"]}
706 ${vmi_network_conf}= Run Keyword If ${length} != ${0} Get VMI Network Interface Details
707 Set Suite Variable ${vmi_network_conf}
708
709
710Test Teardown Execution
711 [Documentation] Do test teardown execution task.
712
713 FFDC On Test Case Fail
714 ${curr_mode}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
715 Run Keyword If ${curr_mode} == ${True} Set VMI IPv4 Origin ${False}
Megha G N1e538242024-06-11 03:42:03 -0500716 Run Keyword If '${vmi_network_conf["IPv4_Address"]}' != '${default}'
shrsuman123f559cbe2021-01-06 05:40:45 -0600717 ... Set Static IPv4 Address To VMI And Verify ${vmi_network_conf["IPv4_Address"]}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500718 ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]}
719
720
Vijay06a169d2020-04-23 09:28:24 -0500721Get Immediate Child Parameter From VMI Network Interface
722 [Documentation] Get immediate child parameter from VMI network interface.
723 [Arguments] ${parameter} ${valid_status_code}=${HTTP_OK}
724
725 # Description of argument(s):
726 # parameter parameter for which value is required. Ex: DHCPEnabled, MACAddress etc.
727 # valid_status_code Expected valid status code from GET request.
728
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -0500729 ${resp}= Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500730 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
Vijay06a169d2020-04-23 09:28:24 -0500731 ... valid_status_codes=[${valid_status_code}]
732
shrsuman12362e5be52021-05-20 02:42:59 -0500733 ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json
Vijay06a169d2020-04-23 09:28:24 -0500734 ${value}= Set Variable If '${parameter}' != 'DHCPEnabled' ${ip_resp["${parameter}"]}
735 ... ${ip_resp["DHCPv4"]["${parameter}"]}
736
George Keishing409df052024-01-17 22:36:14 +0530737 RETURN ${value}
Vijay06a169d2020-04-23 09:28:24 -0500738
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600739
Vijay06a169d2020-04-23 09:28:24 -0500740Switch VMI IPv4 Origin And Verify Details
741 [Documentation] Switch VMI IPv4 origin and verify details.
Vijay06a169d2020-04-23 09:28:24 -0500742
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500743 ${dhcp_mode_before}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
Anves Kumar rayankulae7dc89a2021-04-28 04:29:38 -0500744 ${dhcp_enabled}= Set Variable If ${dhcp_mode_before} == ${False} ${True} ${False}
Vijay06a169d2020-04-23 09:28:24 -0500745
Anves Kumar rayankulae7dc89a2021-04-28 04:29:38 -0500746 ${origin}= Set Variable If ${dhcp_mode_before} == ${False} DHCP Static
Vijay06a169d2020-04-23 09:28:24 -0500747 Set VMI IPv4 Origin ${dhcp_enabled} ${HTTP_ACCEPTED}
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500748
749 ${dhcp_mode_after}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
750 Should Not Be Equal ${dhcp_mode_before} ${dhcp_mode_after}
751
752 Run Keyword If ${dhcp_mode_after} == ${True}
753 ... Verify VMI Network Interface Details ${default} ${origin} ${default} ${default}
Vijay06a169d2020-04-23 09:28:24 -0500754
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500755
756Delete VMI Static IP Address Using Different Users
757 [Documentation] Update user role and delete vmi static IP address.
758 [Arguments] ${username} ${password} ${valid_status_code}
759 [Teardown] Run Keywords Redfish.Login AND
shrsuman123f559cbe2021-01-06 05:40:45 -0600760 ... Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500761 ... ${test_netmask} ${HTTP_ACCEPTED} AND Redfish.Logout
762
763 # Description of argument(s):
764 # username The host username.
765 # password The host password.
766 # valid_status_code The expected valid status code.
767
Megha GN80ef5ca2022-06-09 00:29:57 -0500768 # TODO: operator_user role is not yet supported.
769 Skip If '${username}' == 'operator_user'
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500770 Redfish.Login ${username} ${password}
771 Delete VMI IPv4 Address delete_param=IPv4StaticAddresses valid_status_code=${valid_status_code}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500772
773
774Config VMI Static IP Address Using Different Users
775 [Documentation] Update user role and update vmi static ip address.
776 [Arguments] ${username} ${password} ${ip} ${gateway} ${netmask}
777 ... ${valid_status_code}
778
779 # Description of argument(s):
780 # username The host username.
781 # password The host password.
782 # ip IP address to be added (e.g. "10.7.7.7").
783 # subnet_mask Subnet mask for the IP to be added
784 # (e.g. "255.255.0.0").
785 # gateway Gateway for the IP to be added (e.g. "10.7.7.1").
786 # valid_status_code The expected valid status code.
787
Megha GN80ef5ca2022-06-09 00:29:57 -0500788 # TODO: operator_user role is not yet supported.
789 Skip If '${username}' == 'operator_user'
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500790 Redfish.Login ${username} ${password}
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600791 Set Static IPv4 Address To VMI And Verify ${ip} ${gateway} ${netmask} ${valid_status_code}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500792
793
794Read VMI Static IP Address Using Different Users
795 [Documentation] Update user role and read vmi static ip address.
796 [Arguments] ${username} ${password} ${valid_status_code}
797
798 # Description of argument(s):
799 # username The host username.
800 # password The host password.
801 # valid_status_code The expected valid status code.
802
Megha GN80ef5ca2022-06-09 00:29:57 -0500803 # TODO: operator_user role is not yet supported.
804 Skip If '${username}' == 'operator_user'
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500805 Redfish.Login ${username} ${password}
806 Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500807 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500808 ... valid_status_codes=[${valid_status_code}]
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500809
810
811Delete BMC Users Using Redfish
812 [Documentation] Delete BMC users via redfish.
813
814 Redfish.Login
815 Delete BMC Users Via Redfish users=${USERS}
shrsuman123b361d412020-09-30 06:17:23 -0500816
Sweta Potthurid52b2732021-08-12 12:48:24 -0500817
shrsuman123b361d412020-09-30 06:17:23 -0500818Update User Role And Set VMI IPv4 Origin
819 [Documentation] Update User Role And Set VMI IPv4 Origin.
820 [Arguments] ${username} ${password} ${dhcp_enabled} ${valid_status_code}
821
822 # Description of argument(s):
823 # username The host username.
824 # password The host password.
825 # dhcp_enabled Indicates whether dhcp should be enabled
826 # (${True}, ${False}).
827 # valid_status_code The expected valid status code.
828
Megha GNbe428592022-07-21 10:33:02 -0500829 # TODO: operator_user role is not yet supported.
830 Skip If '${username}' == 'operator_user'
shrsuman123b361d412020-09-30 06:17:23 -0500831 Redfish.Login ${username} ${password}
832 Set VMI IPv4 Origin ${dhcp_enabled} ${valid_status_code}
shrsuman123bfb851b2021-07-02 04:59:16 -0500833
Sweta Potthurid52b2732021-08-12 12:48:24 -0500834
shrsuman123bfb851b2021-07-02 04:59:16 -0500835Suite Teardown Execution
836 [Documentation] Do suite teardown execution task.
837
838 Run Keyword If ${vmi_network_conf} != ${None}
839 ... Set Static IPv4 Address To VMI And Verify ${vmi_network_conf["IPv4_Address"]}
840 ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]}
shrsuman123b25343d2021-09-22 04:33:47 -0500841 Delete All Redfish Sessions
shrsuman123bfb851b2021-07-02 04:59:16 -0500842 Redfish.Logout