blob: bf26541b2543191e6816898962c681e58d4b2971 [file] [log] [blame]
Prashanth Kattif58cce02019-02-06 03:05:14 -06001*** Settings ***
2Documentation Network interface configuration and verification
3 ... tests.
4
George Keishing5d467552019-02-08 23:30:48 -06005Resource ../../lib/bmc_redfish_resource.robot
6Resource ../../lib/bmc_network_utils.robot
7Resource ../../lib/openbmc_ffdc.robot
Prashanth Katti747ce9d2019-02-07 07:23:48 -06008Library ../../lib/bmc_network_utils.py
Vijayde3bf7b2019-04-16 04:56:09 -05009Library Collections
Prashanth Kattif58cce02019-02-06 03:05:14 -060010
aravinth0510ca054ee2022-06-16 13:26:15 +000011Suite Setup Suite Setup Execution
12Suite Teardown Suite Teardown Execution
13Test Setup Test Setup Execution
14Test Teardown Test Teardown Execution
Prashanth Kattif58cce02019-02-06 03:05:14 -060015
George Keishing9899a902023-09-07 20:57:53 +053016Force Tags Bmc_Network_Conf
Prashanth Kattif34fafa2019-06-20 05:04:40 -050017
Prashanth Katti23efc6e2019-03-13 06:07:15 -050018*** Variables ***
Vijayde3bf7b2019-04-16 04:56:09 -050019${test_hostname} openbmc
20${test_ipv4_addr} 10.7.7.7
21${test_ipv4_invalid_addr} 0.0.1.a
22${test_subnet_mask} 255.255.0.0
Prashanth Kattib36a7522019-05-22 05:32:39 -050023${broadcast_ip} 10.7.7.255
24${loopback_ip} 127.0.0.2
25${multicast_ip} 224.6.6.6
26${out_of_range_ip} 10.7.7.256
Prashanth Katti568df5f2020-05-15 06:00:37 -050027${test_ipv4_addr2} 10.7.7.8
Prashanth Katti23efc6e2019-03-13 06:07:15 -050028
George Keishing16b3c7b2021-01-28 09:23:37 -060029# Valid netmask is 4 bytes long and has continuous block of 1s.
Prashanth Katti040c8c12019-05-31 04:42:05 -050030# Maximum valid value in each octet is 255 and least value is 0.
31# 253 is not valid, as binary value is 11111101.
32${invalid_netmask} 255.255.253.0
33${alpha_netmask} ff.ff.ff.ff
34# Maximum value of octet in netmask is 255.
35${out_of_range_netmask} 255.256.255.0
36${more_byte_netmask} 255.255.255.0.0
37${less_byte_netmask} 255.255.255
Prashanth Kattic6ad6472019-06-14 03:33:39 -050038${threshold_netmask} 255.255.255.255
39${lowest_netmask} 128.0.0.0
40
41# There will be 4 octets in IP address (e.g. xx.xx.xx.xx)
42# but trying to configure xx.xx.xx
43${less_octet_ip} 10.3.36
44
45# For the address 10.6.6.6, the 10.6.6.0 portion describes the
46# network ID and the 6 describe the host.
47
48${network_id} 10.7.7.0
49${hex_ip} 0xa.0xb.0xc.0xd
50${negative_ip} 10.-7.-7.7
Prashanth Katti7098c972019-07-03 06:56:42 -050051@{static_name_servers} 10.5.5.5
Prashanth Katti3c7b6432019-07-26 06:53:37 -050052@{null_value} null
Prashanth Kattiafe16b72019-08-02 00:29:45 -050053@{empty_dictionary} {}
54@{string_value} aa.bb.cc.dd
55
Prashanth Kattif58cce02019-02-06 03:05:14 -060056*** Test Cases ***
57
58Get IP Address And Verify
59 [Documentation] Get IP Address And Verify.
George Keishing5d467552019-02-08 23:30:48 -060060 [Tags] Get_IP_Address_And_Verify
Prashanth Kattif58cce02019-02-06 03:05:14 -060061
Sushil Singh50621142020-06-16 11:12:21 -050062 FOR ${network_configuration} IN @{network_configurations}
63 Verify IP On BMC ${network_configuration['Address']}
64 END
Prashanth Katti747ce9d2019-02-07 07:23:48 -060065
Prashanth Kattif58cce02019-02-06 03:05:14 -060066Get Netmask And Verify
67 [Documentation] Get Netmask And Verify.
George Keishing5d467552019-02-08 23:30:48 -060068 [Tags] Get_Netmask_And_Verify
Prashanth Kattif58cce02019-02-06 03:05:14 -060069
Sushil Singh50621142020-06-16 11:12:21 -050070 FOR ${network_configuration} IN @{network_configurations}
71 Verify Netmask On BMC ${network_configuration['SubnetMask']}
72 END
Prashanth Katti747ce9d2019-02-07 07:23:48 -060073
Prashanth Katti2ec9d8b2019-02-12 05:20:19 -060074Get Gateway And Verify
75 [Documentation] Get gateway and verify it's existence on the BMC.
76 [Tags] Get_Gateway_And_Verify
77
Sushil Singh50621142020-06-16 11:12:21 -050078 FOR ${network_configuration} IN @{network_configurations}
79 Verify Gateway On BMC ${network_configuration['Gateway']}
80 END
Prashanth Katti2ec9d8b2019-02-12 05:20:19 -060081
82Get MAC Address And Verify
83 [Documentation] Get MAC address and verify it's existence on the BMC.
84 [Tags] Get_MAC_Address_And_Verify
85
Tony Lee412c6682020-04-01 17:34:30 +080086 ${active_channel_config}= Get Active Channel Config
87 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
88
89 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
Prashanth Katti2ec9d8b2019-02-12 05:20:19 -060090 ${macaddr}= Get From Dictionary ${resp.dict} MACAddress
91 Validate MAC On BMC ${macaddr}
Prashanth Kattif58cce02019-02-06 03:05:14 -060092
Prashanth Katti2c5c3bb2019-02-14 04:23:07 -060093Verify All Configured IP And Netmask
94 [Documentation] Verify all configured IP and netmask on BMC.
95 [Tags] Verify_All_Configured_IP_And_Netmask
96
Sushil Singh50621142020-06-16 11:12:21 -050097 FOR ${network_configuration} IN @{network_configurations}
98 Verify IP And Netmask On BMC ${network_configuration['Address']}
99 ... ${network_configuration['SubnetMask']}
100 END
Prashanth Katti2c5c3bb2019-02-14 04:23:07 -0600101
Prashanth Katti23efc6e2019-03-13 06:07:15 -0500102Get Hostname And Verify
103 [Documentation] Get hostname via Redfish and verify.
104 [Tags] Get_Hostname_And_Verify
105
106 ${hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName
107
108 Validate Hostname On BMC ${hostname}
109
110Configure Hostname And Verify
111 [Documentation] Configure hostname via Redfish and verify.
112 [Tags] Configure_Hostname_And_Verify
shrsuman123578276c2020-08-04 04:28:58 -0500113 [Teardown] Run Keywords
114 ... Configure Hostname ${hostname} AND Validate Hostname On BMC ${hostname}
Prashanth Katti23efc6e2019-03-13 06:07:15 -0500115
Prashanth Kattiadf0b4e2019-06-10 04:20:30 -0500116 ${hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName
Prashanth Katti23efc6e2019-03-13 06:07:15 -0500117
Prashanth Kattiadf0b4e2019-06-10 04:20:30 -0500118 Configure Hostname ${test_hostname}
Prashanth Katti23efc6e2019-03-13 06:07:15 -0500119 Validate Hostname On BMC ${test_hostname}
120
Sweta Potthuri645128a2024-05-21 11:12:33 -0500121 # Verify configured hostname via Redfish.
nagarjunb2260784a42022-06-13 10:39:33 +0530122 ${new_hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName
123 Should Be Equal ${new_hostname} ${test_hostname}
124
Anvesh-Kumar_Rayankulacff10212024-01-04 00:15:54 -0600125Configure Invalid HostName And Verify
Sweta Potthuri645128a2024-05-21 11:12:33 -0500126 [Documentation] Configure invalid hostname via Redfish and verify.
Anvesh-Kumar_Rayankulacff10212024-01-04 00:15:54 -0600127 [Tags] Configure_Invalid_HostName_And_Verify
128 [Template] Configure Hostname
129
130 # hostname status_code
131 !#@ [${HTTP_BAD_REQUEST}]
Sweta Potthuri645128a2024-05-21 11:12:33 -0500132
133Configure Empty HostName And Verify If LocalHost Is Assigned
134 [Documentation] Configure empty hostname and verify if localHost is assigned.
135 [Tags] Configure_Empty_HostName_And_Verify_If_LocalHost_Is_Assigned
136 [Teardown] Run Keywords
137 ... Configure Hostname ${hostname} AND Validate Hostname On BMC ${hostname}
138
139 ${hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName
140
141 Configure Hostname ${EMPTY}
142 Validate Hostname On BMC localhost
143
144 # Verify configured hostname via Redfish.
145 ${new_hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName
146 Should Be Equal ${new_hostname} localhost
Prashanth Kattiadf0b4e2019-06-10 04:20:30 -0500147
Vijayde3bf7b2019-04-16 04:56:09 -0500148Add Valid IPv4 Address And Verify
149 [Documentation] Add IPv4 Address via Redfish and verify.
George Keishing0c8100f2022-01-13 00:24:57 -0600150 [Tags] Add_Valid_IPv4_Address_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500151 [Teardown] Run Keywords
152 ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution
Vijayde3bf7b2019-04-16 04:56:09 -0500153
154 Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway}
Vijayde3bf7b2019-04-16 04:56:09 -0500155
156Add Invalid IPv4 Address And Verify
157 [Documentation] Add Invalid IPv4 Address via Redfish and verify.
George Keishing0c8100f2022-01-13 00:24:57 -0600158 [Tags] Add_Invalid_IPv4_Address_And_Verify
Vijayde3bf7b2019-04-16 04:56:09 -0500159
160 Add IP Address ${test_ipv4_invalid_addr} ${test_subnet_mask}
161 ... ${test_gateway} valid_status_codes=${HTTP_BAD_REQUEST}
162
Prashanth Kattib36a7522019-05-22 05:32:39 -0500163Configure Out Of Range IP
164 [Documentation] Configure out-of-range IP address.
165 [Tags] Configure_Out_Of_Range_IP
166 [Template] Add IP Address
167
168 # ip subnet_mask gateway valid_status_codes
169 ${out_of_range_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
170
171Configure Broadcast IP
172 [Documentation] Configure broadcast IP address.
173 [Tags] Configure_Broadcast_IP
174 [Template] Add IP Address
Prashanth Kattic6ad6472019-06-14 03:33:39 -0500175 [Teardown] Clear IP Settings On Fail ${broadcast_ip}
Prashanth Kattib36a7522019-05-22 05:32:39 -0500176
177 # ip subnet_mask gateway valid_status_codes
178 ${broadcast_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
179
180Configure Multicast IP
181 [Documentation] Configure multicast IP address.
182 [Tags] Configure_Multicast_IP
183 [Template] Add IP Address
Prashanth Kattic6ad6472019-06-14 03:33:39 -0500184 [Teardown] Clear IP Settings On Fail ${multicast_ip}
Prashanth Kattib36a7522019-05-22 05:32:39 -0500185
186 # ip subnet_mask gateway valid_status_codes
187 ${multicast_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
188
189Configure Loopback IP
190 [Documentation] Configure loopback IP address.
191 [Tags] Configure_Loopback_IP
192 [Template] Add IP Address
Prashanth Kattic6ad6472019-06-14 03:33:39 -0500193 [Teardown] Clear IP Settings On Fail ${loopback_ip}
Prashanth Kattib36a7522019-05-22 05:32:39 -0500194
195 # ip subnet_mask gateway valid_status_codes
196 ${loopback_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
197
198Add Valid IPv4 Address And Check Persistency
nagarjunb2260784a42022-06-13 10:39:33 +0530199 [Documentation] Add IPv4 address and check persistency.
George Keishing0c8100f2022-01-13 00:24:57 -0600200 [Tags] Add_Valid_IPv4_Address_And_Check_Persistency
nagarjunb2260784a42022-06-13 10:39:33 +0530201 [Teardown] Run Keywords
202 ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution
Prashanth Kattib36a7522019-05-22 05:32:39 -0500203
204 Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway}
205
206 # Reboot BMC and verify persistency.
Sweta Potthuri63f0b102022-08-03 23:11:46 -0500207 Redfish OBMC Reboot (off) stack_mode=skip
George Keishing5c498742019-08-09 02:14:44 -0500208 Redfish.Login
Prashanth Kattib36a7522019-05-22 05:32:39 -0500209 Verify IP On BMC ${test_ipv4_addr}
nagarjunb2260784a42022-06-13 10:39:33 +0530210 Verify IP On Redfish URI ${test_ipv4_addr}
211
Vijayde3bf7b2019-04-16 04:56:09 -0500212
Prashanth Katti6cedca22019-05-30 02:31:11 -0500213Add Fourth Octet Threshold IP And Verify
214 [Documentation] Add fourth octet threshold IP and verify.
215 [Tags] Add_Fourth_Octet_Threshold_IP_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500216 [Teardown] Run Keywords
217 ... Delete IP Address 10.7.7.254 AND Test Teardown Execution
Prashanth Katti6cedca22019-05-30 02:31:11 -0500218
219 Add IP Address 10.7.7.254 ${test_subnet_mask} ${test_gateway}
Prashanth Katti6cedca22019-05-30 02:31:11 -0500220
221Add Fourth Octet Lowest IP And Verify
222 [Documentation] Add fourth octet lowest IP and verify.
223 [Tags] Add_Fourth_Octet_Lowest_IP_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500224 [Teardown] Run Keywords
225 ... Delete IP Address 10.7.7.1 AND Test Teardown Execution
Prashanth Katti6cedca22019-05-30 02:31:11 -0500226
227 Add IP Address 10.7.7.1 ${test_subnet_mask} ${test_gateway}
Prashanth Katti6cedca22019-05-30 02:31:11 -0500228
229Add Third Octet Threshold IP And Verify
230 [Documentation] Add third octet threshold IP and verify.
231 [Tags] Add_Third_Octet_Threshold_IP_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500232 [Teardown] Run Keywords
233 ... Delete IP Address 10.7.255.7 AND Test Teardown Execution
Prashanth Katti6cedca22019-05-30 02:31:11 -0500234
235 Add IP Address 10.7.255.7 ${test_subnet_mask} ${test_gateway}
Prashanth Katti6cedca22019-05-30 02:31:11 -0500236
237Add Third Octet Lowest IP And Verify
238 [Documentation] Add third octet lowest IP and verify.
239 [Tags] Add_Third_Octet_Lowest_IP_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500240 [Teardown] Run Keywords
241 ... Delete IP Address 10.7.0.7 AND Test Teardown Execution
Prashanth Katti6cedca22019-05-30 02:31:11 -0500242
243 Add IP Address 10.7.0.7 ${test_subnet_mask} ${test_gateway}
Prashanth Katti6cedca22019-05-30 02:31:11 -0500244
245Add Second Octet Threshold IP And Verify
246 [Documentation] Add second octet threshold IP and verify.
247 [Tags] Add_Second_Octet_Threshold_IP_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500248 [Teardown] Run Keywords
249 ... Delete IP Address 10.255.7.7 AND Test Teardown Execution
Prashanth Katti6cedca22019-05-30 02:31:11 -0500250
251 Add IP Address 10.255.7.7 ${test_subnet_mask} ${test_gateway}
Prashanth Katti6cedca22019-05-30 02:31:11 -0500252
253Add Second Octet Lowest IP And Verify
254 [Documentation] Add second octet lowest IP and verify.
255 [Tags] Add_Second_Octet_Lowest_IP_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500256 [Teardown] Run Keywords
257 ... Delete IP Address 10.0.7.7 AND Test Teardown Execution
Prashanth Katti6cedca22019-05-30 02:31:11 -0500258
259 Add IP Address 10.0.7.7 ${test_subnet_mask} ${test_gateway}
Prashanth Katti6cedca22019-05-30 02:31:11 -0500260
261Add First Octet Threshold IP And Verify
262 [Documentation] Add first octet threshold IP and verify.
263 [Tags] Add_First_Octet_Threshold_IP_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500264 [Teardown] Run Keywords
Anves Kumar rayankulaf757b102020-07-27 20:41:36 -0500265 ... Delete IP Address 223.7.7.7 AND Test Teardown Execution
Prashanth Katti6cedca22019-05-30 02:31:11 -0500266
267 Add IP Address 223.7.7.7 ${test_subnet_mask} ${test_gateway}
Prashanth Katti6cedca22019-05-30 02:31:11 -0500268
269Add First Octet Lowest IP And Verify
270 [Documentation] Add first octet lowest IP and verify.
271 [Tags] Add_First_Octet_Lowest_IP_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500272 [Teardown] Run Keywords
273 ... Delete IP Address 1.7.7.7 AND Test Teardown Execution
Prashanth Katti6cedca22019-05-30 02:31:11 -0500274
275 Add IP Address 1.7.7.7 ${test_subnet_mask} ${test_gateway}
Prashanth Katti6cedca22019-05-30 02:31:11 -0500276
Prashanth Katti040c8c12019-05-31 04:42:05 -0500277Configure Invalid Netmask
278 [Documentation] Verify error while setting invalid netmask.
279 [Tags] Configure_Invalid_Netmask
280 [Template] Add IP Address
281
282 # ip subnet_mask gateway valid_status_codes
283 ${test_ipv4_addr} ${invalid_netmask} ${test_gateway} ${HTTP_BAD_REQUEST}
284
285Configure Out Of Range Netmask
286 [Documentation] Verify error while setting out of range netmask.
287 [Tags] Configure_Out_Of_Range_Netmask
288 [Template] Add IP Address
289
290 # ip subnet_mask gateway valid_status_codes
291 ${test_ipv4_addr} ${out_of_range_netmask} ${test_gateway} ${HTTP_BAD_REQUEST}
292
293Configure Alpha Netmask
294 [Documentation] Verify error while setting alpha netmask.
295 [Tags] Configure_Alpha_Netmask
296 [Template] Add IP Address
297
298 # ip subnet_mask gateway valid_status_codes
299 ${test_ipv4_addr} ${alpha_netmask} ${test_gateway} ${HTTP_BAD_REQUEST}
300
301Configure More Byte Netmask
302 [Documentation] Verify error while setting more byte netmask.
303 [Tags] Configure_More_Byte_Netmask
304 [Template] Add IP Address
305
306 # ip subnet_mask gateway valid_status_codes
307 ${test_ipv4_addr} ${more_byte_netmask} ${test_gateway} ${HTTP_BAD_REQUEST}
308
309Configure Less Byte Netmask
310 [Documentation] Verify error while setting less byte netmask.
311 [Tags] Configure_Less_Byte_Netmask
312 [Template] Add IP Address
313
314 # ip subnet_mask gateway valid_status_codes
315 ${test_ipv4_addr} ${less_byte_netmask} ${test_gateway} ${HTTP_BAD_REQUEST}
316
Prashanth Kattic6ad6472019-06-14 03:33:39 -0500317Configure Threshold Netmask And Verify
318 [Documentation] Configure threshold netmask and verify.
George Keishing5236ec52022-01-31 12:07:58 -0600319 [Tags] Configure_Threshold_Netmask_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500320 [Teardown] Run Keywords
321 ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution
Prashanth Kattic6ad6472019-06-14 03:33:39 -0500322
323 Add IP Address ${test_ipv4_addr} ${threshold_netmask} ${test_gateway}
Prashanth Kattic6ad6472019-06-14 03:33:39 -0500324
325Configure Lowest Netmask And Verify
326 [Documentation] Configure lowest netmask and verify.
George Keishing5236ec52022-01-31 12:07:58 -0600327 [Tags] Configure_Lowest_Netmask_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500328 [Teardown] Run Keywords
329 ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution
Prashanth Kattic6ad6472019-06-14 03:33:39 -0500330
331 Add IP Address ${test_ipv4_addr} ${lowest_netmask} ${test_gateway}
Prashanth Kattic6ad6472019-06-14 03:33:39 -0500332
333Configure Network ID
334 [Documentation] Verify error while configuring network ID.
335 [Tags] Configure_Network_ID
336 [Template] Add IP Address
337 [Teardown] Clear IP Settings On Fail ${network_id}
338
339 # ip subnet_mask gateway valid_status_codes
340 ${network_id} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
341
342Configure Less Octet IP
343 [Documentation] Verify error while Configuring less octet IP address.
344 [Tags] Configure_Less_Octet_IP
345 [Template] Add IP Address
346
347 # ip subnet_mask gateway valid_status_codes
348 ${less_octet_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
349
350Configure Empty IP
351 [Documentation] Verify error while Configuring empty IP address.
352 [Tags] Configure_Empty_IP
353 [Template] Add IP Address
354
355 # ip subnet_mask gateway valid_status_codes
356 ${EMPTY} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
357
358Configure Special Char IP
359 [Documentation] Configure invalid IP address containing special chars.
360 [Tags] Configure_Special_Char_IP
361 [Template] Add IP Address
362
363 # ip subnet_mask gateway valid_status_codes
364 @@@.%%.44.11 ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
365
366Configure Hexadecimal IP
367 [Documentation] Configure invalid IP address containing hex value.
368 [Tags] Configure_Hexadecimal_IP
369 [Template] Add IP Address
370
371 # ip subnet_mask gateway valid_status_codes
372 ${hex_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
373
374Configure Negative Octet IP
375 [Documentation] Configure invalid IP address containing negative octet.
376 [Tags] Configure_Negative_Octet_IP
377 [Template] Add IP Address
378
379 # ip subnet_mask gateway valid_status_codes
380 ${negative_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
381
Prashanth Katti5cad5a02019-06-20 07:27:10 -0500382Configure Incomplete IP For Gateway
383 [Documentation] Configure incomplete IP for gateway and expect an error.
384 [Tags] Configure_Incomplete_IP_For_Gateway
385 [Template] Add IP Address
386
387 # ip subnet_mask gateway valid_status_codes
388 ${test_ipv4_addr} ${test_subnet_mask} ${less_octet_ip} ${HTTP_BAD_REQUEST}
389
390Configure Special Char IP For Gateway
391 [Documentation] Configure special char IP for gateway and expect an error.
392 [Tags] Configure_Special_Char_IP_For_Gateway
393 [Template] Add IP Address
394
395 # ip subnet_mask gateway valid_status_codes
396 ${test_ipv4_addr} ${test_subnet_mask} @@@.%%.44.11 ${HTTP_BAD_REQUEST}
397
398Configure Hexadecimal IP For Gateway
399 [Documentation] Configure hexadecimal IP for gateway and expect an error.
400 [Tags] Configure_Hexadecimal_IP_For_Gateway
401 [Template] Add IP Address
402
403 # ip subnet_mask gateway valid_status_codes
404 ${test_ipv4_addr} ${test_subnet_mask} ${hex_ip} ${HTTP_BAD_REQUEST}
405
Prashanth Katti7098c972019-07-03 06:56:42 -0500406Get DNS Server And Verify
407 [Documentation] Get DNS server via Redfish and verify.
408 [Tags] Get_DNS_Server_And_Verify
409
410 Verify CLI and Redfish Nameservers
411
412Configure DNS Server And Verify
413 [Documentation] Configure DNS server and verify.
414 [Tags] Configure_DNS_Server_And_Verify
Prashanth Kattic85957c2019-07-09 02:01:20 -0500415 [Setup] DNS Test Setup Execution
Prashanth Katti7098c972019-07-03 06:56:42 -0500416 [Teardown] Run Keywords
417 ... Configure Static Name Servers AND Test Teardown Execution
418
Prashanth Katti7098c972019-07-03 06:56:42 -0500419 Configure Static Name Servers ${static_name_servers}
420 Verify CLI and Redfish Nameservers
421
Prashanth Kattic85957c2019-07-09 02:01:20 -0500422Delete DNS Server And Verify
423 [Documentation] Delete DNS server and verify.
424 [Tags] Delete_DNS_Server_And_Verify
425 [Setup] DNS Test Setup Execution
426 [Teardown] Run Keywords
427 ... Configure Static Name Servers AND Test Teardown Execution
428
429 Delete Static Name Servers
430 Verify CLI and Redfish Nameservers
431
432Configure DNS Server And Check Persistency
433 [Documentation] Configure DNS server and check persistency on reboot.
434 [Tags] Configure_DNS_Server_And_Check_Persistency
435 [Setup] DNS Test Setup Execution
436 [Teardown] Run Keywords
437 ... Configure Static Name Servers AND Test Teardown Execution
438
439 Configure Static Name Servers ${static_name_servers}
440 # Reboot BMC and verify persistency.
Sweta Potthuri63f0b102022-08-03 23:11:46 -0500441 Redfish OBMC Reboot (off) stack_mode=skip
Anves Kumar rayankula8c628b72021-02-05 05:03:45 -0600442 Redfish.Login
Prashanth Kattic85957c2019-07-09 02:01:20 -0500443 Verify CLI and Redfish Nameservers
444
Prashanth Katti3063ffe2019-07-25 04:35:25 -0500445Configure Loopback IP For Gateway
446 [Documentation] Configure loopback IP for gateway and expect an error.
447 [Tags] Configure_Loopback_IP_For_Gateway
448 [Template] Add IP Address
449 [Teardown] Clear IP Settings On Fail ${test_ipv4_addr}
450
451 # ip subnet_mask gateway valid_status_codes
452 ${test_ipv4_addr} ${test_subnet_mask} ${loopback_ip} ${HTTP_BAD_REQUEST}
453
454Configure Network ID For Gateway
455 [Documentation] Configure network ID for gateway and expect an error.
456 [Tags] Configure_Network_ID_For_Gateway
457 [Template] Add IP Address
458 [Teardown] Clear IP Settings On Fail ${test_ipv4_addr}
459
460 # ip subnet_mask gateway valid_status_codes
461 ${test_ipv4_addr} ${test_subnet_mask} ${network_id} ${HTTP_BAD_REQUEST}
462
463Configure Multicast IP For Gateway
464 [Documentation] Configure multicast IP for gateway and expect an error.
465 [Tags] Configure_Multicast_IP_For_Gateway
466 [Template] Add IP Address
467 [Teardown] Clear IP Settings On Fail ${test_ipv4_addr}
468
469 # ip subnet_mask gateway valid_status_codes
Tony Lee412c6682020-04-01 17:34:30 +0800470 ${test_ipv4_addr} ${test_subnet_mask} ${multicast_ip} ${HTTP_BAD_REQUEST}
Prashanth Katti3063ffe2019-07-25 04:35:25 -0500471
472Configure Broadcast IP For Gateway
473 [Documentation] Configure broadcast IP for gateway and expect an error.
474 [Tags] Configure_Broadcast_IP_For_Gateway
475 [Template] Add IP Address
476 [Teardown] Clear IP Settings On Fail ${test_ipv4_addr}
477
478 # ip subnet_mask gateway valid_status_codes
479 ${test_ipv4_addr} ${test_subnet_mask} ${broadcast_ip} ${HTTP_BAD_REQUEST}
Prashanth Kattic85957c2019-07-09 02:01:20 -0500480
Prashanth Katti3c7b6432019-07-26 06:53:37 -0500481Configure Null Value For DNS Server
482 [Documentation] Configure null value for DNS server and expect an error.
483 [Tags] Configure_Null_Value_For_DNS_Server
484 [Setup] DNS Test Setup Execution
485 [Teardown] Run Keywords
486 ... Configure Static Name Servers AND Test Teardown Execution
487
488 Configure Static Name Servers ${null_value} ${HTTP_BAD_REQUEST}
489
Prashanth Kattiafe16b72019-08-02 00:29:45 -0500490Configure Empty Value For DNS Server
491 [Documentation] Configure empty value for DNS server and expect an error.
492 [Tags] Configure_Empty_Value_For_DNS_Server
493 [Setup] DNS Test Setup Execution
494 [Teardown] Run Keywords
495 ... Configure Static Name Servers AND Test Teardown Execution
496
497 Configure Static Name Servers ${empty_dictionary} ${HTTP_BAD_REQUEST}
498
499Configure String Value For DNS Server
500 [Documentation] Configure string value for DNS server and expect an error.
501 [Tags] Configure_String_Value_For_DNS_Server
502 [Setup] DNS Test Setup Execution
503 [Teardown] Run Keywords
504 ... Configure Static Name Servers AND Test Teardown Execution
505
506 Configure Static Name Servers ${string_value} ${HTTP_BAD_REQUEST}
507
Prashanth Katti568df5f2020-05-15 06:00:37 -0500508Modify IPv4 Address And Verify
509 [Documentation] Modify IP address via Redfish and verify.
George Keishing0c8100f2022-01-13 00:24:57 -0600510 [Tags] Modify_IPv4_Address_And_Verify
Prashanth Katti568df5f2020-05-15 06:00:37 -0500511 [Teardown] Run Keywords
Anves Kumar rayankula045814b2020-10-09 09:17:05 -0500512 ... Delete IP Address ${test_ipv4_addr2} AND Test Teardown Execution
Prashanth Katti568df5f2020-05-15 06:00:37 -0500513
514 Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway}
515
516 Update IP Address ${test_ipv4_addr} ${test_ipv4_addr2} ${test_subnet_mask} ${test_gateway}
517
Sweta Potthuri6e704782022-09-27 01:23:48 -0500518Verify Modifying IP Address Multiple Times
519 [Documentation] Verify modifying IP address multiple times.
520 [Tags] Verify_Modifying_IP_Address_Multiple_Times
521 [Teardown] Run Keywords
522 ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution
523
524 Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway}
525 Update IP Address ${test_ipv4_addr} ${test_ipv4_addr2} ${test_subnet_mask} ${test_gateway}
Sweta Potthurie392cc72022-11-15 06:54:21 -0600526 Update IP Address ${test_ipv4_addr2} ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway}
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500527
Anves Kumar rayankula6b9fcd12020-12-18 01:03:19 -0600528Configure Invalid Values For DNS Server
529 [Documentation] Configure invalid values for DNS server and expect an error.
George Keishing5236ec52022-01-31 12:07:58 -0600530 [Tags] Configure_Invalid_Values_For_DNS_Server
Anves Kumar rayankula6b9fcd12020-12-18 01:03:19 -0600531 [Setup] DNS Test Setup Execution
532 [Template] Configure Static Name Servers
533 [Teardown] Run Keywords
534 ... Configure Static Name Servers AND Test Teardown Execution
535
536 # static_name_servers valid_status_codes
537 0xa.0xb.0xc.0xd ${HTTP_BAD_REQUEST}
538 10.-7.-7.-7 ${HTTP_BAD_REQUEST}
539 10.3.36 ${HTTP_BAD_REQUEST}
540 @@@.%%.44.11 ${HTTP_BAD_REQUEST}
541
542
543Config Multiple DNS Servers And Verify
544 [Documentation] Config multiple DNS servers and verify.
545 [Tags] Config_Multiple_DNS_Servers_And_Verify
546 [Setup] DNS Test Setup Execution
547 [Teardown] Run Keywords
548 ... Configure Static Name Servers AND Test Teardown Execution
549
550 @{list_name_servers}= Create List 10.5.5.10 10.20.5.10 10.5.6.7
551 Configure Static Name Servers ${list_name_servers}
552 Verify CLI and Redfish Nameservers
553
554
Anves Kumar rayankulad4cdd8c2021-01-11 04:10:05 -0600555Configure And Verify Multiple Static IPv4 Addresses
556 [Documentation] Configure multiple static ipv4 address via Redfish and verify.
557 [Tags] Configure_And_Verify_Multiple_Static_IPv4_Addresses
558 [Teardown] Run Keywords Delete Multiple Static IPv4 Addresses ${test_ipv4_addresses}
559 ... AND Test Teardown Execution
560
561 ${test_ipv4_addresses}= Create List ${test_ipv4_addr} ${test_ipv4_addr2}
562 Configure Multiple Static IPv4 Addresses ${test_ipv4_addresses} ${test_subnet_mask} ${test_gateway}
563
564
565Configure Multiple Static IPv4 Addresses And Check Persistency
566 [Documentation] Configure multiple static ipv4 address via Redfish and check persistency.
567 [Tags] Configure_Multiple_Static_IPv4_Addresses_And_Check_Persistency
568 [Teardown] Run Keywords Delete Multiple Static IPv4 Addresses ${test_ipv4_addresses}
569 ... AND Test Teardown Execution
570
571 ${test_ipv4_addresses}= Create List ${test_ipv4_addr} ${test_ipv4_addr2}
572 Configure Multiple Static IPv4 Addresses ${test_ipv4_addresses} ${test_subnet_mask} ${test_gateway}
573
574 # Reboot BMC and verify persistency.
Sweta Potthuri63f0b102022-08-03 23:11:46 -0500575 Redfish OBMC Reboot (off) stack_mode=skip
Anves Kumar rayankula8c628b72021-02-05 05:03:45 -0600576 Redfish.Login
Anves Kumar rayankulad4cdd8c2021-01-11 04:10:05 -0600577 FOR ${ip} IN @{test_ipv4_addresses}
578 Verify IP And Netmask On BMC ${ip} ${test_subnet_mask}
nagarjunb2260784a42022-06-13 10:39:33 +0530579 Verify IP On Redfish URI ${ip}
Anves Kumar rayankulad4cdd8c2021-01-11 04:10:05 -0600580 END
581
582
Anves Kumar rayankula43e93e12021-01-27 03:52:37 -0600583Configure And Verify Multiple IPv4 Addresses
584 [Documentation] Configure multiple IPv4 addresses and verify.
George Keishing0c8100f2022-01-13 00:24:57 -0600585 [Tags] Configure_And_Verify_Multiple_IPv4_Addresses
Anves Kumar rayankula43e93e12021-01-27 03:52:37 -0600586 [Teardown] Run Keywords
587 ... Delete IP Address ${test_ipv4_addr} AND Delete IP Address ${test_ipv4_addr2}
588 ... AND Test Teardown Execution
589
590 ${ip1}= Create dictionary Address=${test_ipv4_addr}
591 ... SubnetMask=255.255.0.0 Gateway=${test_gateway}
592 ${ip2}= Create dictionary Address=${test_ipv4_addr2}
593 ... SubnetMask=255.255.252.0 Gateway=${test_gateway}
594
595 ${empty_dict}= Create Dictionary
596 ${patch_list}= Create List
597 ${network_configurations}= Get Network Configuration
598 ${num_entries}= Get Length ${network_configurations}
599
600 FOR ${INDEX} IN RANGE 0 ${num_entries}
601 Append To List ${patch_list} ${empty_dict}
602 END
603
604 # We need not check for existence of IP on BMC while adding.
605 Append To List ${patch_list} ${ip1} ${ip2}
606 ${payload}= Create Dictionary IPv4StaticAddresses=${patch_list}
607 ${active_channel_config}= Get Active Channel Config
608 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
609 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{payload}
Anves Kumar rayankula53b80302021-05-21 01:50:03 -0500610 ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
Anves Kumar rayankula43e93e12021-01-27 03:52:37 -0600611
612 # Note: Network restart takes around 15-18s after patch request processing.
613 Sleep ${NETWORK_TIMEOUT}s
614 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
615 Verify IP On BMC ${test_ipv4_addr}
616 Verify IP On BMC ${test_ipv4_addr2}
617
618
Anves Kumar rayankulaeefdb562021-02-08 07:54:11 -0600619Config Multiple DNS Servers And Check Persistency
620 [Documentation] Config multiple DNS and check persistency.
621 [Tags] Config_Multiple_DNS_Servers_And_Check_Persistency
622 [Setup] DNS Test Setup Execution
623 [Teardown] Run Keywords
624 ... Configure Static Name Servers AND Test Teardown Execution
625
626 @{list_name_servers}= Create List 10.5.5.10 10.20.5.10 10.5.6.7
627 Configure Static Name Servers ${list_name_servers}
628
629 # Reboot BMC and verify persistency.
Sweta Potthuri63f0b102022-08-03 23:11:46 -0500630 Redfish OBMC Reboot (off) stack_mode=skip
Anves Kumar rayankulaeefdb562021-02-08 07:54:11 -0600631 Redfish.Login
632 Verify CLI and Redfish Nameservers
633
Anves Kumar rayankula2f137eb2021-03-29 01:12:01 -0500634
635Configure Static IP Without Using Gateway And Verify
636 [Documentation] Configure static IP without using gateway and verify error.
637 [Tags] Configure_Static_IP_Without_Using_Gateway_And_Verify
638
639 ${ip}= Create dictionary Address=${test_ipv4_addr}
640 ... SubnetMask=${test_subnet_mask}
641 ${empty_dict}= Create Dictionary
642 ${patch_list}= Create List
643 ${network_configurations}= Get Network Configuration
644
645 ${num_entries}= Get Length ${network_configurations}
646 FOR ${INDEX} IN RANGE 0 ${num_entries}
647 Append To List ${patch_list} ${empty_dict}
648 END
649
650 # We need not check for existence of IP on BMC while adding.
651 Append To List ${patch_list} ${ip}
652 ${payload}= Create Dictionary IPv4StaticAddresses=${patch_list}
653 ${active_channel_config}= Get Active Channel Config
654 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
655 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
656 ... body=&{payload} valid_status_codes=[${HTTP_BAD_REQUEST}]
657
Anves Kumar rayankulaac0a7ba2021-03-09 08:10:20 -0600658
659Test Network Response On Specified Host State
660 [Documentation] Verifying the BMC network response when host is on and off.
661 [Tags] Test_Network_Response_On_Specified_Host_State
662 [Template] Verify Network Response On Specified Host State
663
664 # host_state
665 on
666 off
667
Sweta Potthurifb001362022-03-14 02:21:14 -0500668
Prashanth Kattif58cce02019-02-06 03:05:14 -0600669*** Keywords ***
670
671Test Setup Execution
672 [Documentation] Test setup execution.
673
George Keishing97c93942019-03-04 12:45:07 -0600674 Redfish.Login
Prashanth Kattif58cce02019-02-06 03:05:14 -0600675
676 @{network_configurations}= Get Network Configuration
677 Set Test Variable @{network_configurations}
678
679 # Get BMC IP address and prefix length.
680 ${ip_data}= Get BMC IP Info
681 Set Test Variable ${ip_data}
682
Prashanth Katti747ce9d2019-02-07 07:23:48 -0600683
Prashanth Katti747ce9d2019-02-07 07:23:48 -0600684Verify Netmask On BMC
685 [Documentation] Verify netmask on BMC.
Prashanth Kattif58cce02019-02-06 03:05:14 -0600686 [Arguments] ${netmask}
687
688 # Description of the argument(s):
689 # netmask netmask value to be verified.
690
Prashanth Katti747ce9d2019-02-07 07:23:48 -0600691 ${prefix_length}= Netmask Prefix Length ${netmask}
692
693 Should Contain Match ${ip_data} */${prefix_length}
694 ... msg=Prefix length does not exist.
Prashanth Kattif58cce02019-02-06 03:05:14 -0600695
Prashanth Katti2c5c3bb2019-02-14 04:23:07 -0600696Verify IP And Netmask On BMC
697 [Documentation] Verify IP and netmask on BMC.
698 [Arguments] ${ip} ${netmask}
699
700 # Description of the argument(s):
701 # ip IP address to be verified.
702 # netmask netmask value to be verified.
703
704 ${prefix_length}= Netmask Prefix Length ${netmask}
705 @{ip_data}= Get BMC IP Info
706
707 ${ip_with_netmask}= Catenate ${ip}/${prefix_length}
708 Should Contain ${ip_data} ${ip_with_netmask}
709 ... msg=IP and netmask pair does not exist.
710
Prashanth Kattif58cce02019-02-06 03:05:14 -0600711Test Teardown Execution
712 [Documentation] Test teardown execution.
713
714 FFDC On Test Case Fail
George Keishing97c93942019-03-04 12:45:07 -0600715 Redfish.Logout
Prashanth Kattia8442512019-06-07 06:47:09 -0500716
717Clear IP Settings On Fail
718 [Documentation] Clear IP settings on fail.
719 [Arguments] ${ip}
720
721 # Description of argument(s):
722 # ip IP address to be deleted.
723
724 Run Keyword If '${TEST STATUS}' == 'FAIL'
725 ... Delete IP Address ${ip}
726
727 Test Teardown Execution
Prashanth Kattiadf0b4e2019-06-10 04:20:30 -0500728
Prashanth Katti7098c972019-07-03 06:56:42 -0500729Verify CLI and Redfish Nameservers
730 [Documentation] Verify that nameservers obtained via Redfish do not
731 ... match those found in /etc/resolv.conf.
732
Tony Lee412c6682020-04-01 17:34:30 +0800733 ${active_channel_config}= Get Active Channel Config
734 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
735
Anves Kumar rayankula91548ea2020-06-18 00:28:13 -0500736 ${redfish_nameservers}= Redfish.Get Attribute
737 ... ${REDFISH_NW_ETH_IFACE}${ethernet_interface} StaticNameServers
Prashanth Katti7098c972019-07-03 06:56:42 -0500738 ${resolve_conf_nameservers}= CLI Get Nameservers
Michael Walsh39c00512019-07-17 10:54:06 -0500739 Rqprint Vars redfish_nameservers resolve_conf_nameservers
Prashanth Katti7098c972019-07-03 06:56:42 -0500740
Sweta Potthurid77ea982021-07-01 04:30:38 -0500741 List Should Contain Sub List ${resolve_conf_nameservers} ${redfish_nameservers}
742 ... msg=The nameservers obtained via Redfish do not match those found in /etc/resolv.conf.
Prashanth Katti7098c972019-07-03 06:56:42 -0500743
Prashanth Kattib478d902020-05-08 10:05:32 -0500744Suite Setup Execution
745 [Documentation] Do suite setup execution.
746
aravinth0510ca054ee2022-06-16 13:26:15 +0000747 # - Get DHCP IPv4 enabled/disabled status from redfish managers URI
748 # - If DHCP IPv4 is enabled ,
749 # - Get DHCP IPv4 settings - ip address, gateway, subnetmask
750 # - And set the same as static IP address
751
George Keishing1ac42212022-07-20 21:55:49 -0500752 Redfish.Login
Anvesh Kumar59188b62023-12-12 08:03:14 -0600753 ${DHCPEnabled}= Get IPv4 DHCP Enabled Status ${CHANNEL_NUMBER}
aravinth0510ca054ee2022-06-16 13:26:15 +0000754 Set Suite Variable ${DHCPEnabled}
755
Anvesh Kumar59188b62023-12-12 08:03:14 -0600756 ${ip_addr} ${gateway} ${subnetmask}= Run Keyword If ${DHCPEnabled}==True
757 ... Get DHCP IP Info
758
aravinth0510ca054ee2022-06-16 13:26:15 +0000759 Run Keyword If ${DHCPEnabled}==True
Anvesh Kumar59188b62023-12-12 08:03:14 -0600760 ... Add IP Address ${ip_addr} ${subnetmask} ${gateway}
aravinth0510ca054ee2022-06-16 13:26:15 +0000761
Prashanth Kattib478d902020-05-08 10:05:32 -0500762 ${test_gateway}= Get BMC Default Gateway
763 Set Suite Variable ${test_gateway}
Prashanth Katti568df5f2020-05-15 06:00:37 -0500764
aravinth0510ca054ee2022-06-16 13:26:15 +0000765
766Suite Teardown Execution
767 [Documentation] Do suite teardown execution.
768
769 # - If the DHCP IPv4 is enabled before suite setup execution
770 # - Restore the DHCP IPv4 to enabled state
771
Anvesh Kumar59188b62023-12-12 08:03:14 -0600772 Redfish.Login
aravinth0510ca054ee2022-06-16 13:26:15 +0000773 Run Keyword If ${DHCPEnabled}==True
774 ... Enable IPv4 DHCP Settings
775
776
Anves Kumar rayankulad4cdd8c2021-01-11 04:10:05 -0600777Configure Multiple Static IPv4 Addresses
778 [Documentation] Configure multiple static ipv4 address via Redfish and verify.
779 [Arguments] ${ip_addreses} ${subnet_mask} ${gateway}
780
781 # Description of argument(s):
782 # ip_addreses A list of IP addresses to be added (e.g.["10.7.7.7"]).
783 # subnet_mask Subnet mask for the IP to be added (e.g. "255.255.0.0").
784 # gateway Gateway for the IP to be added (e.g. "10.7.7.1").
785
786 FOR ${ip} IN @{ip_addreses}
787 Add IP Address ${ip} ${subnet_mask} ${gateway}
788 END
789 Validate Network Config On BMC
790
791
792Delete Multiple Static IPv4 Addresses
793 [Documentation] Delete multiple static ipv4 address via Redfish.
794 [Arguments] ${ip_addreses}
795
796 # Description of argument(s):
797 # ip_addreses A list of IP addresses to be deleted (e.g.["10.7.7.7"]).
798
799 FOR ${ip} IN @{ip_addreses}
800 Delete IP Address ${ip}
801 END
802 Validate Network Config On BMC
Anves Kumar rayankulaac0a7ba2021-03-09 08:10:20 -0600803
804Verify Network Response On Specified Host State
805 [Documentation] Verifying the BMC network response when host is on and off.
806 [Arguments] ${host_state}
807
808 # Description of argument(s):
809 # host_state if host_state is on then host is booted to operating system.
810 # if host_state is off then host is power off.
811 # (eg. on, off).
812
813 ${active_channel_config}= Get Active Channel Config
814 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
815
816 Run Keyword If '${host_state}' == 'on'
817 ... Redfish Power On stack_mode=skip
818 ... ELSE
819 ... Redfish Power off stack_mode=skip
820
821 Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
822 Ping Host ${OPENBMC_HOST}
823
nagarjunb2260784a42022-06-13 10:39:33 +0530824
825Verify IP On Redfish URI
826 [Documentation] Verify given IP on redfish URI.
827 [Arguments] ${ip_address}
828
829 # Description of argument(s):
830 # ip_address Configured IP address which need to verified.
831
832 ${network_configurations}= Get Network Configuration
833
834 FOR ${network_configuration} IN @{network_configurations}
835 ${ip_found}= Set Variable If '${network_configuration['Address']}' == '${ip_address}' ${True}
836 ... ${False}
837 Exit For Loop If ${ip_found}
838 END
839 Run Keyword If '${ip_found}' == '${False}'
840 ... Fail msg=Configured IP address not found on EthernetInterface URI.
aravinth0510ca054ee2022-06-16 13:26:15 +0000841
842
843Enable IPv4 DHCP Settings
844 [Documentation] Set IPv4 DHCP enabled status true/false in redfish URI.
845 [Arguments] ${status}=${True}
846
847 # Description of argument(s):
848 # status IPv4 DHCPEnabled status which needs to be set.
849 # (e.g. True or False)
850
851 ${active_channel_config}= Get Active Channel Config
852 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
853 ${DHCPv4}= Create Dictionary DHCPEnabled=${status}
854
855 ${payload}= Create Dictionary DHCPv4=${DHCPv4}
856 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
857 ... body=&{payload} valid_status_codes=[${HTTP_NO_CONTENT}, ${HTTP_OK}]
858
859 Sleep ${NETWORK_TIMEOUT}s
860 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}