blob: 2ac890399aaaa1e128e3dafab7bdc52ae72e7121 [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
11Test Setup Test Setup Execution
12Test Teardown Test Teardown Execution
Prashanth Kattib478d902020-05-08 10:05:32 -050013Suite Setup Suite Setup Execution
Prashanth Kattif58cce02019-02-06 03:05:14 -060014
Prashanth Kattif34fafa2019-06-20 05:04:40 -050015Force Tags Network_Conf_Test
16
Prashanth Katti23efc6e2019-03-13 06:07:15 -050017*** Variables ***
Vijayde3bf7b2019-04-16 04:56:09 -050018${test_hostname} openbmc
19${test_ipv4_addr} 10.7.7.7
20${test_ipv4_invalid_addr} 0.0.1.a
21${test_subnet_mask} 255.255.0.0
Prashanth Kattib36a7522019-05-22 05:32:39 -050022${broadcast_ip} 10.7.7.255
23${loopback_ip} 127.0.0.2
24${multicast_ip} 224.6.6.6
25${out_of_range_ip} 10.7.7.256
Prashanth Katti568df5f2020-05-15 06:00:37 -050026${test_ipv4_addr2} 10.7.7.8
Prashanth Katti23efc6e2019-03-13 06:07:15 -050027
George Keishing16b3c7b2021-01-28 09:23:37 -060028# Valid netmask is 4 bytes long and has continuous block of 1s.
Prashanth Katti040c8c12019-05-31 04:42:05 -050029# Maximum valid value in each octet is 255 and least value is 0.
30# 253 is not valid, as binary value is 11111101.
31${invalid_netmask} 255.255.253.0
32${alpha_netmask} ff.ff.ff.ff
33# Maximum value of octet in netmask is 255.
34${out_of_range_netmask} 255.256.255.0
35${more_byte_netmask} 255.255.255.0.0
36${less_byte_netmask} 255.255.255
Prashanth Kattic6ad6472019-06-14 03:33:39 -050037${threshold_netmask} 255.255.255.255
38${lowest_netmask} 128.0.0.0
39
40# There will be 4 octets in IP address (e.g. xx.xx.xx.xx)
41# but trying to configure xx.xx.xx
42${less_octet_ip} 10.3.36
43
44# For the address 10.6.6.6, the 10.6.6.0 portion describes the
45# network ID and the 6 describe the host.
46
47${network_id} 10.7.7.0
48${hex_ip} 0xa.0xb.0xc.0xd
49${negative_ip} 10.-7.-7.7
Prashanth Katti7098c972019-07-03 06:56:42 -050050@{static_name_servers} 10.5.5.5
Prashanth Katti3c7b6432019-07-26 06:53:37 -050051@{null_value} null
Prashanth Kattiafe16b72019-08-02 00:29:45 -050052@{empty_dictionary} {}
53@{string_value} aa.bb.cc.dd
54
Prashanth Kattif58cce02019-02-06 03:05:14 -060055*** Test Cases ***
56
57Get IP Address And Verify
58 [Documentation] Get IP Address And Verify.
George Keishing5d467552019-02-08 23:30:48 -060059 [Tags] Get_IP_Address_And_Verify
Prashanth Kattif58cce02019-02-06 03:05:14 -060060
Sushil Singh50621142020-06-16 11:12:21 -050061 FOR ${network_configuration} IN @{network_configurations}
62 Verify IP On BMC ${network_configuration['Address']}
63 END
Prashanth Katti747ce9d2019-02-07 07:23:48 -060064
Prashanth Kattif58cce02019-02-06 03:05:14 -060065Get Netmask And Verify
66 [Documentation] Get Netmask And Verify.
George Keishing5d467552019-02-08 23:30:48 -060067 [Tags] Get_Netmask_And_Verify
Prashanth Kattif58cce02019-02-06 03:05:14 -060068
Sushil Singh50621142020-06-16 11:12:21 -050069 FOR ${network_configuration} IN @{network_configurations}
70 Verify Netmask On BMC ${network_configuration['SubnetMask']}
71 END
Prashanth Katti747ce9d2019-02-07 07:23:48 -060072
Prashanth Katti2ec9d8b2019-02-12 05:20:19 -060073Get Gateway And Verify
74 [Documentation] Get gateway and verify it's existence on the BMC.
75 [Tags] Get_Gateway_And_Verify
76
Sushil Singh50621142020-06-16 11:12:21 -050077 FOR ${network_configuration} IN @{network_configurations}
78 Verify Gateway On BMC ${network_configuration['Gateway']}
79 END
Prashanth Katti2ec9d8b2019-02-12 05:20:19 -060080
81Get MAC Address And Verify
82 [Documentation] Get MAC address and verify it's existence on the BMC.
83 [Tags] Get_MAC_Address_And_Verify
84
Tony Lee412c6682020-04-01 17:34:30 +080085 ${active_channel_config}= Get Active Channel Config
86 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
87
88 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
Prashanth Katti2ec9d8b2019-02-12 05:20:19 -060089 ${macaddr}= Get From Dictionary ${resp.dict} MACAddress
90 Validate MAC On BMC ${macaddr}
Prashanth Kattif58cce02019-02-06 03:05:14 -060091
Prashanth Katti2c5c3bb2019-02-14 04:23:07 -060092Verify All Configured IP And Netmask
93 [Documentation] Verify all configured IP and netmask on BMC.
94 [Tags] Verify_All_Configured_IP_And_Netmask
95
Sushil Singh50621142020-06-16 11:12:21 -050096 FOR ${network_configuration} IN @{network_configurations}
97 Verify IP And Netmask On BMC ${network_configuration['Address']}
98 ... ${network_configuration['SubnetMask']}
99 END
Prashanth Katti2c5c3bb2019-02-14 04:23:07 -0600100
Prashanth Katti23efc6e2019-03-13 06:07:15 -0500101Get Hostname And Verify
102 [Documentation] Get hostname via Redfish and verify.
103 [Tags] Get_Hostname_And_Verify
104
105 ${hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName
106
107 Validate Hostname On BMC ${hostname}
108
109Configure Hostname And Verify
110 [Documentation] Configure hostname via Redfish and verify.
111 [Tags] Configure_Hostname_And_Verify
shrsuman123578276c2020-08-04 04:28:58 -0500112 [Teardown] Run Keywords
113 ... Configure Hostname ${hostname} AND Validate Hostname On BMC ${hostname}
Prashanth Katti23efc6e2019-03-13 06:07:15 -0500114
Prashanth Kattiadf0b4e2019-06-10 04:20:30 -0500115 ${hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName
Prashanth Katti23efc6e2019-03-13 06:07:15 -0500116
Prashanth Kattiadf0b4e2019-06-10 04:20:30 -0500117 Configure Hostname ${test_hostname}
Prashanth Katti23efc6e2019-03-13 06:07:15 -0500118 Validate Hostname On BMC ${test_hostname}
119
nagarjunb2260784a42022-06-13 10:39:33 +0530120 # Verify configured hostname via redfish.
121 ${new_hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName
122 Should Be Equal ${new_hostname} ${test_hostname}
123
Prashanth Kattiadf0b4e2019-06-10 04:20:30 -0500124
Vijayde3bf7b2019-04-16 04:56:09 -0500125Add Valid IPv4 Address And Verify
126 [Documentation] Add IPv4 Address via Redfish and verify.
George Keishing0c8100f2022-01-13 00:24:57 -0600127 [Tags] Add_Valid_IPv4_Address_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500128 [Teardown] Run Keywords
129 ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution
Vijayde3bf7b2019-04-16 04:56:09 -0500130
131 Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway}
Vijayde3bf7b2019-04-16 04:56:09 -0500132
133Add Invalid IPv4 Address And Verify
134 [Documentation] Add Invalid IPv4 Address via Redfish and verify.
George Keishing0c8100f2022-01-13 00:24:57 -0600135 [Tags] Add_Invalid_IPv4_Address_And_Verify
Vijayde3bf7b2019-04-16 04:56:09 -0500136
137 Add IP Address ${test_ipv4_invalid_addr} ${test_subnet_mask}
138 ... ${test_gateway} valid_status_codes=${HTTP_BAD_REQUEST}
139
Prashanth Kattib36a7522019-05-22 05:32:39 -0500140Configure Out Of Range IP
141 [Documentation] Configure out-of-range IP address.
142 [Tags] Configure_Out_Of_Range_IP
143 [Template] Add IP Address
144
145 # ip subnet_mask gateway valid_status_codes
146 ${out_of_range_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
147
148Configure Broadcast IP
149 [Documentation] Configure broadcast IP address.
150 [Tags] Configure_Broadcast_IP
151 [Template] Add IP Address
Prashanth Kattic6ad6472019-06-14 03:33:39 -0500152 [Teardown] Clear IP Settings On Fail ${broadcast_ip}
Prashanth Kattib36a7522019-05-22 05:32:39 -0500153
154 # ip subnet_mask gateway valid_status_codes
155 ${broadcast_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
156
157Configure Multicast IP
158 [Documentation] Configure multicast IP address.
159 [Tags] Configure_Multicast_IP
160 [Template] Add IP Address
Prashanth Kattic6ad6472019-06-14 03:33:39 -0500161 [Teardown] Clear IP Settings On Fail ${multicast_ip}
Prashanth Kattib36a7522019-05-22 05:32:39 -0500162
163 # ip subnet_mask gateway valid_status_codes
164 ${multicast_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
165
166Configure Loopback IP
167 [Documentation] Configure loopback IP address.
168 [Tags] Configure_Loopback_IP
169 [Template] Add IP Address
Prashanth Kattic6ad6472019-06-14 03:33:39 -0500170 [Teardown] Clear IP Settings On Fail ${loopback_ip}
Prashanth Kattib36a7522019-05-22 05:32:39 -0500171
172 # ip subnet_mask gateway valid_status_codes
173 ${loopback_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
174
175Add Valid IPv4 Address And Check Persistency
nagarjunb2260784a42022-06-13 10:39:33 +0530176 [Documentation] Add IPv4 address and check persistency.
George Keishing0c8100f2022-01-13 00:24:57 -0600177 [Tags] Add_Valid_IPv4_Address_And_Check_Persistency
nagarjunb2260784a42022-06-13 10:39:33 +0530178 [Teardown] Run Keywords
179 ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution
Prashanth Kattib36a7522019-05-22 05:32:39 -0500180
181 Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway}
182
183 # Reboot BMC and verify persistency.
184 OBMC Reboot (off)
George Keishing5c498742019-08-09 02:14:44 -0500185 Redfish.Login
Prashanth Kattib36a7522019-05-22 05:32:39 -0500186 Verify IP On BMC ${test_ipv4_addr}
nagarjunb2260784a42022-06-13 10:39:33 +0530187 Verify IP On Redfish URI ${test_ipv4_addr}
188
Vijayde3bf7b2019-04-16 04:56:09 -0500189
Prashanth Katti6cedca22019-05-30 02:31:11 -0500190Add Fourth Octet Threshold IP And Verify
191 [Documentation] Add fourth octet threshold IP and verify.
192 [Tags] Add_Fourth_Octet_Threshold_IP_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500193 [Teardown] Run Keywords
194 ... Delete IP Address 10.7.7.254 AND Test Teardown Execution
Prashanth Katti6cedca22019-05-30 02:31:11 -0500195
196 Add IP Address 10.7.7.254 ${test_subnet_mask} ${test_gateway}
Prashanth Katti6cedca22019-05-30 02:31:11 -0500197
198Add Fourth Octet Lowest IP And Verify
199 [Documentation] Add fourth octet lowest IP and verify.
200 [Tags] Add_Fourth_Octet_Lowest_IP_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500201 [Teardown] Run Keywords
202 ... Delete IP Address 10.7.7.1 AND Test Teardown Execution
Prashanth Katti6cedca22019-05-30 02:31:11 -0500203
204 Add IP Address 10.7.7.1 ${test_subnet_mask} ${test_gateway}
Prashanth Katti6cedca22019-05-30 02:31:11 -0500205
206Add Third Octet Threshold IP And Verify
207 [Documentation] Add third octet threshold IP and verify.
208 [Tags] Add_Third_Octet_Threshold_IP_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500209 [Teardown] Run Keywords
210 ... Delete IP Address 10.7.255.7 AND Test Teardown Execution
Prashanth Katti6cedca22019-05-30 02:31:11 -0500211
212 Add IP Address 10.7.255.7 ${test_subnet_mask} ${test_gateway}
Prashanth Katti6cedca22019-05-30 02:31:11 -0500213
214Add Third Octet Lowest IP And Verify
215 [Documentation] Add third octet lowest IP and verify.
216 [Tags] Add_Third_Octet_Lowest_IP_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500217 [Teardown] Run Keywords
218 ... Delete IP Address 10.7.0.7 AND Test Teardown Execution
Prashanth Katti6cedca22019-05-30 02:31:11 -0500219
220 Add IP Address 10.7.0.7 ${test_subnet_mask} ${test_gateway}
Prashanth Katti6cedca22019-05-30 02:31:11 -0500221
222Add Second Octet Threshold IP And Verify
223 [Documentation] Add second octet threshold IP and verify.
224 [Tags] Add_Second_Octet_Threshold_IP_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500225 [Teardown] Run Keywords
226 ... Delete IP Address 10.255.7.7 AND Test Teardown Execution
Prashanth Katti6cedca22019-05-30 02:31:11 -0500227
228 Add IP Address 10.255.7.7 ${test_subnet_mask} ${test_gateway}
Prashanth Katti6cedca22019-05-30 02:31:11 -0500229
230Add Second Octet Lowest IP And Verify
231 [Documentation] Add second octet lowest IP and verify.
232 [Tags] Add_Second_Octet_Lowest_IP_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500233 [Teardown] Run Keywords
234 ... Delete IP Address 10.0.7.7 AND Test Teardown Execution
Prashanth Katti6cedca22019-05-30 02:31:11 -0500235
236 Add IP Address 10.0.7.7 ${test_subnet_mask} ${test_gateway}
Prashanth Katti6cedca22019-05-30 02:31:11 -0500237
238Add First Octet Threshold IP And Verify
239 [Documentation] Add first octet threshold IP and verify.
240 [Tags] Add_First_Octet_Threshold_IP_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500241 [Teardown] Run Keywords
Anves Kumar rayankulaf757b102020-07-27 20:41:36 -0500242 ... Delete IP Address 223.7.7.7 AND Test Teardown Execution
Prashanth Katti6cedca22019-05-30 02:31:11 -0500243
244 Add IP Address 223.7.7.7 ${test_subnet_mask} ${test_gateway}
Prashanth Katti6cedca22019-05-30 02:31:11 -0500245
246Add First Octet Lowest IP And Verify
247 [Documentation] Add first octet lowest IP and verify.
248 [Tags] Add_First_Octet_Lowest_IP_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500249 [Teardown] Run Keywords
250 ... Delete IP Address 1.7.7.7 AND Test Teardown Execution
Prashanth Katti6cedca22019-05-30 02:31:11 -0500251
252 Add IP Address 1.7.7.7 ${test_subnet_mask} ${test_gateway}
Prashanth Katti6cedca22019-05-30 02:31:11 -0500253
Prashanth Katti040c8c12019-05-31 04:42:05 -0500254Configure Invalid Netmask
255 [Documentation] Verify error while setting invalid netmask.
256 [Tags] Configure_Invalid_Netmask
257 [Template] Add IP Address
258
259 # ip subnet_mask gateway valid_status_codes
260 ${test_ipv4_addr} ${invalid_netmask} ${test_gateway} ${HTTP_BAD_REQUEST}
261
262Configure Out Of Range Netmask
263 [Documentation] Verify error while setting out of range netmask.
264 [Tags] Configure_Out_Of_Range_Netmask
265 [Template] Add IP Address
266
267 # ip subnet_mask gateway valid_status_codes
268 ${test_ipv4_addr} ${out_of_range_netmask} ${test_gateway} ${HTTP_BAD_REQUEST}
269
270Configure Alpha Netmask
271 [Documentation] Verify error while setting alpha netmask.
272 [Tags] Configure_Alpha_Netmask
273 [Template] Add IP Address
274
275 # ip subnet_mask gateway valid_status_codes
276 ${test_ipv4_addr} ${alpha_netmask} ${test_gateway} ${HTTP_BAD_REQUEST}
277
278Configure More Byte Netmask
279 [Documentation] Verify error while setting more byte netmask.
280 [Tags] Configure_More_Byte_Netmask
281 [Template] Add IP Address
282
283 # ip subnet_mask gateway valid_status_codes
284 ${test_ipv4_addr} ${more_byte_netmask} ${test_gateway} ${HTTP_BAD_REQUEST}
285
286Configure Less Byte Netmask
287 [Documentation] Verify error while setting less byte netmask.
288 [Tags] Configure_Less_Byte_Netmask
289 [Template] Add IP Address
290
291 # ip subnet_mask gateway valid_status_codes
292 ${test_ipv4_addr} ${less_byte_netmask} ${test_gateway} ${HTTP_BAD_REQUEST}
293
Prashanth Kattic6ad6472019-06-14 03:33:39 -0500294Configure Threshold Netmask And Verify
295 [Documentation] Configure threshold netmask and verify.
George Keishing5236ec52022-01-31 12:07:58 -0600296 [Tags] Configure_Threshold_Netmask_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500297 [Teardown] Run Keywords
298 ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution
Prashanth Kattic6ad6472019-06-14 03:33:39 -0500299
300 Add IP Address ${test_ipv4_addr} ${threshold_netmask} ${test_gateway}
Prashanth Kattic6ad6472019-06-14 03:33:39 -0500301
302Configure Lowest Netmask And Verify
303 [Documentation] Configure lowest netmask and verify.
George Keishing5236ec52022-01-31 12:07:58 -0600304 [Tags] Configure_Lowest_Netmask_And_Verify
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500305 [Teardown] Run Keywords
306 ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution
Prashanth Kattic6ad6472019-06-14 03:33:39 -0500307
308 Add IP Address ${test_ipv4_addr} ${lowest_netmask} ${test_gateway}
Prashanth Kattic6ad6472019-06-14 03:33:39 -0500309
310Configure Network ID
311 [Documentation] Verify error while configuring network ID.
312 [Tags] Configure_Network_ID
313 [Template] Add IP Address
314 [Teardown] Clear IP Settings On Fail ${network_id}
315
316 # ip subnet_mask gateway valid_status_codes
317 ${network_id} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
318
319Configure Less Octet IP
320 [Documentation] Verify error while Configuring less octet IP address.
321 [Tags] Configure_Less_Octet_IP
322 [Template] Add IP Address
323
324 # ip subnet_mask gateway valid_status_codes
325 ${less_octet_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
326
327Configure Empty IP
328 [Documentation] Verify error while Configuring empty IP address.
329 [Tags] Configure_Empty_IP
330 [Template] Add IP Address
331
332 # ip subnet_mask gateway valid_status_codes
333 ${EMPTY} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
334
335Configure Special Char IP
336 [Documentation] Configure invalid IP address containing special chars.
337 [Tags] Configure_Special_Char_IP
338 [Template] Add IP Address
339
340 # ip subnet_mask gateway valid_status_codes
341 @@@.%%.44.11 ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
342
343Configure Hexadecimal IP
344 [Documentation] Configure invalid IP address containing hex value.
345 [Tags] Configure_Hexadecimal_IP
346 [Template] Add IP Address
347
348 # ip subnet_mask gateway valid_status_codes
349 ${hex_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
350
351Configure Negative Octet IP
352 [Documentation] Configure invalid IP address containing negative octet.
353 [Tags] Configure_Negative_Octet_IP
354 [Template] Add IP Address
355
356 # ip subnet_mask gateway valid_status_codes
357 ${negative_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST}
358
Prashanth Katti5cad5a02019-06-20 07:27:10 -0500359Configure Incomplete IP For Gateway
360 [Documentation] Configure incomplete IP for gateway and expect an error.
361 [Tags] Configure_Incomplete_IP_For_Gateway
362 [Template] Add IP Address
363
364 # ip subnet_mask gateway valid_status_codes
365 ${test_ipv4_addr} ${test_subnet_mask} ${less_octet_ip} ${HTTP_BAD_REQUEST}
366
367Configure Special Char IP For Gateway
368 [Documentation] Configure special char IP for gateway and expect an error.
369 [Tags] Configure_Special_Char_IP_For_Gateway
370 [Template] Add IP Address
371
372 # ip subnet_mask gateway valid_status_codes
373 ${test_ipv4_addr} ${test_subnet_mask} @@@.%%.44.11 ${HTTP_BAD_REQUEST}
374
375Configure Hexadecimal IP For Gateway
376 [Documentation] Configure hexadecimal IP for gateway and expect an error.
377 [Tags] Configure_Hexadecimal_IP_For_Gateway
378 [Template] Add IP Address
379
380 # ip subnet_mask gateway valid_status_codes
381 ${test_ipv4_addr} ${test_subnet_mask} ${hex_ip} ${HTTP_BAD_REQUEST}
382
Prashanth Katti7098c972019-07-03 06:56:42 -0500383Get DNS Server And Verify
384 [Documentation] Get DNS server via Redfish and verify.
385 [Tags] Get_DNS_Server_And_Verify
386
387 Verify CLI and Redfish Nameservers
388
389Configure DNS Server And Verify
390 [Documentation] Configure DNS server and verify.
391 [Tags] Configure_DNS_Server_And_Verify
Prashanth Kattic85957c2019-07-09 02:01:20 -0500392 [Setup] DNS Test Setup Execution
Prashanth Katti7098c972019-07-03 06:56:42 -0500393 [Teardown] Run Keywords
394 ... Configure Static Name Servers AND Test Teardown Execution
395
Prashanth Katti7098c972019-07-03 06:56:42 -0500396 Configure Static Name Servers ${static_name_servers}
397 Verify CLI and Redfish Nameservers
398
Prashanth Kattic85957c2019-07-09 02:01:20 -0500399Delete DNS Server And Verify
400 [Documentation] Delete DNS server and verify.
401 [Tags] Delete_DNS_Server_And_Verify
402 [Setup] DNS Test Setup Execution
403 [Teardown] Run Keywords
404 ... Configure Static Name Servers AND Test Teardown Execution
405
406 Delete Static Name Servers
407 Verify CLI and Redfish Nameservers
408
409Configure DNS Server And Check Persistency
410 [Documentation] Configure DNS server and check persistency on reboot.
411 [Tags] Configure_DNS_Server_And_Check_Persistency
412 [Setup] DNS Test Setup Execution
413 [Teardown] Run Keywords
414 ... Configure Static Name Servers AND Test Teardown Execution
415
416 Configure Static Name Servers ${static_name_servers}
417 # Reboot BMC and verify persistency.
418 OBMC Reboot (off)
Anves Kumar rayankula8c628b72021-02-05 05:03:45 -0600419 Redfish.Login
Prashanth Kattic85957c2019-07-09 02:01:20 -0500420 Verify CLI and Redfish Nameservers
421
Prashanth Katti3063ffe2019-07-25 04:35:25 -0500422Configure Loopback IP For Gateway
423 [Documentation] Configure loopback IP for gateway and expect an error.
424 [Tags] Configure_Loopback_IP_For_Gateway
425 [Template] Add IP Address
426 [Teardown] Clear IP Settings On Fail ${test_ipv4_addr}
427
428 # ip subnet_mask gateway valid_status_codes
429 ${test_ipv4_addr} ${test_subnet_mask} ${loopback_ip} ${HTTP_BAD_REQUEST}
430
431Configure Network ID For Gateway
432 [Documentation] Configure network ID for gateway and expect an error.
433 [Tags] Configure_Network_ID_For_Gateway
434 [Template] Add IP Address
435 [Teardown] Clear IP Settings On Fail ${test_ipv4_addr}
436
437 # ip subnet_mask gateway valid_status_codes
438 ${test_ipv4_addr} ${test_subnet_mask} ${network_id} ${HTTP_BAD_REQUEST}
439
440Configure Multicast IP For Gateway
441 [Documentation] Configure multicast IP for gateway and expect an error.
442 [Tags] Configure_Multicast_IP_For_Gateway
443 [Template] Add IP Address
444 [Teardown] Clear IP Settings On Fail ${test_ipv4_addr}
445
446 # ip subnet_mask gateway valid_status_codes
Tony Lee412c6682020-04-01 17:34:30 +0800447 ${test_ipv4_addr} ${test_subnet_mask} ${multicast_ip} ${HTTP_BAD_REQUEST}
Prashanth Katti3063ffe2019-07-25 04:35:25 -0500448
449Configure Broadcast IP For Gateway
450 [Documentation] Configure broadcast IP for gateway and expect an error.
451 [Tags] Configure_Broadcast_IP_For_Gateway
452 [Template] Add IP Address
453 [Teardown] Clear IP Settings On Fail ${test_ipv4_addr}
454
455 # ip subnet_mask gateway valid_status_codes
456 ${test_ipv4_addr} ${test_subnet_mask} ${broadcast_ip} ${HTTP_BAD_REQUEST}
Prashanth Kattic85957c2019-07-09 02:01:20 -0500457
Prashanth Katti3c7b6432019-07-26 06:53:37 -0500458Configure Null Value For DNS Server
459 [Documentation] Configure null value for DNS server and expect an error.
460 [Tags] Configure_Null_Value_For_DNS_Server
461 [Setup] DNS Test Setup Execution
462 [Teardown] Run Keywords
463 ... Configure Static Name Servers AND Test Teardown Execution
464
465 Configure Static Name Servers ${null_value} ${HTTP_BAD_REQUEST}
466
Prashanth Kattiafe16b72019-08-02 00:29:45 -0500467Configure Empty Value For DNS Server
468 [Documentation] Configure empty value for DNS server and expect an error.
469 [Tags] Configure_Empty_Value_For_DNS_Server
470 [Setup] DNS Test Setup Execution
471 [Teardown] Run Keywords
472 ... Configure Static Name Servers AND Test Teardown Execution
473
474 Configure Static Name Servers ${empty_dictionary} ${HTTP_BAD_REQUEST}
475
476Configure String Value For DNS Server
477 [Documentation] Configure string value for DNS server and expect an error.
478 [Tags] Configure_String_Value_For_DNS_Server
479 [Setup] DNS Test Setup Execution
480 [Teardown] Run Keywords
481 ... Configure Static Name Servers AND Test Teardown Execution
482
483 Configure Static Name Servers ${string_value} ${HTTP_BAD_REQUEST}
484
Prashanth Katti568df5f2020-05-15 06:00:37 -0500485Modify IPv4 Address And Verify
486 [Documentation] Modify IP address via Redfish and verify.
George Keishing0c8100f2022-01-13 00:24:57 -0600487 [Tags] Modify_IPv4_Address_And_Verify
Prashanth Katti568df5f2020-05-15 06:00:37 -0500488 [Teardown] Run Keywords
Anves Kumar rayankula045814b2020-10-09 09:17:05 -0500489 ... Delete IP Address ${test_ipv4_addr2} AND Test Teardown Execution
Prashanth Katti568df5f2020-05-15 06:00:37 -0500490
491 Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway}
492
493 Update IP Address ${test_ipv4_addr} ${test_ipv4_addr2} ${test_subnet_mask} ${test_gateway}
494
Anvesh Kumar9c7238d2020-04-21 03:56:21 -0500495
Anves Kumar rayankula6b9fcd12020-12-18 01:03:19 -0600496Configure Invalid Values For DNS Server
497 [Documentation] Configure invalid values for DNS server and expect an error.
George Keishing5236ec52022-01-31 12:07:58 -0600498 [Tags] Configure_Invalid_Values_For_DNS_Server
Anves Kumar rayankula6b9fcd12020-12-18 01:03:19 -0600499 [Setup] DNS Test Setup Execution
500 [Template] Configure Static Name Servers
501 [Teardown] Run Keywords
502 ... Configure Static Name Servers AND Test Teardown Execution
503
504 # static_name_servers valid_status_codes
505 0xa.0xb.0xc.0xd ${HTTP_BAD_REQUEST}
506 10.-7.-7.-7 ${HTTP_BAD_REQUEST}
507 10.3.36 ${HTTP_BAD_REQUEST}
508 @@@.%%.44.11 ${HTTP_BAD_REQUEST}
509
510
511Config Multiple DNS Servers And Verify
512 [Documentation] Config multiple DNS servers and verify.
513 [Tags] Config_Multiple_DNS_Servers_And_Verify
514 [Setup] DNS Test Setup Execution
515 [Teardown] Run Keywords
516 ... Configure Static Name Servers AND Test Teardown Execution
517
518 @{list_name_servers}= Create List 10.5.5.10 10.20.5.10 10.5.6.7
519 Configure Static Name Servers ${list_name_servers}
520 Verify CLI and Redfish Nameservers
521
522
Anves Kumar rayankulad4cdd8c2021-01-11 04:10:05 -0600523Configure And Verify Multiple Static IPv4 Addresses
524 [Documentation] Configure multiple static ipv4 address via Redfish and verify.
525 [Tags] Configure_And_Verify_Multiple_Static_IPv4_Addresses
526 [Teardown] Run Keywords Delete Multiple Static IPv4 Addresses ${test_ipv4_addresses}
527 ... AND Test Teardown Execution
528
529 ${test_ipv4_addresses}= Create List ${test_ipv4_addr} ${test_ipv4_addr2}
530 Configure Multiple Static IPv4 Addresses ${test_ipv4_addresses} ${test_subnet_mask} ${test_gateway}
531
532
533Configure Multiple Static IPv4 Addresses And Check Persistency
534 [Documentation] Configure multiple static ipv4 address via Redfish and check persistency.
535 [Tags] Configure_Multiple_Static_IPv4_Addresses_And_Check_Persistency
536 [Teardown] Run Keywords Delete Multiple Static IPv4 Addresses ${test_ipv4_addresses}
537 ... AND Test Teardown Execution
538
539 ${test_ipv4_addresses}= Create List ${test_ipv4_addr} ${test_ipv4_addr2}
540 Configure Multiple Static IPv4 Addresses ${test_ipv4_addresses} ${test_subnet_mask} ${test_gateway}
541
542 # Reboot BMC and verify persistency.
543 OBMC Reboot (off)
Anves Kumar rayankula8c628b72021-02-05 05:03:45 -0600544 Redfish.Login
Anves Kumar rayankulad4cdd8c2021-01-11 04:10:05 -0600545 FOR ${ip} IN @{test_ipv4_addresses}
546 Verify IP And Netmask On BMC ${ip} ${test_subnet_mask}
nagarjunb2260784a42022-06-13 10:39:33 +0530547 Verify IP On Redfish URI ${ip}
Anves Kumar rayankulad4cdd8c2021-01-11 04:10:05 -0600548 END
549
550
Anves Kumar rayankula43e93e12021-01-27 03:52:37 -0600551Configure And Verify Multiple IPv4 Addresses
552 [Documentation] Configure multiple IPv4 addresses and verify.
George Keishing0c8100f2022-01-13 00:24:57 -0600553 [Tags] Configure_And_Verify_Multiple_IPv4_Addresses
Anves Kumar rayankula43e93e12021-01-27 03:52:37 -0600554 [Teardown] Run Keywords
555 ... Delete IP Address ${test_ipv4_addr} AND Delete IP Address ${test_ipv4_addr2}
556 ... AND Test Teardown Execution
557
558 ${ip1}= Create dictionary Address=${test_ipv4_addr}
559 ... SubnetMask=255.255.0.0 Gateway=${test_gateway}
560 ${ip2}= Create dictionary Address=${test_ipv4_addr2}
561 ... SubnetMask=255.255.252.0 Gateway=${test_gateway}
562
563 ${empty_dict}= Create Dictionary
564 ${patch_list}= Create List
565 ${network_configurations}= Get Network Configuration
566 ${num_entries}= Get Length ${network_configurations}
567
568 FOR ${INDEX} IN RANGE 0 ${num_entries}
569 Append To List ${patch_list} ${empty_dict}
570 END
571
572 # We need not check for existence of IP on BMC while adding.
573 Append To List ${patch_list} ${ip1} ${ip2}
574 ${payload}= Create Dictionary IPv4StaticAddresses=${patch_list}
575 ${active_channel_config}= Get Active Channel Config
576 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
577 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{payload}
Anves Kumar rayankula53b80302021-05-21 01:50:03 -0500578 ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
Anves Kumar rayankula43e93e12021-01-27 03:52:37 -0600579
580 # Note: Network restart takes around 15-18s after patch request processing.
581 Sleep ${NETWORK_TIMEOUT}s
582 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
583 Verify IP On BMC ${test_ipv4_addr}
584 Verify IP On BMC ${test_ipv4_addr2}
585
586
Anves Kumar rayankulaeefdb562021-02-08 07:54:11 -0600587Config Multiple DNS Servers And Check Persistency
588 [Documentation] Config multiple DNS and check persistency.
589 [Tags] Config_Multiple_DNS_Servers_And_Check_Persistency
590 [Setup] DNS Test Setup Execution
591 [Teardown] Run Keywords
592 ... Configure Static Name Servers AND Test Teardown Execution
593
594 @{list_name_servers}= Create List 10.5.5.10 10.20.5.10 10.5.6.7
595 Configure Static Name Servers ${list_name_servers}
596
597 # Reboot BMC and verify persistency.
598 OBMC Reboot (off)
599 Redfish.Login
600 Verify CLI and Redfish Nameservers
601
Anves Kumar rayankula2f137eb2021-03-29 01:12:01 -0500602
603Configure Static IP Without Using Gateway And Verify
604 [Documentation] Configure static IP without using gateway and verify error.
605 [Tags] Configure_Static_IP_Without_Using_Gateway_And_Verify
606
607 ${ip}= Create dictionary Address=${test_ipv4_addr}
608 ... SubnetMask=${test_subnet_mask}
609 ${empty_dict}= Create Dictionary
610 ${patch_list}= Create List
611 ${network_configurations}= Get Network Configuration
612
613 ${num_entries}= Get Length ${network_configurations}
614 FOR ${INDEX} IN RANGE 0 ${num_entries}
615 Append To List ${patch_list} ${empty_dict}
616 END
617
618 # We need not check for existence of IP on BMC while adding.
619 Append To List ${patch_list} ${ip}
620 ${payload}= Create Dictionary IPv4StaticAddresses=${patch_list}
621 ${active_channel_config}= Get Active Channel Config
622 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
623 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
624 ... body=&{payload} valid_status_codes=[${HTTP_BAD_REQUEST}]
625
Anves Kumar rayankulaac0a7ba2021-03-09 08:10:20 -0600626
627Test Network Response On Specified Host State
628 [Documentation] Verifying the BMC network response when host is on and off.
629 [Tags] Test_Network_Response_On_Specified_Host_State
630 [Template] Verify Network Response On Specified Host State
631
632 # host_state
633 on
634 off
635
Sweta Potthurifb001362022-03-14 02:21:14 -0500636
Prashanth Kattif58cce02019-02-06 03:05:14 -0600637*** Keywords ***
638
639Test Setup Execution
640 [Documentation] Test setup execution.
641
George Keishing97c93942019-03-04 12:45:07 -0600642 Redfish.Login
Prashanth Kattif58cce02019-02-06 03:05:14 -0600643
644 @{network_configurations}= Get Network Configuration
645 Set Test Variable @{network_configurations}
646
647 # Get BMC IP address and prefix length.
648 ${ip_data}= Get BMC IP Info
649 Set Test Variable ${ip_data}
650
Prashanth Katti747ce9d2019-02-07 07:23:48 -0600651
Prashanth Katti747ce9d2019-02-07 07:23:48 -0600652Verify Netmask On BMC
653 [Documentation] Verify netmask on BMC.
Prashanth Kattif58cce02019-02-06 03:05:14 -0600654 [Arguments] ${netmask}
655
656 # Description of the argument(s):
657 # netmask netmask value to be verified.
658
Prashanth Katti747ce9d2019-02-07 07:23:48 -0600659 ${prefix_length}= Netmask Prefix Length ${netmask}
660
661 Should Contain Match ${ip_data} */${prefix_length}
662 ... msg=Prefix length does not exist.
Prashanth Kattif58cce02019-02-06 03:05:14 -0600663
Prashanth Katti2c5c3bb2019-02-14 04:23:07 -0600664Verify IP And Netmask On BMC
665 [Documentation] Verify IP and netmask on BMC.
666 [Arguments] ${ip} ${netmask}
667
668 # Description of the argument(s):
669 # ip IP address to be verified.
670 # netmask netmask value to be verified.
671
672 ${prefix_length}= Netmask Prefix Length ${netmask}
673 @{ip_data}= Get BMC IP Info
674
675 ${ip_with_netmask}= Catenate ${ip}/${prefix_length}
676 Should Contain ${ip_data} ${ip_with_netmask}
677 ... msg=IP and netmask pair does not exist.
678
Prashanth Kattif58cce02019-02-06 03:05:14 -0600679Test Teardown Execution
680 [Documentation] Test teardown execution.
681
682 FFDC On Test Case Fail
George Keishing97c93942019-03-04 12:45:07 -0600683 Redfish.Logout
Prashanth Kattia8442512019-06-07 06:47:09 -0500684
685Clear IP Settings On Fail
686 [Documentation] Clear IP settings on fail.
687 [Arguments] ${ip}
688
689 # Description of argument(s):
690 # ip IP address to be deleted.
691
692 Run Keyword If '${TEST STATUS}' == 'FAIL'
693 ... Delete IP Address ${ip}
694
695 Test Teardown Execution
Prashanth Kattiadf0b4e2019-06-10 04:20:30 -0500696
Prashanth Katti7098c972019-07-03 06:56:42 -0500697Verify CLI and Redfish Nameservers
698 [Documentation] Verify that nameservers obtained via Redfish do not
699 ... match those found in /etc/resolv.conf.
700
Tony Lee412c6682020-04-01 17:34:30 +0800701 ${active_channel_config}= Get Active Channel Config
702 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
703
Anves Kumar rayankula91548ea2020-06-18 00:28:13 -0500704 ${redfish_nameservers}= Redfish.Get Attribute
705 ... ${REDFISH_NW_ETH_IFACE}${ethernet_interface} StaticNameServers
Prashanth Katti7098c972019-07-03 06:56:42 -0500706 ${resolve_conf_nameservers}= CLI Get Nameservers
Michael Walsh39c00512019-07-17 10:54:06 -0500707 Rqprint Vars redfish_nameservers resolve_conf_nameservers
Prashanth Katti7098c972019-07-03 06:56:42 -0500708
Sweta Potthurid77ea982021-07-01 04:30:38 -0500709 List Should Contain Sub List ${resolve_conf_nameservers} ${redfish_nameservers}
710 ... msg=The nameservers obtained via Redfish do not match those found in /etc/resolv.conf.
Prashanth Katti7098c972019-07-03 06:56:42 -0500711
712Configure Static Name Servers
713 [Documentation] Configure DNS server on BMC.
Prashanth Kattic85957c2019-07-09 02:01:20 -0500714 [Arguments] ${static_name_servers}=${original_nameservers}
Prashanth Katti3c7b6432019-07-26 06:53:37 -0500715 ... ${valid_status_codes}=${HTTP_OK}
Prashanth Katti7098c972019-07-03 06:56:42 -0500716
George Keishing9cb2e592019-07-12 09:37:33 -0500717 # Description of the argument(s):
Prashanth Katti7098c972019-07-03 06:56:42 -0500718 # static_name_servers A list of static name server IPs to be
719 # configured on the BMC.
720
Tony Lee412c6682020-04-01 17:34:30 +0800721 ${active_channel_config}= Get Active Channel Config
722 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
723
Anves Kumar rayankula6b9fcd12020-12-18 01:03:19 -0600724 ${type} = Evaluate type($static_name_servers).__name__
725 ${static_name_servers}= Set Variable If '${type}'=='str'
726 ... '${static_name_servers}' ${static_name_servers}
727
Prashanth Katti9d995fc2019-09-24 01:29:06 -0500728 # Currently BMC is sending 500 response code instead of 400 for invalid scenarios.
Anves Kumar rayankula91548ea2020-06-18 00:28:13 -0500729 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
730 ... body={'StaticNameServers': ${static_name_servers}}
Prashanth Katti9d995fc2019-09-24 01:29:06 -0500731 ... valid_status_codes=[${valid_status_codes}, ${HTTP_INTERNAL_SERVER_ERROR}]
Prashanth Kattic85957c2019-07-09 02:01:20 -0500732
Prashanth Kattif247be32019-10-07 04:40:43 -0500733 # Patch operation takes 1 to 3 seconds to set new value.
734 Sleep 3s
735
Prashanth Katti7f9e60f2019-07-26 01:18:41 -0500736 # Check if newly added DNS server is configured on BMC.
737 ${cli_nameservers}= CLI Get Nameservers
Prashanth Katti3c7b6432019-07-26 06:53:37 -0500738 ${cmd_status}= Run Keyword And Return Status
739 ... List Should Contain Sub List ${cli_nameservers} ${static_name_servers}
740
741 Run Keyword If '${valid_status_codes}' == '${HTTP_OK}'
742 ... Should Be True ${cmd_status} == ${True}
743 ... ELSE Should Be True ${cmd_status} == ${False}
Prashanth Katti7f9e60f2019-07-26 01:18:41 -0500744
Prashanth Kattic85957c2019-07-09 02:01:20 -0500745Delete Static Name Servers
746 [Documentation] Delete static name servers.
747
Sweta Potthuridc325932022-06-15 12:51:27 -0500748 DNS Test Setup Execution
Anves Kumar rayankula045814b2020-10-09 09:17:05 -0500749 Configure Static Name Servers static_name_servers=@{EMPTY}
Prashanth Kattic85957c2019-07-09 02:01:20 -0500750
751 # Check if all name servers deleted on BMC.
752 ${nameservers}= CLI Get Nameservers
Sweta Potthuridc325932022-06-15 12:51:27 -0500753 Should Not Contain ${nameservers} ${original_nameservers}
754
755 DNS Test Setup Execution
756
757 Should Be Empty ${original_nameservers}
Prashanth Kattic85957c2019-07-09 02:01:20 -0500758
759DNS Test Setup Execution
760 [Documentation] Do DNS test setup execution.
761
762 Redfish.Login
763
Tony Lee412c6682020-04-01 17:34:30 +0800764 ${active_channel_config}= Get Active Channel Config
765 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
766
Anves Kumar rayankula91548ea2020-06-18 00:28:13 -0500767 ${original_nameservers}= Redfish.Get Attribute
768 ... ${REDFISH_NW_ETH_IFACE}${ethernet_interface} StaticNameServers
Tony Lee412c6682020-04-01 17:34:30 +0800769
Prashanth Kattic85957c2019-07-09 02:01:20 -0500770 Rprint Vars original_nameservers
771 # Set suite variables to trigger restoration during teardown.
772 Set Suite Variable ${original_nameservers}
Prashanth Kattib478d902020-05-08 10:05:32 -0500773
774Suite Setup Execution
775 [Documentation] Do suite setup execution.
776
777 ${test_gateway}= Get BMC Default Gateway
778 Set Suite Variable ${test_gateway}
Prashanth Katti568df5f2020-05-15 06:00:37 -0500779
780Update IP Address
781 [Documentation] Update IP address of BMC.
Anves Kumar rayankula53b80302021-05-21 01:50:03 -0500782 [Arguments] ${ip} ${new_ip} ${netmask} ${gw_ip}
783 ... ${valid_status_codes}=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
Prashanth Katti568df5f2020-05-15 06:00:37 -0500784
785 # Description of argument(s):
786 # ip IP address to be replaced (e.g. "10.7.7.7").
787 # new_ip New IP address to be configured.
788 # netmask Netmask value.
789 # gw_ip Gateway IP address.
790 # valid_status_codes Expected return code from patch operation
791 # (e.g. "200"). See prolog of rest_request
792 # method in redfish_plus.py for details.
793
794 ${empty_dict}= Create Dictionary
795 ${patch_list}= Create List
796 ${ip_data}= Create Dictionary Address=${new_ip} SubnetMask=${netmask} Gateway=${gw_ip}
797
798 # Find the position of IP address to be modified.
799 @{network_configurations}= Get Network Configuration
800 FOR ${network_configuration} IN @{network_configurations}
801 Run Keyword If '${network_configuration['Address']}' == '${ip}'
802 ... Append To List ${patch_list} ${ip_data}
803 ... ELSE Append To List ${patch_list} ${empty_dict}
804 END
805
806 ${ip_found}= Run Keyword And Return Status List Should Contain Value
807 ... ${patch_list} ${ip_data} msg=${ip} does not exist on BMC
808 Pass Execution If ${ip_found} == ${False} ${ip} does not exist on BMC
809
810 # Run patch command only if given IP is found on BMC
811 ${data}= Create Dictionary IPv4StaticAddresses=${patch_list}
812
Anves Kumar rayankulaabf68542021-06-23 00:14:54 -0500813 ${active_channel_config}= Get Active Channel Config
814 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
815
816 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
817 ... body=&{data} valid_status_codes=${valid_status_codes}
Prashanth Katti568df5f2020-05-15 06:00:37 -0500818
819 # Note: Network restart takes around 15-18s after patch request processing.
820 Sleep ${NETWORK_TIMEOUT}s
821 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
822
823 Verify IP On BMC ${new_ip}
824 Validate Network Config On BMC
Anves Kumar rayankulad4cdd8c2021-01-11 04:10:05 -0600825
826Configure Multiple Static IPv4 Addresses
827 [Documentation] Configure multiple static ipv4 address via Redfish and verify.
828 [Arguments] ${ip_addreses} ${subnet_mask} ${gateway}
829
830 # Description of argument(s):
831 # ip_addreses A list of IP addresses to be added (e.g.["10.7.7.7"]).
832 # subnet_mask Subnet mask for the IP to be added (e.g. "255.255.0.0").
833 # gateway Gateway for the IP to be added (e.g. "10.7.7.1").
834
835 FOR ${ip} IN @{ip_addreses}
836 Add IP Address ${ip} ${subnet_mask} ${gateway}
837 END
838 Validate Network Config On BMC
839
840
841Delete Multiple Static IPv4 Addresses
842 [Documentation] Delete multiple static ipv4 address via Redfish.
843 [Arguments] ${ip_addreses}
844
845 # Description of argument(s):
846 # ip_addreses A list of IP addresses to be deleted (e.g.["10.7.7.7"]).
847
848 FOR ${ip} IN @{ip_addreses}
849 Delete IP Address ${ip}
850 END
851 Validate Network Config On BMC
Anves Kumar rayankulaac0a7ba2021-03-09 08:10:20 -0600852
853Verify Network Response On Specified Host State
854 [Documentation] Verifying the BMC network response when host is on and off.
855 [Arguments] ${host_state}
856
857 # Description of argument(s):
858 # host_state if host_state is on then host is booted to operating system.
859 # if host_state is off then host is power off.
860 # (eg. on, off).
861
862 ${active_channel_config}= Get Active Channel Config
863 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
864
865 Run Keyword If '${host_state}' == 'on'
866 ... Redfish Power On stack_mode=skip
867 ... ELSE
868 ... Redfish Power off stack_mode=skip
869
870 Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
871 Ping Host ${OPENBMC_HOST}
872
nagarjunb2260784a42022-06-13 10:39:33 +0530873
874Verify IP On Redfish URI
875 [Documentation] Verify given IP on redfish URI.
876 [Arguments] ${ip_address}
877
878 # Description of argument(s):
879 # ip_address Configured IP address which need to verified.
880
881 ${network_configurations}= Get Network Configuration
882
883 FOR ${network_configuration} IN @{network_configurations}
884 ${ip_found}= Set Variable If '${network_configuration['Address']}' == '${ip_address}' ${True}
885 ... ${False}
886 Exit For Loop If ${ip_found}
887 END
888 Run Keyword If '${ip_found}' == '${False}'
889 ... Fail msg=Configured IP address not found on EthernetInterface URI.