blob: 4cc383e68256929b5fc7344d763691bdd58fcede [file] [log] [blame]
Vijay06a169d2020-04-23 09:28:24 -05001*** Settings ***
2
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -05003Documentation VMI static/dynamic IP config tests.
Vijay06a169d2020-04-23 09:28:24 -05004
5Resource ../../lib/resource.robot
6Resource ../../lib/bmc_redfish_resource.robot
7Resource ../../lib/openbmc_ffdc.robot
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -05008Resource ../../lib/bmc_redfish_utils.robot
shrsuman12375e77062020-09-18 01:08:45 -05009Resource ../../lib/state_manager.robot
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -050010Library ../../lib/bmc_network_utils.py
Vijay06a169d2020-04-23 09:28:24 -050011
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050012Suite Setup Suite Setup Execution
Vijay06a169d2020-04-23 09:28:24 -050013Test Teardown FFDC On Test Case Fail
14Suite Teardown Redfish.Logout
15
16*** Variables ***
17
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -050018# users User Name password
19@{ADMIN} admin_user TestPwd123
20@{OPERATOR} operator_user TestPwd123
21@{ReadOnly} readonly_user TestPwd123
22@{NoAccess} noaccess_user TestPwd123
23&{USERS} Administrator=${ADMIN} Operator=${OPERATOR} ReadOnly=${ReadOnly}
24... NoAccess=${NoAccess}
25
Prashanth Katti1ce68212020-11-13 00:39:03 -060026${test_ipv4} 10.6.6.6
27${test_gateway} 10.6.6.1
shrsuman123c1d3fe32020-09-08 05:04:07 -050028${test_netmask} 255.255.252.0
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050029
Vijay06a169d2020-04-23 09:28:24 -050030&{DHCP_ENABLED} DHCPEnabled=${${True}}
31&{DHCP_DISABLED} DHCPEnabled=${${False}}
32
33&{ENABLE_DHCP} DHCPv4=&{DHCP_ENABLED}
34&{DISABLE_DHCP} DHCPv4=&{DHCP_DISABLED}
Prashanth Katti1ce68212020-11-13 00:39:03 -060035${wait_time} 10s
Vijay06a169d2020-04-23 09:28:24 -050036
37
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"]}
shrsuman1235c7e4d72021-04-16 05:42:57 -050054 Should Be Equal As Strings ${vmi_ip["Id"]} eth0
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
Vijay06a169d2020-04-23 09:28:24 -050058 Should Be True ${vmi_ip["InterfaceEnabled"]}
shrsuman1235c7e4d72021-04-16 05:42:57 -050059 Run Keyword If ${vmi_ip["IPv4StaticAddresses"]} != @{empty}
60 ... Verify VMI Network Interface Details ${vmi_ip["IPv4_Address"]}
61 ... ${origin} ${vmi_ip["IPv4_Gateway"]} ${vmi_ip["IPv4_SubnetMask"]}
Vijay06a169d2020-04-23 09:28:24 -050062
63
64Delete Existing Static VMI IP Address
65 [Documentation] Delete existing static VMI IP address.
66 [Tags] Delete_Existing_Static_VMI_IP_Address
67
68 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
69 Run Keyword If ${curr_origin} == ${True} Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED}
70
shrsuman1235c7e4d72021-04-16 05:42:57 -050071 Delete VMI IPv4 Address
Vijay06a169d2020-04-23 09:28:24 -050072
73
74Verify User Cannot Delete ReadOnly Property IPv4Addresses
75 [Documentation] Verify user cannot delete readonly property IPv4Addresses.
76 [Tags] Verify_User_Cannot_Delete_ReadOnly_Property_IPv4Addresses
77
78 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
shrsuman1235c7e4d72021-04-16 05:42:57 -050079 Run Keyword If ${curr_origin} == ${True} Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED}
80 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Vijay06a169d2020-04-23 09:28:24 -050081 Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_BAD_REQUEST}
82
83
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -050084Assign Valid And Invalid Static IPv4 Address To VMI
Vijay06a169d2020-04-23 09:28:24 -050085 [Documentation] Assign static IPv4 address to VMI.
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -050086 [Tags] Assign_Valid_And_Invalid_Static_IPv4_Address_To_VMI
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -060087 [Template] Set Static IPv4 Address To VMI And Verify
88 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
Vijay06a169d2020-04-23 09:28:24 -050089
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050090 # ip gateway netmask valid_status_code
Shradha Sumanc7df7db2021-03-08 05:16:44 -060091 10.5.20.30 10.5.20.1 255.255.252.0 ${HTTP_ACCEPTED}
92 a.3.118.94 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
Anves Kumar rayankula81fd9db2021-05-10 02:39:51 -050093 10.5.20 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
94 10.5.20.-5 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050095
Vijay06a169d2020-04-23 09:28:24 -050096
George Keishing16b3c7b2021-01-28 09:23:37 -060097Add Multiple IP Addresses On VMI Interface And Verify
98 [Documentation] Add multiple IP addresses on VMI interface and verify.
99 [Tags] Add_Multiple_IP_Addresses_On_VMI_Interface_And_Verify
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600100 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123e37b0cc2020-09-02 00:33:42 -0500101
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600102 ${ip1}= Create dictionary Address=10.5.5.10 SubnetMask=255.255.252.0 Gateway=10.5.5.1
103 ${ip2}= Create dictionary Address=10.5.5.11 SubnetMask=255.255.252.0 Gateway=10.5.5.1
104 ${ip3}= Create dictionary Address=10.5.5.12 SubnetMask=255.255.252.0 Gateway=10.5.5.1
shrsuman123e37b0cc2020-09-02 00:33:42 -0500105 ${ips}= Create List ${ip1} ${ip2} ${ip3}
106
shrsuman123e37b0cc2020-09-02 00:33:42 -0500107 Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']}
shrsuman123993a5c92021-04-19 06:40:16 -0500108 ... body={'IPv4StaticAddresses':${ips}} valid_status_codes=[${HTTP_BAD_REQUEST}]
shrsuman123e37b0cc2020-09-02 00:33:42 -0500109
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500110
shrsuman123e37b0cc2020-09-02 00:33:42 -0500111Modify IP Addresses On VMI Interface And Verify
112 [Documentation] Modify IP addresses on VMI interface and verify.
113 [Tags] Modify_IP_Addresses_On_VMI_Interface_And_Verify
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600114 [Template] Set Static IPv4 Address To VMI And Verify
115 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123e37b0cc2020-09-02 00:33:42 -0500116
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500117 # ip gateway netmask valid_status_code
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600118 10.5.5.10 10.5.5.1 255.255.252.0 ${HTTP_ACCEPTED}
119 10.5.5.11 10.5.5.1 255.255.252.0 ${HTTP_ACCEPTED}
Vijay06a169d2020-04-23 09:28:24 -0500120
121Switch 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
Vijay06a169d2020-04-23 09:28:24 -0500137 ${default}= Set Variable 0.0.0.0
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500138 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
Vijay06a169d2020-04-23 09:28:24 -0500139
140 # Verifying persistency of static address.
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600141 Switch VMI IPv4 Origin And Verify Details
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500142 Redfish Power Off stack_mode=skip
143 Redfish Power On
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600144 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Vijay06a169d2020-04-23 09:28:24 -0500145
146
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500147Delete VMI Static IP Address And Verify
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500148 [Documentation] Delete VMI static IP address and verify.
149 [Tags] Delete_VMI_Static_IP_Address_And_Verify
150 [Teardown] Test Teardown Execution
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500151
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600152 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
153 Delete VMI IPv4 Address
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500154 ${resp}= Redfish.Get
155 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']}
156 Should Be Empty ${resp.dict["IPv4Addresses"]}
157
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500158
shrsuman123c1d3fe32020-09-08 05:04:07 -0500159Verify Successful VMI IP Static Configuration On HOST Boot After Session Delete
160 [Documentation] Verify VMI IP static Configuration On HOST Boot After session deleted.
161 [Tags] Verify_Successful_VMI_IP_Static_Configuration_On_HOST_Boot_After_Session_Delete
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500162 [Teardown] Run keywords Delete VMI IPv4 Address IPv4Addresses AND Test Teardown Execution
shrsuman123c1d3fe32020-09-08 05:04:07 -0500163
shrsuman12375e77062020-09-18 01:08:45 -0500164 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
shrsuman123c1d3fe32020-09-08 05:04:07 -0500165
166 ${session_info}= Get Redfish Session Info
167 Redfish.Delete ${session_info["location"]}
168
169 # Create a new Redfish session
shrsuman1235c7e4d72021-04-16 05:42:57 -0500170 Redfish.Login
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500171 Redfish Power Off
172 Redfish Power On
shrsuman123c1d3fe32020-09-08 05:04:07 -0500173
174 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
175
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500176
shrsuman123c1d3fe32020-09-08 05:04:07 -0500177Verify Persistency Of VMI DHCP IP Configuration After Multiple HOST Reboots
178 [Documentation] Verify Persistency Of VMI DHCP IP configuration After Multiple HOST Reboots
179 [Tags] Verify_Persistency_Of_VMI_DHCP_IP_Configuration_After_Multiple_HOST_Reboots
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500180 [Teardown] Test Teardown Execution
shrsuman123c1d3fe32020-09-08 05:04:07 -0500181
shrsuman123c1d3fe32020-09-08 05:04:07 -0500182 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
shrsuman123c1d3fe32020-09-08 05:04:07 -0500183 ${vmi_ip_config}= Get VMI Network Interface Details
184 # Verifying persistency of dynamic address after multiple reboots.
shrsuman123f559cbe2021-01-06 05:40:45 -0600185 FOR ${i} IN RANGE ${2}
186 Redfish Power Off
187 Redfish Power On
188 Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]} DHCP ${vmi_ip_config["IPv4_Gateway"]}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500189 ... ${vmi_ip_config["IPv4_SubnetMask"]}
shrsuman123f559cbe2021-01-06 05:40:45 -0600190 END
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500191
192
193Enable DHCP When Static IP Configured And Verify Static IP
194 [Documentation] Enable DHCP when static ip configured and verify static ip
195 [Tags] Enable_DHCP_when_Static_IP_Configured_And_Verify_Static_IP
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600196 [Setup] Redfish Power On
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500197 [Teardown] Test Teardown Execution
198
shrsuman123f559cbe2021-01-06 05:40:45 -0600199 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500200 Set VMI IPv4 Origin ${True}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500201 ${vmi_network_conf}= Get VMI Network Interface Details
202 Should Not Be Equal As Strings ${test_ipv4} ${vmi_network_conf["IPv4_Address"]}
203
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500204
shrsuman123e37b0cc2020-09-02 00:33:42 -0500205Verify VMI Static IP Configuration Persist On BMC Reset Before Host Boot
206 [Documentation] Verify VMI static IP configuration persist on BMC reset.
207 [Tags] Verify_VMI_Static_IP_Configuration_Persist_On_BMC_Reset_Before_Host_Boot
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600208 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
shrsuman123e37b0cc2020-09-02 00:33:42 -0500209
shrsuman12375e77062020-09-18 01:08:45 -0500210 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500211 OBMC Reboot (off)
212 Redfish Power On
shrsuman123e37b0cc2020-09-02 00:33:42 -0500213 # Verifying the VMI static configuration
214 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
215
shrsuman12375e77062020-09-18 01:08:45 -0500216Add Static IP When Host Poweroff And Verify On Poweron
217 [Documentation] Add Static IP When Host Poweroff And Verify on power on
218 [Tags] Add_Static_IP_When_Host_Poweroff_And_Verify_On_Poweron
219 [Setup] Redfish Power Off
220 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
221
222 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
223 Redfish Power On
224 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
225
226Add VMI Static IP When Host Poweroff And Verify Static IP On BMC Reset
227 [Documentation] Add Static IP When Host Poweroff And Verify Static IP On BMC Reset.
228 [Tags] Add_VMI_Static_IP_When_Host_Poweroff_And_Verify_Static_IP_On_BMC_Reset
229 [Setup] Redfish Power Off
230 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
231
232 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
233 OBMC Reboot (off)
234 Redfish Power On
235 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
236
237Enable DHCP When No Static IP Configured And Verify DHCP IP
238 [Documentation] Enable DHCP when no static ip configured and verify dhcp ip
239 [Tags] Enable_DHCP_When_No_Static_IP_Configured_And_Verify_DHCP_IP
240 [Setup] Run Keyword And Ignore Error Delete VMI IPv4 Address
241 [Teardown] Test Teardown Execution
242
243 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
244 Run Keyword If ${curr_origin} == ${False} Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
245 ${vmi_ip_config}= Get VMI Network Interface Details
246 Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]} DHCP ${vmi_ip_config["IPv4_Gateway"]}
247 ... ${vmi_ip_config["IPv4_SubnetMask"]}
248
249Verify 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
255 Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_BAD_REQUEST}
256 ${active_channel_config}= Get Active Channel Config
257 ${resp}= Redfish.Get
258 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']}
259 Should Not Be Empty ${resp.dict["IPv4Addresses"]}
260
261Enable 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}
268 ${default}= Set Variable 0.0.0.0
269 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
270
shrsuman123e37b0cc2020-09-02 00:33:42 -0500271
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500272Verify To Configure VMI Static IP Address With Different User Roles
273 [Documentation] Verify to configure vmi static ip address with different user roles.
274 [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Different_User_Roles
275 [Setup] Create Users With Different Roles users=${USERS} force=${True}
276 [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}
281 operator_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN}
282 readonly_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN}
283 noaccess_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN}
284
285
286Verify To Delete VMI Static IP Address With Different User Roles
287 [Documentation] Verify to delete vmi static IP address with different user roles.
288 [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Different_User_Roles
289 [Setup] Create Users With Different Roles users=${USERS} force=${True}
290 [Template] Delete VMI Static IP Address Using Different Users
291 [Teardown] Delete BMC Users Using Redfish
292
293 # username password valid_status_code
294 admin_user TestPwd123 ${HTTP_ACCEPTED}
295 operator_user TestPwd123 ${HTTP_FORBIDDEN}
296 readonly_user TestPwd123 ${HTTP_FORBIDDEN}
297 noaccess_user TestPwd123 ${HTTP_FORBIDDEN}
298
299
300Verify To Update VMI Static IP Address With Different User Roles
301 [Documentation] Verify to update vmi static IP address with different user roles.
302 [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Different_User_Roles_And_Verify
303 [Setup] Create Users With Different Roles users=${USERS} force=${True}
304 [Template] Config VMI Static IP Address Using Different Users
305 [Teardown] Delete BMC Users Using Redfish
306
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600307 # username password ip_address gateway netmask valid_status_code
308 admin_user TestPwd123 10.5.10.20 10.5.10.1 255.255.0.0 ${HTTP_ACCEPTED}
309 operator_user TestPwd123 10.5.10.30 10.5.10.1 255.255.0.0 ${HTTP_FORBIDDEN}
310 readonly_user TestPwd123 10.5.20.40 10.5.20.1 255.255.0.0 ${HTTP_FORBIDDEN}
311 noaccess_user TestPwd123 10.5.30.50 10.5.30.1 255.255.0.0 ${HTTP_FORBIDDEN}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500312
313
314Verify To Read VMI Network Configuration With Different User Roles
315 [Documentation] Verify to read vmi network configuration with different user roles.
316 [Tags] Verify_To_Read_VMI_Network_Configuration_Via_Different_User_Roles
317 [Setup] Create Users With Different Roles users=${USERS} force=${True}
318 [Template] Read VMI Static IP Address Using Different Users
319 [Teardown] Delete BMC Users Using Redfish
320
321 # username password valid_status_code
322 admin_user TestPwd123 ${HTTP_OK}
323 operator_user TestPwd123 ${HTTP_OK}
324 readonly_user TestPwd123 ${HTTP_OK}
325 noaccess_user TestPwd123 ${HTTP_FORBIDDEN}
326
shrsuman123b361d412020-09-30 06:17:23 -0500327Enable DHCP On VMI Network Via Different Users Roles And Verify
328 [Documentation] Enable DHCP On VMI Network Via Different Users Roles And Verify.
329 [Tags] Enable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify
330 [Setup] Create Users With Different Roles users=${USERS} force=${True}
331 [Template] Update User Role And Set VMI IPv4 Origin
332 [Teardown] Delete BMC Users Using Redfish
333
334 # username password dhcp_enabled valid_status_code
335 admin_user TestPwd123 ${True} ${HTTP_ACCEPTED}
336 operator_user TestPwd123 ${True} ${HTTP_FORBIDDEN}
337 readonly_user TestPwd123 ${True} ${HTTP_FORBIDDEN}
338 noaccess_user TestPwd123 ${True} ${HTTP_FORBIDDEN}
339
340Disable DHCP On VMI Network Via Different Users Roles And Verify
341 [Documentation] Disable DHCP On VMI Network Via Different Users Roles And Verify.
342 [Tags] Disable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify
343 [Setup] Create Users With Different Roles users=${USERS} force=${True}
344 [Template] Update User Role And Set VMI IPv4 Origin
345 [Teardown] Delete BMC Users Using Redfish
346
347 # username password dhcp_enabled valid_status_code
348 admin_user TestPwd123 ${False} ${HTTP_ACCEPTED}
349 operator_user TestPwd123 ${False} ${HTTP_FORBIDDEN}
350 readonly_user TestPwd123 ${False} ${HTTP_FORBIDDEN}
351 noaccess_user TestPwd123 ${False} ${HTTP_FORBIDDEN}
352
shrsuman123e37b0cc2020-09-02 00:33:42 -0500353
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500354Enable And Disable DHCP And Verify
355 [Documentation] verify enable DHCP and disable DHCP.
356 [Tags] Enabled_And_Disabled_DHCP_Verify
357
358 Set VMI IPv4 Origin ${True}
359 ${default}= Set Variable 0.0.0.0
360 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
361 Set VMI IPv4 Origin ${False}
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500362 ${vmi_ip}= Get VMI Network Interface Details
363 Should Be Empty ${vmi_ip["IPv4_Address"]}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500364
365
366Multiple Times Enable And Disable DHCP And Verify
367 [Documentation] Enable and Disable DHCP in a loop and verify VMI gets an IP address from DHCP
368 ... each time when DHCP is enabled
369 [Tags] Multiple_Times_Enable_And_Disable_DHCP_And_Verify
370
371 ${default}= Set Variable 0.0.0.0
372 FOR ${i} IN RANGE ${2}
373 Set VMI IPv4 Origin ${True}
374 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
375 Set VMI IPv4 Origin ${False}
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500376 ${vmi_ip}= Get VMI Network Interface Details
377 Should Be Empty ${vmi_ip["IPv4_Address"]}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500378 END
379
380
Anves Kumar rayankula81fd9db2021-05-10 02:39:51 -0500381Assign Static IPv4 Address With Invalid Netmask To VMI
382 [Documentation] Assign static IPv4 address with invalid netmask and expect error.
383 [Tags] Assign_Static_IPv4_Address_With_Invalid_Netmask_To_VMI
384 [Template] Set Static IPv4 Address To VMI And Verify
385
386 # ip gateway netmask valid_status_code
387 ${test_ipv4} ${test_gateway} 255.256.255.0 ${HTTP_BAD_REQUEST}
388 ${test_ipv4} ${test_gateway} ff.ff.ff.ff ${HTTP_BAD_REQUEST}
389 ${test_ipv4} ${test_gateway} 255.255.253.0 ${HTTP_BAD_REQUEST}
390
391
392Assign Static IPv4 Address With Invalid Gateway To VMI
393 [Documentation] Add static IPv4 address with invalid gateway and expect error.
394 [Tags] Assign_Static_IPv4_Address_With_Invalid_Gateway_To_VMI
395 [Template] Set Static IPv4 Address To VMI And Verify
396
397 # ip gateway netmask valid_status_code
398 ${test_ipv4} @@@.%%.44.11 ${test_netmask} ${HTTP_BAD_REQUEST}
399 ${test_ipv4} 0xa.0xb.0xc.0xd ${test_netmask} ${HTTP_BAD_REQUEST}
400 ${test_ipv4} 10.3.36 ${test_netmask} ${HTTP_BAD_REQUEST}
401 ${test_ipv4} 10.3.36.-10 ${test_netmask} ${HTTP_BAD_REQUEST}
402
403
Vijay06a169d2020-04-23 09:28:24 -0500404*** Keywords ***
405
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500406Suite Setup Execution
407 [Documentation] Do test setup execution task.
408
409 Redfish.Login
410 Redfish Power On
411 ${active_channel_config}= Get Active Channel Config
412 Set Suite Variable ${active_channel_config}
413 ${resp}= Redfish.Get
414 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']}
shrsuman12362e5be52021-05-20 02:42:59 -0500415 ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500416 ${length}= Get Length ${ip_resp["IPv4StaticAddresses"]}
417 ${vmi_network_conf}= Run Keyword If ${length} != ${0} Get VMI Network Interface Details
418 Set Suite Variable ${vmi_network_conf}
419
420
421Test Teardown Execution
422 [Documentation] Do test teardown execution task.
423
424 FFDC On Test Case Fail
425 ${curr_mode}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
426 Run Keyword If ${curr_mode} == ${True} Set VMI IPv4 Origin ${False}
427 Run Keyword If ${vmi_network_conf} != ${None}
shrsuman123f559cbe2021-01-06 05:40:45 -0600428 ... Set Static IPv4 Address To VMI And Verify ${vmi_network_conf["IPv4_Address"]}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500429 ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]}
430
431
Vijay06a169d2020-04-23 09:28:24 -0500432Get VMI Network Interface Details
433 [Documentation] Get VMI network interface details.
434 [Arguments] ${valid_status_code}=${HTTP_OK}
435
436 # Description of argument(s):
437 # valid_status_code Expected valid status code from GET request.
438
Anves Kumar rayankulaaa33b052020-07-22 04:24:51 -0500439 # Note: It returns a dictionary of VMI eth0 parameters.
Vijay06a169d2020-04-23 09:28:24 -0500440
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -0500441 ${active_channel_config}= Get Active Channel Config
442 ${resp}= Redfish.Get
443 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']}
Vijay06a169d2020-04-23 09:28:24 -0500444 ... valid_status_codes=[${valid_status_code}]
445
shrsuman12362e5be52021-05-20 02:42:59 -0500446 ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json
Vijay06a169d2020-04-23 09:28:24 -0500447
shrsuman1235c7e4d72021-04-16 05:42:57 -0500448 ${ip_exists}= Set Variable If ${ip_resp["IPv4Addresses"]} == @{empty} ${False} ${True}
449 ${static_exists}= Set Variable If ${ip_resp["IPv4StaticAddresses"]} == @{empty} ${False} ${True}
Vijay06a169d2020-04-23 09:28:24 -0500450
shrsuman1235c7e4d72021-04-16 05:42:57 -0500451 ${vmi_ip}= Run Keyword If ${ip_exists} == ${True}
452 ... Create Dictionary DHCPv4=${${ip_resp["DHCPv4"]["DHCPEnabled"]}} Id=${ip_resp["Id"]}
Vijay06a169d2020-04-23 09:28:24 -0500453 ... Description=${ip_resp["Description"]} IPv4_Address=${ip_resp["IPv4Addresses"][0]["Address"]}
454 ... IPv4_AddressOrigin=${ip_resp["IPv4Addresses"][0]["AddressOrigin"]} Name=${ip_resp["Name"]}
Sushil Singh810234d2020-05-13 12:12:03 -0500455 ... IPv4_Gateway=${ip_resp["IPv4Addresses"][0]["Gateway"]}
456 ... InterfaceEnabled=${${ip_resp["InterfaceEnabled"]}}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500457 ... IPv4_SubnetMask=${ip_resp["IPv4Addresses"][0]["SubnetMask"]}
Vijay06a169d2020-04-23 09:28:24 -0500458 ... IPv4StaticAddresses=${${static_exists}}
shrsuman1235c7e4d72021-04-16 05:42:57 -0500459 ... ELSE
460 ... Create Dictionary DHCPv4=${${ip_resp["DHCPv4"]["DHCPEnabled"]}} Id=${ip_resp["Id"]}
461 ... Description=${ip_resp["Description"]} IPv4StaticAddresses=${ip_resp["IPv4StaticAddresses"]}
462 ... IPv4_Address=${ip_resp["IPv4Addresses"]} Name=${ip_resp["Name"]}
463 ... InterfaceEnabled=${${ip_resp["InterfaceEnabled"]}}
Vijay06a169d2020-04-23 09:28:24 -0500464
465 [Return] &{vmi_ip}
466
467
468Get Immediate Child Parameter From VMI Network Interface
469 [Documentation] Get immediate child parameter from VMI network interface.
470 [Arguments] ${parameter} ${valid_status_code}=${HTTP_OK}
471
472 # Description of argument(s):
473 # parameter parameter for which value is required. Ex: DHCPEnabled, MACAddress etc.
474 # valid_status_code Expected valid status code from GET request.
475
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -0500476 ${active_channel_config}= Get Active Channel Config
477 ${resp}= Redfish.Get
478 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']}
Vijay06a169d2020-04-23 09:28:24 -0500479 ... valid_status_codes=[${valid_status_code}]
480
shrsuman12362e5be52021-05-20 02:42:59 -0500481 ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json
Vijay06a169d2020-04-23 09:28:24 -0500482 ${value}= Set Variable If '${parameter}' != 'DHCPEnabled' ${ip_resp["${parameter}"]}
483 ... ${ip_resp["DHCPv4"]["${parameter}"]}
484
485 [Return] ${value}
486
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600487
Vijay06a169d2020-04-23 09:28:24 -0500488Verify VMI EthernetInterfaces
489 [Documentation] Verify VMI ethernet interfaces.
490 [Arguments] ${valid_status_code}=${HTTP_OK}
491
492 # Description of argument(s):
493 # valid_status_code Expected valid status code from GET request.
494
495 ${resp}= Redfish.Get /redfish/v1/Systems/hypervisor/EthernetInterfaces
496 ... valid_status_codes=[${valid_status_code}]
497
shrsuman12362e5be52021-05-20 02:42:59 -0500498 ${resp}= Evaluate json.loads(r'''${resp.text}''') json
Vijay06a169d2020-04-23 09:28:24 -0500499 ${interfaces}= Set Variable ${resp["Members"]}
500
shrsuman1235c7e4d72021-04-16 05:42:57 -0500501 ${number_of_interfaces}= Get Length ${interfaces}
502 FOR ${i} IN RANGE ${number_of_interfaces}
503 Should Be Equal As Strings ${interfaces[${i}]}[@odata.id]
504 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/eth${i}
505 END
506 Should Be Equal ${resp["Members@odata.count"]} ${number_of_interfaces}
Vijay06a169d2020-04-23 09:28:24 -0500507
508
509Verify VMI Network Interface Details
510 [Documentation] Verify VMI network interface details.
511 [Arguments] ${ip} ${origin} ${gateway} ${netmask}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500512 ... ${valid_status_code}=${HTTP_OK}
Vijay06a169d2020-04-23 09:28:24 -0500513
514 # Description of argument(s):
515 # ip VMI IPv4 address.
516 # origin Origin of IPv4 address eg. Static or DHCP.
517 # gateway Gateway for VMI IP.
518 # netmask Subnetmask for VMI IP.
519 # valid_status_code Expected valid status code from GET request. Default is HTTP_OK.
Vijay06a169d2020-04-23 09:28:24 -0500520
Vijay06a169d2020-04-23 09:28:24 -0500521 ${vmi_ip}= Get VMI Network Interface Details ${valid_status_code}
522 Should Be Equal As Strings ${origin} ${vmi_ip["IPv4_AddressOrigin"]}
523 Should Be Equal As Strings ${gateway} ${vmi_ip["IPv4_Gateway"]}
524 Should Be Equal As Strings ${netmask} ${vmi_ip["IPv4_SubnetMask"]}
Vijay06a169d2020-04-23 09:28:24 -0500525 Should Be Equal As Strings ${ip} ${vmi_ip["IPv4_Address"]}
526
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600527
528Set Static IPv4 Address To VMI And Verify
Vijay06a169d2020-04-23 09:28:24 -0500529 [Documentation] Set static IPv4 address to VMI.
530 [Arguments] ${ip} ${gateway} ${netmask} ${valid_status_code}=${HTTP_ACCEPTED}
531
532 # Description of argument(s):
533 # ip VMI IPv4 address.
534 # gateway Gateway for VMI IP.
535 # netmask Subnetmask for VMI IP.
536 # valid_status_code Expected valid status code from GET request. Default is HTTP_ACCEPTED.
537
538 ${data}= Set Variable
539 ... {"IPv4StaticAddresses": [{"Address": "${ip}","SubnetMask": "${netmask}","Gateway": "${gateway}"}]}
540
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -0500541 ${active_channel_config}= Get Active Channel Config
542 ${resp}= Redfish.Patch
543 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']}
544 ... body=${data} valid_status_codes=[${valid_status_code}]
Prashanth Katti1ce68212020-11-13 00:39:03 -0600545
546 # Wait few seconds for new configuration to get populated on runtime.
547 Sleep ${wait_time}
Vijay06a169d2020-04-23 09:28:24 -0500548
Vijay06a169d2020-04-23 09:28:24 -0500549 Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED}
shrsuman12375e77062020-09-18 01:08:45 -0500550 ${host_power_state} ${host_state}= Redfish Get Host State
551 Run Keyword If '${host_power_state}' == 'On' and '${host_state}' == 'Enabled'
552 ... Verify VMI Network Interface Details ${ip} Static ${gateway} ${netmask}
Vijay06a169d2020-04-23 09:28:24 -0500553
554
555Delete VMI IPv4 Address
556 [Documentation] Delete VMI IPv4 address.
557 [Arguments] ${delete_param}=IPv4StaticAddresses ${valid_status_code}=${HTTP_ACCEPTED}
558
559 # Description of argument(s):
560 # delete_param Parameter to be deleted eg. IPv4StaticAddresses or IPv4Addresses.
561 # Default is IPv4StaticAddresses.
562 # valid_status_code Expected valid status code from PATCH request. Default is HTTP_OK.
563
564 ${data}= Set Variable {"${delete_param}": [${Null}]}
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -0500565 ${active_channel_config}= Get Active Channel Config
566 ${resp}= Redfish.Patch
567 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']}
568 ... body=${data} valid_status_codes=[${valid_status_code}]
Vijay06a169d2020-04-23 09:28:24 -0500569
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600570 Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED}
shrsuman1235c7e4d72021-04-16 05:42:57 -0500571 ${vmi_ip}= Get VMI Network Interface Details
572 Should Be Empty ${vmi_ip["IPv4_Address"]}
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600573
Vijay06a169d2020-04-23 09:28:24 -0500574
575Set VMI IPv4 Origin
576 [Documentation] Set VMI IPv4 origin.
577 [Arguments] ${dhcp_enabled}=${False} ${valid_status_code}=${HTTP_ACCEPTED}
578
579 # Description of argument(s):
580 # dhcp_enabled True if user wants to enable DHCP. Default is Static, hence value is set to False.
581 # valid_status_code Expected valid status code from PATCH request. Default is HTTP_OK.
582
583 ${data}= Set Variable If ${dhcp_enabled} == ${False} ${DISABLE_DHCP} ${ENABLE_DHCP}
Anves Kumar rayankulaaa33b052020-07-22 04:24:51 -0500584 ${resp}= Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/eth0 body=${data}
Vijay06a169d2020-04-23 09:28:24 -0500585 ... valid_status_codes=[${valid_status_code}]
Anves Kumar rayankula801e37f2021-05-04 06:11:07 -0500586
587 Sleep ${wait_time}
shrsuman123b361d412020-09-30 06:17:23 -0500588 Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED}
589 ${resp}= Redfish.Get
590 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']}
591 Should Be Equal ${resp.dict["DHCPv4"]["DHCPEnabled"]} ${dhcp_enabled}
Vijay06a169d2020-04-23 09:28:24 -0500592
593
594Switch VMI IPv4 Origin And Verify Details
595 [Documentation] Switch VMI IPv4 origin and verify details.
Vijay06a169d2020-04-23 09:28:24 -0500596
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500597 ${dhcp_mode_before}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
Anves Kumar rayankulae7dc89a2021-04-28 04:29:38 -0500598 ${dhcp_enabled}= Set Variable If ${dhcp_mode_before} == ${False} ${True} ${False}
Vijay06a169d2020-04-23 09:28:24 -0500599
600 ${default}= Set Variable 0.0.0.0
Anves Kumar rayankulae7dc89a2021-04-28 04:29:38 -0500601 ${origin}= Set Variable If ${dhcp_mode_before} == ${False} DHCP Static
Vijay06a169d2020-04-23 09:28:24 -0500602 Set VMI IPv4 Origin ${dhcp_enabled} ${HTTP_ACCEPTED}
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500603
604 ${dhcp_mode_after}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
605 Should Not Be Equal ${dhcp_mode_before} ${dhcp_mode_after}
606
607 Run Keyword If ${dhcp_mode_after} == ${True}
608 ... Verify VMI Network Interface Details ${default} ${origin} ${default} ${default}
Vijay06a169d2020-04-23 09:28:24 -0500609
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500610
611Delete VMI Static IP Address Using Different Users
612 [Documentation] Update user role and delete vmi static IP address.
613 [Arguments] ${username} ${password} ${valid_status_code}
614 [Teardown] Run Keywords Redfish.Login AND
shrsuman123f559cbe2021-01-06 05:40:45 -0600615 ... Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500616 ... ${test_netmask} ${HTTP_ACCEPTED} AND Redfish.Logout
617
618 # Description of argument(s):
619 # username The host username.
620 # password The host password.
621 # valid_status_code The expected valid status code.
622
623 Redfish.Login ${username} ${password}
624 Delete VMI IPv4 Address delete_param=IPv4StaticAddresses valid_status_code=${valid_status_code}
625 Redfish.Logout
626
627
628Config VMI Static IP Address Using Different Users
629 [Documentation] Update user role and update vmi static ip address.
630 [Arguments] ${username} ${password} ${ip} ${gateway} ${netmask}
631 ... ${valid_status_code}
632
633 # Description of argument(s):
634 # username The host username.
635 # password The host password.
636 # ip IP address to be added (e.g. "10.7.7.7").
637 # subnet_mask Subnet mask for the IP to be added
638 # (e.g. "255.255.0.0").
639 # gateway Gateway for the IP to be added (e.g. "10.7.7.1").
640 # valid_status_code The expected valid status code.
641
642 Redfish.Login ${username} ${password}
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600643 Set Static IPv4 Address To VMI And Verify ${ip} ${gateway} ${netmask} ${valid_status_code}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500644 Redfish.Logout
645
646
647Read VMI Static IP Address Using Different Users
648 [Documentation] Update user role and read vmi static ip address.
649 [Arguments] ${username} ${password} ${valid_status_code}
650
651 # Description of argument(s):
652 # username The host username.
653 # password The host password.
654 # valid_status_code The expected valid status code.
655
656 Redfish.Login ${username} ${password}
657 Redfish.Get
658 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']}
659 ... valid_status_codes=[${valid_status_code}]
660 Redfish.Logout
661
662
663Delete BMC Users Using Redfish
664 [Documentation] Delete BMC users via redfish.
665
666 Redfish.Login
667 Delete BMC Users Via Redfish users=${USERS}
shrsuman123b361d412020-09-30 06:17:23 -0500668
669Update User Role And Set VMI IPv4 Origin
670 [Documentation] Update User Role And Set VMI IPv4 Origin.
671 [Arguments] ${username} ${password} ${dhcp_enabled} ${valid_status_code}
672
673 # Description of argument(s):
674 # username The host username.
675 # password The host password.
676 # dhcp_enabled Indicates whether dhcp should be enabled
677 # (${True}, ${False}).
678 # valid_status_code The expected valid status code.
679
680 Redfish.Login ${username} ${password}
681 Set VMI IPv4 Origin ${dhcp_enabled} ${valid_status_code}
682 Redfish.Logout