blob: 1b9f5f0d0965d5775802745f49c8d6ea174eda71 [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
George Keishing725e0662022-07-20 22:18:14 -050011Force Tags vmi_interface_test
12
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}
Prashanth Katti1ce68212020-11-13 00:39:03 -060030${wait_time} 10s
Vijay06a169d2020-04-23 09:28:24 -050031
Megha G N02cbfa12022-12-12 02:05:03 -060032${default} 0.0.0.0
33
Vijay06a169d2020-04-23 09:28:24 -050034
35*** Test Cases ***
36
37Verify All VMI EthernetInterfaces
38 [Documentation] Verify all VMI ethernet interfaces.
shrsuman1235c7e4d72021-04-16 05:42:57 -050039 [Tags] Verify_All_VMI_EthernetInterfaces
Vijay06a169d2020-04-23 09:28:24 -050040
41 Verify VMI EthernetInterfaces
42
43
44Verify Existing VMI Network Interface Details
45 [Documentation] Verify existing VMI network interface details.
shrsuman1235c7e4d72021-04-16 05:42:57 -050046 [Tags] Verify_Existing_VMI_Network_Interface_Details
Vijay06a169d2020-04-23 09:28:24 -050047
48 ${vmi_ip}= Get VMI Network Interface Details
49 ${origin}= Set Variable If ${vmi_ip["DHCPv4"]} == ${False} Static DHCP
Vijay06a169d2020-04-23 09:28:24 -050050 Should Not Be Equal ${vmi_ip["DHCPv4"]} ${vmi_ip["IPv4StaticAddresses"]}
shrsuman123bfb851b2021-07-02 04:59:16 -050051 Should Be Equal As Strings ${vmi_ip["Id"]} ${ethernet_interface}
George Keishingb3ea0952020-07-01 05:03:56 -050052 Should Be Equal As Strings ${vmi_ip["Description"]}
shrsuman1235c7e4d72021-04-16 05:42:57 -050053 ... Hypervisor's Virtual Management Ethernet Interface
54 Should Be Equal As Strings ${vmi_ip["Name"]} Hypervisor Ethernet Interface
Vijay06a169d2020-04-23 09:28:24 -050055 Should Be True ${vmi_ip["InterfaceEnabled"]}
shrsuman1235c7e4d72021-04-16 05:42:57 -050056 Run Keyword If ${vmi_ip["IPv4StaticAddresses"]} != @{empty}
57 ... Verify VMI Network Interface Details ${vmi_ip["IPv4_Address"]}
58 ... ${origin} ${vmi_ip["IPv4_Gateway"]} ${vmi_ip["IPv4_SubnetMask"]}
Vijay06a169d2020-04-23 09:28:24 -050059
60
61Delete Existing Static VMI IP Address
62 [Documentation] Delete existing static VMI IP address.
63 [Tags] Delete_Existing_Static_VMI_IP_Address
64
65 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
66 Run Keyword If ${curr_origin} == ${True} Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED}
67
shrsuman1235c7e4d72021-04-16 05:42:57 -050068 Delete VMI IPv4 Address
Vijay06a169d2020-04-23 09:28:24 -050069
70
71Verify User Cannot Delete ReadOnly Property IPv4Addresses
72 [Documentation] Verify user cannot delete readonly property IPv4Addresses.
73 [Tags] Verify_User_Cannot_Delete_ReadOnly_Property_IPv4Addresses
74
75 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
shrsuman1235c7e4d72021-04-16 05:42:57 -050076 Run Keyword If ${curr_origin} == ${True} Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED}
77 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
shrsuman123b25343d2021-09-22 04:33:47 -050078 Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_FORBIDDEN}
Vijay06a169d2020-04-23 09:28:24 -050079
80
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -050081Assign Valid And Invalid Static IPv4 Address To VMI
Vijay06a169d2020-04-23 09:28:24 -050082 [Documentation] Assign static IPv4 address to VMI.
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -050083 [Tags] Assign_Valid_And_Invalid_Static_IPv4_Address_To_VMI
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -060084 [Template] Set Static IPv4 Address To VMI And Verify
85 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
Vijay06a169d2020-04-23 09:28:24 -050086
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050087 # ip gateway netmask valid_status_code
Shradha Sumanc7df7db2021-03-08 05:16:44 -060088 10.5.20.30 10.5.20.1 255.255.252.0 ${HTTP_ACCEPTED}
89 a.3.118.94 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
Anves Kumar rayankula81fd9db2021-05-10 02:39:51 -050090 10.5.20 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
91 10.5.20.-5 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050092
Vijay06a169d2020-04-23 09:28:24 -050093
George Keishing16b3c7b2021-01-28 09:23:37 -060094Add Multiple IP Addresses On VMI Interface And Verify
95 [Documentation] Add multiple IP addresses on VMI interface and verify.
96 [Tags] Add_Multiple_IP_Addresses_On_VMI_Interface_And_Verify
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -060097 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123e37b0cc2020-09-02 00:33:42 -050098
Shradha Sumanc7df7db2021-03-08 05:16:44 -060099 ${ip1}= Create dictionary Address=10.5.5.10 SubnetMask=255.255.252.0 Gateway=10.5.5.1
100 ${ip2}= Create dictionary Address=10.5.5.11 SubnetMask=255.255.252.0 Gateway=10.5.5.1
101 ${ip3}= Create dictionary Address=10.5.5.12 SubnetMask=255.255.252.0 Gateway=10.5.5.1
shrsuman123e37b0cc2020-09-02 00:33:42 -0500102 ${ips}= Create List ${ip1} ${ip2} ${ip3}
103
shrsuman123bfb851b2021-07-02 04:59:16 -0500104 Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
shrsuman123993a5c92021-04-19 06:40:16 -0500105 ... body={'IPv4StaticAddresses':${ips}} valid_status_codes=[${HTTP_BAD_REQUEST}]
shrsuman123e37b0cc2020-09-02 00:33:42 -0500106
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500107
shrsuman123e37b0cc2020-09-02 00:33:42 -0500108Modify IP Addresses On VMI Interface And Verify
109 [Documentation] Modify IP addresses on VMI interface and verify.
110 [Tags] Modify_IP_Addresses_On_VMI_Interface_And_Verify
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600111 [Template] Set Static IPv4 Address To VMI And Verify
112 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123e37b0cc2020-09-02 00:33:42 -0500113
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500114 # ip gateway netmask valid_status_code
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600115 10.5.5.10 10.5.5.1 255.255.252.0 ${HTTP_ACCEPTED}
116 10.5.5.11 10.5.5.1 255.255.252.0 ${HTTP_ACCEPTED}
Vijay06a169d2020-04-23 09:28:24 -0500117
Megha GN80ef5ca2022-06-09 00:29:57 -0500118
Vijay06a169d2020-04-23 09:28:24 -0500119Switch Between IP Origins On VMI And Verify Details
120 [Documentation] Switch between IP origins on VMI and verify details.
121 [Tags] Switch_Between_IP_Origins_On_VMI_And_Verify_Details
122
123 Switch VMI IPv4 Origin And Verify Details
124 Switch VMI IPv4 Origin And Verify Details
125
126
127Verify Persistency Of VMI IPv4 Details After Host Reboot
128 [Documentation] Verify persistency of VMI IPv4 details after host reboot.
129 [Tags] Verify_Persistency_Of_VMI_IPv4_Details_After_Host_Reboot
130
131 # Verifying persistency of dynamic address.
132 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500133 Redfish Power Off stack_mode=skip
134 Redfish Power On
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500135 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
Vijay06a169d2020-04-23 09:28:24 -0500136
137 # Verifying persistency of static address.
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600138 Switch VMI IPv4 Origin And Verify Details
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500139 Redfish Power Off stack_mode=skip
140 Redfish Power On
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600141 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Vijay06a169d2020-04-23 09:28:24 -0500142
143
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500144Delete VMI Static IP Address And Verify
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500145 [Documentation] Delete VMI static IP address and verify.
146 [Tags] Delete_VMI_Static_IP_Address_And_Verify
147 [Teardown] Test Teardown Execution
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500148
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600149 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
150 Delete VMI IPv4 Address
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500151
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500152
shrsuman123c1d3fe32020-09-08 05:04:07 -0500153Verify Successful VMI IP Static Configuration On HOST Boot After Session Delete
154 [Documentation] Verify VMI IP static Configuration On HOST Boot After session deleted.
155 [Tags] Verify_Successful_VMI_IP_Static_Configuration_On_HOST_Boot_After_Session_Delete
shrsuman123b25343d2021-09-22 04:33:47 -0500156 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123c1d3fe32020-09-08 05:04:07 -0500157
shrsuman12375e77062020-09-18 01:08:45 -0500158 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
shrsuman123c1d3fe32020-09-08 05:04:07 -0500159
160 ${session_info}= Get Redfish Session Info
161 Redfish.Delete ${session_info["location"]}
162
163 # Create a new Redfish session
shrsuman1235c7e4d72021-04-16 05:42:57 -0500164 Redfish.Login
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500165 Redfish Power Off
166 Redfish Power On
shrsuman123c1d3fe32020-09-08 05:04:07 -0500167
168 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
169
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500170
shrsuman123c1d3fe32020-09-08 05:04:07 -0500171Verify Persistency Of VMI DHCP IP Configuration After Multiple HOST Reboots
172 [Documentation] Verify Persistency Of VMI DHCP IP configuration After Multiple HOST Reboots
173 [Tags] Verify_Persistency_Of_VMI_DHCP_IP_Configuration_After_Multiple_HOST_Reboots
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500174 [Teardown] Test Teardown Execution
shrsuman123c1d3fe32020-09-08 05:04:07 -0500175
shrsuman123c1d3fe32020-09-08 05:04:07 -0500176 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
shrsuman123c1d3fe32020-09-08 05:04:07 -0500177 ${vmi_ip_config}= Get VMI Network Interface Details
178 # Verifying persistency of dynamic address after multiple reboots.
shrsuman123f559cbe2021-01-06 05:40:45 -0600179 FOR ${i} IN RANGE ${2}
180 Redfish Power Off
181 Redfish Power On
George Keishing538f1742022-03-14 05:00:55 -0500182 Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]}
183 ... DHCP ${vmi_ip_config["IPv4_Gateway"]} ${vmi_ip_config["IPv4_SubnetMask"]}
shrsuman123f559cbe2021-01-06 05:40:45 -0600184 END
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500185
186
187Enable DHCP When Static IP Configured And Verify Static IP
188 [Documentation] Enable DHCP when static ip configured and verify static ip
George Keishing4203fad2022-01-31 12:22:33 -0600189 [Tags] Enable_DHCP_When_Static_IP_Configured_And_Verify_Static_IP
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600190 [Setup] Redfish Power On
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500191 [Teardown] Test Teardown Execution
192
shrsuman123f559cbe2021-01-06 05:40:45 -0600193 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500194 Set VMI IPv4 Origin ${True}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500195 ${vmi_network_conf}= Get VMI Network Interface Details
196 Should Not Be Equal As Strings ${test_ipv4} ${vmi_network_conf["IPv4_Address"]}
197
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500198
shrsuman123e37b0cc2020-09-02 00:33:42 -0500199Verify VMI Static IP Configuration Persist On BMC Reset Before Host Boot
200 [Documentation] Verify VMI static IP configuration persist on BMC reset.
201 [Tags] Verify_VMI_Static_IP_Configuration_Persist_On_BMC_Reset_Before_Host_Boot
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600202 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
shrsuman123e37b0cc2020-09-02 00:33:42 -0500203
shrsuman12375e77062020-09-18 01:08:45 -0500204 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Megha GNbe428592022-07-21 10:33:02 -0500205 Redfish OBMC Reboot (off) stack_mode=skip
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500206 Redfish Power On
shrsuman123e37b0cc2020-09-02 00:33:42 -0500207 # Verifying the VMI static configuration
208 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
209
Megha GN80ef5ca2022-06-09 00:29:57 -0500210
shrsuman12375e77062020-09-18 01:08:45 -0500211Add Static IP When Host Poweroff And Verify On Poweron
212 [Documentation] Add Static IP When Host Poweroff And Verify on power on
213 [Tags] Add_Static_IP_When_Host_Poweroff_And_Verify_On_Poweron
214 [Setup] Redfish Power Off
215 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
216
217 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
218 Redfish Power On
219 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
220
Megha GN80ef5ca2022-06-09 00:29:57 -0500221
shrsuman12375e77062020-09-18 01:08:45 -0500222Add VMI Static IP When Host Poweroff And Verify Static IP On BMC Reset
223 [Documentation] Add Static IP When Host Poweroff And Verify Static IP On BMC Reset.
224 [Tags] Add_VMI_Static_IP_When_Host_Poweroff_And_Verify_Static_IP_On_BMC_Reset
225 [Setup] Redfish Power Off
226 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
227
228 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Megha GNbe428592022-07-21 10:33:02 -0500229 Redfish OBMC Reboot (off) stack_mode=skip
shrsuman12375e77062020-09-18 01:08:45 -0500230 Redfish Power On
231 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
232
Megha GN80ef5ca2022-06-09 00:29:57 -0500233
shrsuman12375e77062020-09-18 01:08:45 -0500234Enable DHCP When No Static IP Configured And Verify DHCP IP
235 [Documentation] Enable DHCP when no static ip configured and verify dhcp ip
236 [Tags] Enable_DHCP_When_No_Static_IP_Configured_And_Verify_DHCP_IP
237 [Setup] Run Keyword And Ignore Error Delete VMI IPv4 Address
238 [Teardown] Test Teardown Execution
239
240 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
241 Run Keyword If ${curr_origin} == ${False} Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
242 ${vmi_ip_config}= Get VMI Network Interface Details
George Keishing538f1742022-03-14 05:00:55 -0500243 Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]}
244 ... DHCP ${vmi_ip_config["IPv4_Gateway"]} ${vmi_ip_config["IPv4_SubnetMask"]}
shrsuman12375e77062020-09-18 01:08:45 -0500245
Megha GN80ef5ca2022-06-09 00:29:57 -0500246
shrsuman12375e77062020-09-18 01:08:45 -0500247Verify User Cannot Delete VMI DHCP IP Address
248 [Documentation] Verify user cannot delete VMI DHCP IP Address
249 [Tags] Verify_User_Cannot_Delete_VMI_DHCP_IP_Address
250 [Setup] Set VMI IPv4 Origin ${True}
251 [Teardown] Test Teardown Execution
252
shrsuman123b25343d2021-09-22 04:33:47 -0500253 Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_FORBIDDEN}
shrsuman12375e77062020-09-18 01:08:45 -0500254 ${resp}= Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500255 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
shrsuman12375e77062020-09-18 01:08:45 -0500256 Should Not Be Empty ${resp.dict["IPv4Addresses"]}
257
Megha GN80ef5ca2022-06-09 00:29:57 -0500258
shrsuman12375e77062020-09-18 01:08:45 -0500259Enable DHCP When Static IP Configured DHCP Server Unavailable And Verify IP
260 [Documentation] Enable DHCP When Static IP Configured And DHCP Server Unavailable And Verify No IP.
261 [Tags] Enable_DHCP_When_Static_IP_Configured_DHCP_Server_Unavailable_And_Verify_IP
262 [Teardown] Test Teardown Execution
263
264 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
265 Set VMI IPv4 Origin ${True}
shrsuman12375e77062020-09-18 01:08:45 -0500266 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
267
shrsuman123e37b0cc2020-09-02 00:33:42 -0500268
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500269Verify To Configure VMI Static IP Address With Different User Roles
270 [Documentation] Verify to configure vmi static ip address with different user roles.
271 [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Different_User_Roles
272 [Setup] Create Users With Different Roles users=${USERS} force=${True}
273 [Template] Config VMI Static IP Address Using Different Users
274 [Teardown] Delete BMC Users Using Redfish
275
276 # username password ip_address gateway nemask valid_status_code
277 admin_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_ACCEPTED}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500278 readonly_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500279
280
281Verify To Configure VMI Static IP Address With Operator User Role
282 [Documentation] Verify to configure vmi static ip address with operator user role.
283 [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Operator_User_Role
284 [Setup] Create Users With Different Roles users=${USERS} force=${True}
285 [Template] Config VMI Static IP Address Using Different Users
286 [Teardown] Delete BMC Users Using Redfish
287
288 # username password ip_address gateway nemask valid_status_code
289 operator_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500290
291
292Verify To Delete VMI Static IP Address With Different User Roles
293 [Documentation] Verify to delete vmi static IP address with different user roles.
294 [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Different_User_Roles
295 [Setup] Create Users With Different Roles users=${USERS} force=${True}
296 [Template] Delete VMI Static IP Address Using Different Users
297 [Teardown] Delete BMC Users Using Redfish
298
299 # username password valid_status_code
300 admin_user TestPwd123 ${HTTP_ACCEPTED}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500301 readonly_user TestPwd123 ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500302
303
304Verify To Delete VMI Static IP Address With Operator User Role
305 [Documentation] Verify to delete vmi static IP address with operator user role.
306 [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Operator_User_Role
307 [Setup] Create Users With Different Roles users=${USERS} force=${True}
308 [Template] Delete VMI Static IP Address Using Different Users
309 [Teardown] Delete BMC Users Using Redfish
310
311 # username password valid_status_code
312 operator_user TestPwd123 ${HTTP_FORBIDDEN}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500313
314
315Verify To Update VMI Static IP Address With Different User Roles
316 [Documentation] Verify to update vmi static IP address with different user roles.
George Keishing4203fad2022-01-31 12:22:33 -0600317 [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Different_User_Roles
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500318 [Setup] Create Users With Different Roles users=${USERS} force=${True}
319 [Template] Config VMI Static IP Address Using Different Users
320 [Teardown] Delete BMC Users Using Redfish
321
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600322 # username password ip_address gateway netmask valid_status_code
323 admin_user TestPwd123 10.5.10.20 10.5.10.1 255.255.0.0 ${HTTP_ACCEPTED}
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600324 readonly_user TestPwd123 10.5.20.40 10.5.20.1 255.255.0.0 ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500325
326
327Verify To Update VMI Static IP Address With Operator User Role
328 [Documentation] Verify to update vmi static IP address with operator user role.
329 [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Operator_User_Role
330 [Setup] Create Users With Different Roles users=${USERS} force=${True}
331 [Template] Config VMI Static IP Address Using Different Users
332 [Teardown] Delete BMC Users Using Redfish
333
334 # username password ip_address gateway netmask valid_status_code
335 operator_user TestPwd123 10.5.10.30 10.5.10.1 255.255.0.0 ${HTTP_FORBIDDEN}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500336
337
338Verify To Read VMI Network Configuration With Different User Roles
339 [Documentation] Verify to read vmi network configuration with different user roles.
George Keishing4203fad2022-01-31 12:22:33 -0600340 [Tags] Verify_To_Read_VMI_Network_Configuration_With_Different_User_Roles
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500341 [Setup] Create Users With Different Roles users=${USERS} force=${True}
342 [Template] Read VMI Static IP Address Using Different Users
343 [Teardown] Delete BMC Users Using Redfish
344
345 # username password valid_status_code
346 admin_user TestPwd123 ${HTTP_OK}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500347 readonly_user TestPwd123 ${HTTP_OK}
Megha GN80ef5ca2022-06-09 00:29:57 -0500348
349
350Verify To Read VMI Network Configuration With Operator User Role
351 [Documentation] Verify to read vmi network configuration with operator user role.
352 [Tags] Verify_To_Read_VMI_Network_Configuration_With_Operator_User_Role
353 [Setup] Create Users With Different Roles users=${USERS} force=${True}
354 [Template] Read VMI Static IP Address Using Different Users
355 [Teardown] Delete BMC Users Using Redfish
356
357 # username password valid_status_code
358 operator_user TestPwd123 ${HTTP_FORBIDDEN}
359
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500360
shrsuman123b361d412020-09-30 06:17:23 -0500361Enable DHCP On VMI Network Via Different Users Roles And Verify
362 [Documentation] Enable DHCP On VMI Network Via Different Users Roles And Verify.
363 [Tags] Enable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify
364 [Setup] Create Users With Different Roles users=${USERS} force=${True}
365 [Template] Update User Role And Set VMI IPv4 Origin
366 [Teardown] Delete BMC Users Using Redfish
367
368 # username password dhcp_enabled valid_status_code
369 admin_user TestPwd123 ${True} ${HTTP_ACCEPTED}
shrsuman123b361d412020-09-30 06:17:23 -0500370 readonly_user TestPwd123 ${True} ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500371
372
373Enable DHCP On VMI Network Via Operator User Role And Verify
374 [Documentation] Enable DHCP On VMI Network Via Operator User Role And Verify.
375 [Tags] Enable_DHCP_On_VMI_Network_Via_Operator_User_Role_And_Verify
376 [Setup] Create Users With Different Roles users=${USERS} force=${True}
377 [Template] Update User Role And Set VMI IPv4 Origin
378 [Teardown] Delete BMC Users Using Redfish
379
380 # username password dhcp_enabled valid_status_code
381 operator_user TestPwd123 ${True} ${HTTP_FORBIDDEN}
382
shrsuman123b361d412020-09-30 06:17:23 -0500383
384Disable DHCP On VMI Network Via Different Users Roles And Verify
385 [Documentation] Disable DHCP On VMI Network Via Different Users Roles And Verify.
386 [Tags] Disable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify
387 [Setup] Create Users With Different Roles users=${USERS} force=${True}
388 [Template] Update User Role And Set VMI IPv4 Origin
389 [Teardown] Delete BMC Users Using Redfish
390
391 # username password dhcp_enabled valid_status_code
392 admin_user TestPwd123 ${False} ${HTTP_ACCEPTED}
shrsuman123b361d412020-09-30 06:17:23 -0500393 readonly_user TestPwd123 ${False} ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500394
395
396Disable DHCP On VMI Network Via Operator User Role And Verify
397 [Documentation] Disable DHCP On VMI Network Via Operator User Role And Verify.
398 [Tags] Disable_DHCP_On_VMI_Network_Via_Operator_User_Role_And_Verify
399 [Setup] Create Users With Different Roles users=${USERS} force=${True}
400 [Template] Update User Role And Set VMI IPv4 Origin
401 [Teardown] Delete BMC Users Using Redfish
402
403 # username password dhcp_enabled valid_status_code
404 operator_user TestPwd123 ${False} ${HTTP_FORBIDDEN}
shrsuman123b361d412020-09-30 06:17:23 -0500405
shrsuman123e37b0cc2020-09-02 00:33:42 -0500406
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500407Enable And Disable DHCP And Verify
408 [Documentation] verify enable DHCP and disable DHCP.
George Keishing4203fad2022-01-31 12:22:33 -0600409 [Tags] Enable_And_Disable_DHCP_And_Verify
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500410
411 Set VMI IPv4 Origin ${True}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500412 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
413 Set VMI IPv4 Origin ${False}
Megha GN80ef5ca2022-06-09 00:29:57 -0500414 Verify VMI Network Interface Details ${default} Static ${default} ${default}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500415
416
417Multiple Times Enable And Disable DHCP And Verify
418 [Documentation] Enable and Disable DHCP in a loop and verify VMI gets an IP address from DHCP
419 ... each time when DHCP is enabled
420 [Tags] Multiple_Times_Enable_And_Disable_DHCP_And_Verify
421
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500422 FOR ${i} IN RANGE ${2}
423 Set VMI IPv4 Origin ${True}
424 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
425 Set VMI IPv4 Origin ${False}
Megha GN80ef5ca2022-06-09 00:29:57 -0500426 Verify VMI Network Interface Details ${default} Static ${default} ${default}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500427 END
428
429
Anves Kumar rayankula81fd9db2021-05-10 02:39:51 -0500430Assign Static IPv4 Address With Invalid Netmask To VMI
431 [Documentation] Assign static IPv4 address with invalid netmask and expect error.
432 [Tags] Assign_Static_IPv4_Address_With_Invalid_Netmask_To_VMI
433 [Template] Set Static IPv4 Address To VMI And Verify
434
435 # ip gateway netmask valid_status_code
436 ${test_ipv4} ${test_gateway} 255.256.255.0 ${HTTP_BAD_REQUEST}
437 ${test_ipv4} ${test_gateway} ff.ff.ff.ff ${HTTP_BAD_REQUEST}
438 ${test_ipv4} ${test_gateway} 255.255.253.0 ${HTTP_BAD_REQUEST}
439
440
441Assign Static IPv4 Address With Invalid Gateway To VMI
442 [Documentation] Add static IPv4 address with invalid gateway and expect error.
443 [Tags] Assign_Static_IPv4_Address_With_Invalid_Gateway_To_VMI
444 [Template] Set Static IPv4 Address To VMI And Verify
445
446 # ip gateway netmask valid_status_code
447 ${test_ipv4} @@@.%%.44.11 ${test_netmask} ${HTTP_BAD_REQUEST}
448 ${test_ipv4} 0xa.0xb.0xc.0xd ${test_netmask} ${HTTP_BAD_REQUEST}
449 ${test_ipv4} 10.3.36 ${test_netmask} ${HTTP_BAD_REQUEST}
450 ${test_ipv4} 10.3.36.-10 ${test_netmask} ${HTTP_BAD_REQUEST}
451
452
Megha G N02cbfa12022-12-12 02:05:03 -0600453Enable DHCP When Host Is Off And Verify After Poweron
454 [Documentation] Enable DHCP when host is off and
455 ... check whether it is enabled after poweron.
456 [Tags] Enable_DHCP_When_Host_Is_Off_And_Verify_After_Poweron
457 [Setup] Redfish Power Off stack_mode=skip
458
459 Set VMI IPv4 Origin ${True}
460 Redfish Power On stack_mode=skip
461 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
462
463
Vijay06a169d2020-04-23 09:28:24 -0500464*** Keywords ***
465
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500466Suite Setup Execution
467 [Documentation] Do test setup execution task.
468
469 Redfish.Login
470 Redfish Power On
471 ${active_channel_config}= Get Active Channel Config
472 Set Suite Variable ${active_channel_config}
shrsuman123bfb851b2021-07-02 04:59:16 -0500473 Set Suite Variable ${ethernet_interface} ${active_channel_config['${CHANNEL_NUMBER}']['name']}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500474 ${resp}= Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500475 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
shrsuman12362e5be52021-05-20 02:42:59 -0500476 ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500477 ${length}= Get Length ${ip_resp["IPv4StaticAddresses"]}
478 ${vmi_network_conf}= Run Keyword If ${length} != ${0} Get VMI Network Interface Details
479 Set Suite Variable ${vmi_network_conf}
480
481
482Test Teardown Execution
483 [Documentation] Do test teardown execution task.
484
485 FFDC On Test Case Fail
486 ${curr_mode}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
487 Run Keyword If ${curr_mode} == ${True} Set VMI IPv4 Origin ${False}
488 Run Keyword If ${vmi_network_conf} != ${None}
shrsuman123f559cbe2021-01-06 05:40:45 -0600489 ... Set Static IPv4 Address To VMI And Verify ${vmi_network_conf["IPv4_Address"]}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500490 ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]}
491
492
Vijay06a169d2020-04-23 09:28:24 -0500493Get Immediate Child Parameter From VMI Network Interface
494 [Documentation] Get immediate child parameter from VMI network interface.
495 [Arguments] ${parameter} ${valid_status_code}=${HTTP_OK}
496
497 # Description of argument(s):
498 # parameter parameter for which value is required. Ex: DHCPEnabled, MACAddress etc.
499 # valid_status_code Expected valid status code from GET request.
500
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -0500501 ${resp}= Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500502 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
Vijay06a169d2020-04-23 09:28:24 -0500503 ... valid_status_codes=[${valid_status_code}]
504
shrsuman12362e5be52021-05-20 02:42:59 -0500505 ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json
Vijay06a169d2020-04-23 09:28:24 -0500506 ${value}= Set Variable If '${parameter}' != 'DHCPEnabled' ${ip_resp["${parameter}"]}
507 ... ${ip_resp["DHCPv4"]["${parameter}"]}
508
509 [Return] ${value}
510
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600511
Vijay06a169d2020-04-23 09:28:24 -0500512Switch VMI IPv4 Origin And Verify Details
513 [Documentation] Switch VMI IPv4 origin and verify details.
Vijay06a169d2020-04-23 09:28:24 -0500514
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500515 ${dhcp_mode_before}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
Anves Kumar rayankulae7dc89a2021-04-28 04:29:38 -0500516 ${dhcp_enabled}= Set Variable If ${dhcp_mode_before} == ${False} ${True} ${False}
Vijay06a169d2020-04-23 09:28:24 -0500517
Anves Kumar rayankulae7dc89a2021-04-28 04:29:38 -0500518 ${origin}= Set Variable If ${dhcp_mode_before} == ${False} DHCP Static
Vijay06a169d2020-04-23 09:28:24 -0500519 Set VMI IPv4 Origin ${dhcp_enabled} ${HTTP_ACCEPTED}
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500520
521 ${dhcp_mode_after}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
522 Should Not Be Equal ${dhcp_mode_before} ${dhcp_mode_after}
523
524 Run Keyword If ${dhcp_mode_after} == ${True}
525 ... Verify VMI Network Interface Details ${default} ${origin} ${default} ${default}
Vijay06a169d2020-04-23 09:28:24 -0500526
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500527
528Delete VMI Static IP Address Using Different Users
529 [Documentation] Update user role and delete vmi static IP address.
530 [Arguments] ${username} ${password} ${valid_status_code}
531 [Teardown] Run Keywords Redfish.Login AND
shrsuman123f559cbe2021-01-06 05:40:45 -0600532 ... Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500533 ... ${test_netmask} ${HTTP_ACCEPTED} AND Redfish.Logout
534
535 # Description of argument(s):
536 # username The host username.
537 # password The host password.
538 # valid_status_code The expected valid status code.
539
Megha GN80ef5ca2022-06-09 00:29:57 -0500540 # TODO: operator_user role is not yet supported.
541 Skip If '${username}' == 'operator_user'
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500542 Redfish.Login ${username} ${password}
543 Delete VMI IPv4 Address delete_param=IPv4StaticAddresses valid_status_code=${valid_status_code}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500544
545
546Config VMI Static IP Address Using Different Users
547 [Documentation] Update user role and update vmi static ip address.
548 [Arguments] ${username} ${password} ${ip} ${gateway} ${netmask}
549 ... ${valid_status_code}
550
551 # Description of argument(s):
552 # username The host username.
553 # password The host password.
554 # ip IP address to be added (e.g. "10.7.7.7").
555 # subnet_mask Subnet mask for the IP to be added
556 # (e.g. "255.255.0.0").
557 # gateway Gateway for the IP to be added (e.g. "10.7.7.1").
558 # valid_status_code The expected valid status code.
559
Megha GN80ef5ca2022-06-09 00:29:57 -0500560 # TODO: operator_user role is not yet supported.
561 Skip If '${username}' == 'operator_user'
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500562 Redfish.Login ${username} ${password}
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600563 Set Static IPv4 Address To VMI And Verify ${ip} ${gateway} ${netmask} ${valid_status_code}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500564
565
566Read VMI Static IP Address Using Different Users
567 [Documentation] Update user role and read vmi static ip address.
568 [Arguments] ${username} ${password} ${valid_status_code}
569
570 # Description of argument(s):
571 # username The host username.
572 # password The host password.
573 # valid_status_code The expected valid status code.
574
Megha GN80ef5ca2022-06-09 00:29:57 -0500575 # TODO: operator_user role is not yet supported.
576 Skip If '${username}' == 'operator_user'
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500577 Redfish.Login ${username} ${password}
578 Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500579 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500580 ... valid_status_codes=[${valid_status_code}]
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500581
582
583Delete BMC Users Using Redfish
584 [Documentation] Delete BMC users via redfish.
585
586 Redfish.Login
587 Delete BMC Users Via Redfish users=${USERS}
shrsuman123b361d412020-09-30 06:17:23 -0500588
Sweta Potthurid52b2732021-08-12 12:48:24 -0500589
shrsuman123b361d412020-09-30 06:17:23 -0500590Update User Role And Set VMI IPv4 Origin
591 [Documentation] Update User Role And Set VMI IPv4 Origin.
592 [Arguments] ${username} ${password} ${dhcp_enabled} ${valid_status_code}
593
594 # Description of argument(s):
595 # username The host username.
596 # password The host password.
597 # dhcp_enabled Indicates whether dhcp should be enabled
598 # (${True}, ${False}).
599 # valid_status_code The expected valid status code.
600
Megha GNbe428592022-07-21 10:33:02 -0500601 # TODO: operator_user role is not yet supported.
602 Skip If '${username}' == 'operator_user'
shrsuman123b361d412020-09-30 06:17:23 -0500603 Redfish.Login ${username} ${password}
604 Set VMI IPv4 Origin ${dhcp_enabled} ${valid_status_code}
shrsuman123bfb851b2021-07-02 04:59:16 -0500605
Sweta Potthurid52b2732021-08-12 12:48:24 -0500606
shrsuman123bfb851b2021-07-02 04:59:16 -0500607Suite Teardown Execution
608 [Documentation] Do suite teardown execution task.
609
610 Run Keyword If ${vmi_network_conf} != ${None}
611 ... Set Static IPv4 Address To VMI And Verify ${vmi_network_conf["IPv4_Address"]}
612 ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]}
shrsuman123b25343d2021-09-22 04:33:47 -0500613 Delete All Redfish Sessions
shrsuman123bfb851b2021-07-02 04:59:16 -0500614 Redfish.Logout