blob: 9a92d383861b7260ca2051d92d863020dd2cbdec [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 rayankula358c41d2020-08-14 04:53:06 -05008Library ../../lib/bmc_network_utils.py
Vijay06a169d2020-04-23 09:28:24 -05009
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050010Suite Setup Suite Setup Execution
Vijay06a169d2020-04-23 09:28:24 -050011Test Teardown FFDC On Test Case Fail
12Suite Teardown Redfish.Logout
13
14*** Variables ***
15
shrsuman123c1d3fe32020-09-08 05:04:07 -050016${test_ipv4} 10.10.20.30
17${test_gateway} 0.0.0.0
18${test_netmask} 255.255.252.0
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050019
Vijay06a169d2020-04-23 09:28:24 -050020&{DHCP_ENABLED} DHCPEnabled=${${True}}
21&{DHCP_DISABLED} DHCPEnabled=${${False}}
22
23&{ENABLE_DHCP} DHCPv4=&{DHCP_ENABLED}
24&{DISABLE_DHCP} DHCPv4=&{DHCP_DISABLED}
25
26
27*** Test Cases ***
28
29Verify All VMI EthernetInterfaces
30 [Documentation] Verify all VMI ethernet interfaces.
31 [Tags] Verify_All_VMI_EthernetINterfaces
32
33 Verify VMI EthernetInterfaces
34
35
36Verify Existing VMI Network Interface Details
37 [Documentation] Verify existing VMI network interface details.
38 [Tags] Verify_VMI_Network_Interface_Details
39
40 ${vmi_ip}= Get VMI Network Interface Details
41 ${origin}= Set Variable If ${vmi_ip["DHCPv4"]} == ${False} Static DHCP
42
43 Should Not Be Equal ${vmi_ip["DHCPv4"]} ${vmi_ip["IPv4StaticAddresses"]}
44 Should Be Equal As Strings ${origin} ${vmi_ip["IPv4_AddressOrigin"]}
45 Should Be Equal As Strings ${vmi_ip["Id"]} intf0
George Keishingb3ea0952020-07-01 05:03:56 -050046 Should Be Equal As Strings ${vmi_ip["Description"]}
47 ... Ethernet Interface for Virtual Management Interface
48 Should Be Equal As Strings ${vmi_ip["Name"]} Virtual Management Interface
Vijay06a169d2020-04-23 09:28:24 -050049 Should Be True ${vmi_ip["InterfaceEnabled"]}
50
51
52Delete Existing Static VMI IP Address
53 [Documentation] Delete existing static VMI IP address.
54 [Tags] Delete_Existing_Static_VMI_IP_Address
55
56 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
57 Run Keyword If ${curr_origin} == ${True} Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED}
58
59 Delete VMI IPv4 Address IPv4StaticAddresses valid_status_code=${HTTP_ACCEPTED}
60 ${default}= Set Variable 0.0.0.0
61 Verify VMI Network Interface Details ${default} Static ${default} ${default} ${True}
62
63
64Verify User Cannot Delete ReadOnly Property IPv4Addresses
65 [Documentation] Verify user cannot delete readonly property IPv4Addresses.
66 [Tags] Verify_User_Cannot_Delete_ReadOnly_Property_IPv4Addresses
67
68 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
69 Run Keyword If ${curr_origin} == ${False} Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
70 Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_BAD_REQUEST}
71
72
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -050073Assign Valid And Invalid Static IPv4 Address To VMI
Vijay06a169d2020-04-23 09:28:24 -050074 [Documentation] Assign static IPv4 address to VMI.
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -050075 [Tags] Assign_Valid_And_Invalid_Static_IPv4_Address_To_VMI
Vijay06a169d2020-04-23 09:28:24 -050076 [Template] Verify Assigning Static IPv4 Address To VMI
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050077 [Teardown] Run keywords Delete VMI IPv4 Address IPv4Addresses
78 ... AND Test Teardown Execution
Vijay06a169d2020-04-23 09:28:24 -050079
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050080 # ip gateway netmask valid_status_code
81 10.5.20.30 0.0.0.0 255.255.252.0 ${HTTP_ACCEPTED}
82 a.3.118.94 0.0.0.0 255.255.252.0 ${HTTP_BAD_REQUEST}
83
Vijay06a169d2020-04-23 09:28:24 -050084
shrsuman123e37b0cc2020-09-02 00:33:42 -050085Add Multiple IP Addreses On VMI Interface And Verify
86 [Documentation] Add multiple IP addreses on VMI interface and verify.
87 [Tags] Add_Multiple_IP_Addreses_On_VMI_Interface_And_Verify
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050088 [Teardown] Run keywords Delete VMI IPv4 Address IPv4Addresses
89 ... AND Test Teardown Execution
shrsuman123e37b0cc2020-09-02 00:33:42 -050090
91 ${ip1}= Create dictionary Address=10.5.5.10 SubnetMask=255.255.252.0 Gateway=0.0.0.0
92 ${ip2}= Create dictionary Address=10.5.5.11 SubnetMask=255.255.252.0 Gateway=0.0.0.0
93 ${ip3}= Create dictionary Address=10.5.5.12 SubnetMask=255.255.252.0 Gateway=0.0.0.0
94 ${ips}= Create List ${ip1} ${ip2} ${ip3}
95
96 ${active_channel_config}= Get Active Channel Config
97 Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']}
98 ... body={'IPv4StaticAddresses':${ips}} valid_status_codes=[${HTTP_ACCEPTED}]
99 Verify VMI Network Interface Details ${ip1["Address"]} Static ${ip1["Gateway"]} ${ip1["SubnetMask"]} ${True}
100
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500101
shrsuman123e37b0cc2020-09-02 00:33:42 -0500102Modify IP Addresses On VMI Interface And Verify
103 [Documentation] Modify IP addresses on VMI interface and verify.
104 [Tags] Modify_IP_Addresses_On_VMI_Interface_And_Verify
105 [Template] Verify Assigning Static IPv4 Address To VMI
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500106 [Teardown] Run keywords Delete VMI IPv4 Address IPv4Addresses
107 ... AND Test Teardown Execution
shrsuman123e37b0cc2020-09-02 00:33:42 -0500108
109 # ip gateway netmask del_curr_ip host_reboot valid_status_code
110 10.5.5.10 0.0.0.0 255.255.252.0 ${False} ${True} ${HTTP_ACCEPTED}
111 10.5.5.11 0.0.0.0 255.255.252.0 ${False} ${True} ${HTTP_ACCEPTED}
Vijay06a169d2020-04-23 09:28:24 -0500112
113Switch Between IP Origins On VMI And Verify Details
114 [Documentation] Switch between IP origins on VMI and verify details.
115 [Tags] Switch_Between_IP_Origins_On_VMI_And_Verify_Details
116
117 Switch VMI IPv4 Origin And Verify Details
118 Switch VMI IPv4 Origin And Verify Details
119
120
121Verify Persistency Of VMI IPv4 Details After Host Reboot
122 [Documentation] Verify persistency of VMI IPv4 details after host reboot.
123 [Tags] Verify_Persistency_Of_VMI_IPv4_Details_After_Host_Reboot
124
125 # Verifying persistency of dynamic address.
126 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
127 ${default}= Set Variable 0.0.0.0
128 Verify VMI Network Interface Details ${default} DHCP ${default} ${default} ${True}
129 Verify VMI Network Interface Details ${default} DHCP ${default} ${default} ${True}
130
131 # Verifying persistency of static address.
132 Switch VMI IPv4 Origin And Verify Details ${True}
133 Verify Assigning Static IPv4 Address To VMI ${VMI_IP} ${VMI_GATEWAY} ${VMI_NETMASK} ${False}
134 Verify VMI Network Interface Details ${VMI_IP} Static ${VMI_GATEWAY} ${VMI_NETMASK} ${True}
135
136
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500137Delete VMI Static IP Address And Verify
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500138 [Documentation] Delete VMI static IP address and verify.
139 [Tags] Delete_VMI_Static_IP_Address_And_Verify
140 [Teardown] Test Teardown Execution
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500141
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500142 Verify Assigning Static IPv4 Address To VMI ${test_ipv4} ${test_gateway} ${test_netmask}
143 Delete VMI IPv4 Address IPv4Addresses ${HTTP_ACCEPTED}
144 ${active_channel_config}= Get Active Channel Config
145 ${resp}= Redfish.Get
146 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']}
147 Should Be Empty ${resp.dict["IPv4Addresses"]}
148
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500149
shrsuman123c1d3fe32020-09-08 05:04:07 -0500150Verify Successful VMI IP Static Configuration On HOST Boot After Session Delete
151 [Documentation] Verify VMI IP static Configuration On HOST Boot After session deleted.
152 [Tags] Verify_Successful_VMI_IP_Static_Configuration_On_HOST_Boot_After_Session_Delete
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500153 [Teardown] Run keywords Delete VMI IPv4 Address IPv4Addresses AND Test Teardown Execution
shrsuman123c1d3fe32020-09-08 05:04:07 -0500154
155 Set Static IPv4 Address To VMI ${test_ipv4} ${test_gateway} ${test_netmask}
156
157 ${session_info}= Get Redfish Session Info
158 Redfish.Delete ${session_info["location"]}
159
160 # Create a new Redfish session
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500161 Redfish Power Off
162 Redfish Power On
shrsuman123c1d3fe32020-09-08 05:04:07 -0500163
164 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
165
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500166
shrsuman123c1d3fe32020-09-08 05:04:07 -0500167Verify Persistency Of VMI DHCP IP Configuration After Multiple HOST Reboots
168 [Documentation] Verify Persistency Of VMI DHCP IP configuration After Multiple HOST Reboots
169 [Tags] Verify_Persistency_Of_VMI_DHCP_IP_Configuration_After_Multiple_HOST_Reboots
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500170 [Teardown] Test Teardown Execution
shrsuman123c1d3fe32020-09-08 05:04:07 -0500171
172 ${LOOP_COUNT}= Set Variable ${3}
173 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
174 Run Keywords Redfish Power Off AND Redfish Power On
175 ${vmi_ip_config}= Get VMI Network Interface Details
176 # Verifying persistency of dynamic address after multiple reboots.
177 Repeat Keyword ${LOOP_COUNT} times
178 ... Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]} DHCP ${vmi_ip_config["IPv4_Gateway"]}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500179 ... ${vmi_ip_config["IPv4_SubnetMask"]}
180
181
182Enable DHCP When Static IP Configured And Verify Static IP
183 [Documentation] Enable DHCP when static ip configured and verify static ip
184 [Tags] Enable_DHCP_when_Static_IP_Configured_And_Verify_Static_IP
185 [Teardown] Test Teardown Execution
186
187 Verify Assigning Static IPv4 Address To VMI ${test_ipv4} ${test_gateway} ${test_netmask}
188 Set VMI IPv4 Origin ${True}
189 Redfish Power Off
190 Redfish Power On
191 ${vmi_network_conf}= Get VMI Network Interface Details
192 Should Not Be Equal As Strings ${test_ipv4} ${vmi_network_conf["IPv4_Address"]}
193
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500194
shrsuman123e37b0cc2020-09-02 00:33:42 -0500195Verify VMI Static IP Configuration Persist On BMC Reset Before Host Boot
196 [Documentation] Verify VMI static IP configuration persist on BMC reset.
197 [Tags] Verify_VMI_Static_IP_Configuration_Persist_On_BMC_Reset_Before_Host_Boot
shrsuman1235897ea72020-09-24 00:30:15 -0500198 [Teardown] Run keywords Delete VMI IPv4 Address IPv4Addresses AND FFDC On Test Case Fail
shrsuman123e37b0cc2020-09-02 00:33:42 -0500199
200 Set Static IPv4 Address To VMI ${test_ipv4} ${test_gateway} ${test_netmask}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500201 OBMC Reboot (off)
202 Redfish Power On
shrsuman123e37b0cc2020-09-02 00:33:42 -0500203 # Verifying the VMI static configuration
204 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
205
206
207
Vijay06a169d2020-04-23 09:28:24 -0500208*** Keywords ***
209
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500210Suite Setup Execution
211 [Documentation] Do test setup execution task.
212
213 Redfish.Login
214 Redfish Power On
215 ${active_channel_config}= Get Active Channel Config
216 Set Suite Variable ${active_channel_config}
217 ${resp}= Redfish.Get
218 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']}
219 ${ip_resp}= Evaluate json.loads('''${resp.text}''') json
220 ${length}= Get Length ${ip_resp["IPv4StaticAddresses"]}
221 ${vmi_network_conf}= Run Keyword If ${length} != ${0} Get VMI Network Interface Details
222 Set Suite Variable ${vmi_network_conf}
223
224
225Test Teardown Execution
226 [Documentation] Do test teardown execution task.
227
228 FFDC On Test Case Fail
229 ${curr_mode}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
230 Run Keyword If ${curr_mode} == ${True} Set VMI IPv4 Origin ${False}
231 Run Keyword If ${vmi_network_conf} != ${None}
232 ... Verify Assigning Static IPv4 Address To VMI ${vmi_network_conf["IPv4_Address"]}
233 ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]}
234
235
Vijay06a169d2020-04-23 09:28:24 -0500236Get VMI Network Interface Details
237 [Documentation] Get VMI network interface details.
238 [Arguments] ${valid_status_code}=${HTTP_OK}
239
240 # Description of argument(s):
241 # valid_status_code Expected valid status code from GET request.
242
Anves Kumar rayankulaaa33b052020-07-22 04:24:51 -0500243 # Note: It returns a dictionary of VMI eth0 parameters.
Vijay06a169d2020-04-23 09:28:24 -0500244
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -0500245 ${active_channel_config}= Get Active Channel Config
246 ${resp}= Redfish.Get
247 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']}
Vijay06a169d2020-04-23 09:28:24 -0500248 ... valid_status_codes=[${valid_status_code}]
249
250 ${ip_resp}= Evaluate json.loads('''${resp.text}''') json
251
252 ${static_exists}= Run Keyword And Ignore Error
253 ... Set Variable ${ip_resp["IPv4StaticAddresses"][0]["Address"]}
254 ${static_exists}= Set Variable If '${static_exists[0]}' == 'PASS' ${True} ${False}
255
256 ${vmi_ip}= Create Dictionary DHCPv4=${${ip_resp["DHCPv4"]["DHCPEnabled"]}} Id=${ip_resp["Id"]}
257 ... Description=${ip_resp["Description"]} IPv4_Address=${ip_resp["IPv4Addresses"][0]["Address"]}
258 ... IPv4_AddressOrigin=${ip_resp["IPv4Addresses"][0]["AddressOrigin"]} Name=${ip_resp["Name"]}
Sushil Singh810234d2020-05-13 12:12:03 -0500259 ... IPv4_Gateway=${ip_resp["IPv4Addresses"][0]["Gateway"]}
260 ... InterfaceEnabled=${${ip_resp["InterfaceEnabled"]}}
Vijay06a169d2020-04-23 09:28:24 -0500261 ... IPv4_SubnetMask=${ip_resp["IPv4Addresses"][0]["SubnetMask"]} MACAddress=${ip_resp["MACAddress"]}
262 ... IPv4StaticAddresses=${${static_exists}}
263
264 [Return] &{vmi_ip}
265
266
267Get Immediate Child Parameter From VMI Network Interface
268 [Documentation] Get immediate child parameter from VMI network interface.
269 [Arguments] ${parameter} ${valid_status_code}=${HTTP_OK}
270
271 # Description of argument(s):
272 # parameter parameter for which value is required. Ex: DHCPEnabled, MACAddress etc.
273 # valid_status_code Expected valid status code from GET request.
274
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -0500275 ${active_channel_config}= Get Active Channel Config
276 ${resp}= Redfish.Get
277 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']}
Vijay06a169d2020-04-23 09:28:24 -0500278 ... valid_status_codes=[${valid_status_code}]
279
280 ${ip_resp}= Evaluate json.loads('''${resp.text}''') json
281 ${value}= Set Variable If '${parameter}' != 'DHCPEnabled' ${ip_resp["${parameter}"]}
282 ... ${ip_resp["DHCPv4"]["${parameter}"]}
283
284 [Return] ${value}
285
Vijay06a169d2020-04-23 09:28:24 -0500286Verify VMI EthernetInterfaces
287 [Documentation] Verify VMI ethernet interfaces.
288 [Arguments] ${valid_status_code}=${HTTP_OK}
289
290 # Description of argument(s):
291 # valid_status_code Expected valid status code from GET request.
292
293 ${resp}= Redfish.Get /redfish/v1/Systems/hypervisor/EthernetInterfaces
294 ... valid_status_codes=[${valid_status_code}]
295
296 ${resp}= Evaluate json.loads('''${resp.text}''') json
297 ${interfaces}= Set Variable ${resp["Members"]}
298
299 Should Be Equal As Strings ${interfaces[0]}[@odata.id]
Anves Kumar rayankulaaa33b052020-07-22 04:24:51 -0500300 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/eth0
Vijay06a169d2020-04-23 09:28:24 -0500301 Should Be Equal As Strings ${interfaces[1]}[@odata.id]
Anves Kumar rayankulaaa33b052020-07-22 04:24:51 -0500302 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/eth1
Vijay06a169d2020-04-23 09:28:24 -0500303
304 Should Be Equal ${resp["Members@odata.count"]} ${2}
305
306
307Verify VMI Network Interface Details
308 [Documentation] Verify VMI network interface details.
309 [Arguments] ${ip} ${origin} ${gateway} ${netmask}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500310 ... ${valid_status_code}=${HTTP_OK}
Vijay06a169d2020-04-23 09:28:24 -0500311
312 # Description of argument(s):
313 # ip VMI IPv4 address.
314 # origin Origin of IPv4 address eg. Static or DHCP.
315 # gateway Gateway for VMI IP.
316 # netmask Subnetmask for VMI IP.
317 # valid_status_code Expected valid status code from GET request. Default is HTTP_OK.
Vijay06a169d2020-04-23 09:28:24 -0500318
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500319 Run Keywords Redfish Power Off AND Redfish Power On
Vijay06a169d2020-04-23 09:28:24 -0500320 ${vmi_ip}= Get VMI Network Interface Details ${valid_status_code}
321 Should Be Equal As Strings ${origin} ${vmi_ip["IPv4_AddressOrigin"]}
322 Should Be Equal As Strings ${gateway} ${vmi_ip["IPv4_Gateway"]}
323 Should Be Equal As Strings ${netmask} ${vmi_ip["IPv4_SubnetMask"]}
Vijay06a169d2020-04-23 09:28:24 -0500324 Should Be Equal As Strings ${ip} ${vmi_ip["IPv4_Address"]}
325
Vijay06a169d2020-04-23 09:28:24 -0500326Set Static IPv4 Address To VMI
327 [Documentation] Set static IPv4 address to VMI.
328 [Arguments] ${ip} ${gateway} ${netmask} ${valid_status_code}=${HTTP_ACCEPTED}
329
330 # Description of argument(s):
331 # ip VMI IPv4 address.
332 # gateway Gateway for VMI IP.
333 # netmask Subnetmask for VMI IP.
334 # valid_status_code Expected valid status code from GET request. Default is HTTP_ACCEPTED.
335
336 ${data}= Set Variable
337 ... {"IPv4StaticAddresses": [{"Address": "${ip}","SubnetMask": "${netmask}","Gateway": "${gateway}"}]}
338
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -0500339 ${active_channel_config}= Get Active Channel Config
340 ${resp}= Redfish.Patch
341 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']}
342 ... body=${data} valid_status_codes=[${valid_status_code}]
Vijay06a169d2020-04-23 09:28:24 -0500343 Log To Console ${resp.text}
344
345
346Verify Assigning Static IPv4 Address To VMI
347 [Documentation] Verify assigning static IPv4 address to VMI.
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500348 [Arguments] ${ip} ${gateway} ${netmask} ${valid_status_code}=${HTTP_ACCEPTED}
Vijay06a169d2020-04-23 09:28:24 -0500349
350 # Description of argument(s):
351 # ip VMI IPv4 address.
352 # gateway Gateway for VMI IP.
353 # netmask Subnetmask for VMI IP.
Vijay06a169d2020-04-23 09:28:24 -0500354 # valid_status_code Expected valid status code from GET request. Default is HTTP_ACCEPTED.
355
Vijay06a169d2020-04-23 09:28:24 -0500356
357 Set Static IPv4 Address To VMI ${ip} ${gateway} ${netmask} valid_status_code=${valid_status_code}
358 Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED}
359
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500360 Verify VMI Network Interface Details ${ip} Static ${gateway} ${netmask}
Vijay06a169d2020-04-23 09:28:24 -0500361
362
363Delete VMI IPv4 Address
364 [Documentation] Delete VMI IPv4 address.
365 [Arguments] ${delete_param}=IPv4StaticAddresses ${valid_status_code}=${HTTP_ACCEPTED}
366
367 # Description of argument(s):
368 # delete_param Parameter to be deleted eg. IPv4StaticAddresses or IPv4Addresses.
369 # Default is IPv4StaticAddresses.
370 # valid_status_code Expected valid status code from PATCH request. Default is HTTP_OK.
371
372 ${data}= Set Variable {"${delete_param}": [${Null}]}
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -0500373 ${active_channel_config}= Get Active Channel Config
374 ${resp}= Redfish.Patch
375 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']}
376 ... body=${data} valid_status_codes=[${valid_status_code}]
Vijay06a169d2020-04-23 09:28:24 -0500377
378
379Set VMI IPv4 Origin
380 [Documentation] Set VMI IPv4 origin.
381 [Arguments] ${dhcp_enabled}=${False} ${valid_status_code}=${HTTP_ACCEPTED}
382
383 # Description of argument(s):
384 # dhcp_enabled True if user wants to enable DHCP. Default is Static, hence value is set to False.
385 # valid_status_code Expected valid status code from PATCH request. Default is HTTP_OK.
386
387 ${data}= Set Variable If ${dhcp_enabled} == ${False} ${DISABLE_DHCP} ${ENABLE_DHCP}
Anves Kumar rayankulaaa33b052020-07-22 04:24:51 -0500388 ${resp}= Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/eth0 body=${data}
Vijay06a169d2020-04-23 09:28:24 -0500389 ... valid_status_codes=[${valid_status_code}]
390
391
392Switch VMI IPv4 Origin And Verify Details
393 [Documentation] Switch VMI IPv4 origin and verify details.
394 [Arguments] ${host_reboot}=${False}
395
396 # Description of argument(s):
397 # host_reboot Reboot HOST if True.
398
399 ${curr_mode}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
400 ${dhcp_enabled}= Set Variable If ${curr_mode} == ${False} ${True} ${False}
401
402 ${default}= Set Variable 0.0.0.0
403 ${origin}= Set Variable If ${curr_mode} == ${False} DHCP Static
404 Set VMI IPv4 Origin ${dhcp_enabled} ${HTTP_ACCEPTED}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500405 Verify VMI Network Interface Details ${default} ${origin} ${default} ${default}
Vijay06a169d2020-04-23 09:28:24 -0500406
407 [Return] ${origin}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500408