blob: 5e50b5df6bd18705319baf2fa421b12d813e5c48 [file] [log] [blame]
Anves Kumar rayankulad2e98ff2021-06-29 05:03:02 -05001*** Settings ***
2Documentation Test BMC multiple network interface functionalities.
Anvesh-Kumar_Rayankula58b55692024-09-13 03:23:03 -05003... Run on setup with both eth0 and eth1 in static mode.
Anves Kumar rayankulad2e98ff2021-06-29 05:03:02 -05004
Anves Kumar rayankulad2e98ff2021-06-29 05:03:02 -05005Resource ../../lib/resource.robot
6Resource ../../lib/common_utils.robot
7Resource ../../lib/connection_client.robot
8Resource ../../lib/bmc_network_utils.robot
9Resource ../../lib/openbmc_ffdc.robot
Anves Kumar rayankula4fa52d72021-07-04 02:37:30 -050010Resource ../../lib/bmc_ldap_utils.robot
Anves Kumar rayankula2f9632f2021-07-05 04:37:45 -050011Resource ../../lib/snmp/resource.robot
12Resource ../../lib/snmp/redfish_snmp_utils.robot
Anves Kumar rayankula75ac4292021-07-14 01:30:43 -050013Resource ../../lib/certificate_utils.robot
Sweta Potthuri79ba8a22024-09-25 04:09:45 -050014Resource ../../lib/protocol_setting_utils.robot
Anves Kumar rayankulaa38ec2e2021-07-10 01:09:23 -050015Library ../../lib/jobs_processing.py
Anves Kumar rayankula75ac4292021-07-14 01:30:43 -050016Library OperatingSystem
Anves Kumar rayankulad2e98ff2021-06-29 05:03:02 -050017
George Keishingf7b4e6d2025-02-24 15:20:36 +053018# User input BMC IP for the eth1.
19# Use can input as -v OPENBMC_HOST_ETH1:xx.xxx.xx from command line.
20Library ../../lib/bmc_redfish.py https://${OPENBMC_HOST_ETH1}:${HTTPS_PORT}
George Keishingb5c119e2025-03-25 20:45:03 +053021... ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} AS Redfish1
George Keishingf7b4e6d2025-02-24 15:20:36 +053022
Anves Kumar rayankulad2e98ff2021-06-29 05:03:02 -050023Suite Setup Suite Setup Execution
Anvesh-Kumar_Rayankula58b55692024-09-13 03:23:03 -050024Test Setup Run Keywords Redfish.Login AND Redfish1.Login
25Test Teardown Run Keywords FFDC On Test Case Fail AND Redfish.Logout AND Redfish1.Logout
Sweta Potthuri79ba8a22024-09-25 04:09:45 -050026Suite Teardown Run Keywords Redfish1.Logout AND Redfish.Logout
Anves Kumar rayankulad2e98ff2021-06-29 05:03:02 -050027
Igor Kanyukafeb79d62025-10-20 21:24:03 +010028Test Tags Multiple_Interfaces
29
Anves Kumar rayankulad0a2f332021-07-14 07:53:12 -050030*** Variables ***
31
Anvesh-Kumar_Rayankula58b55692024-09-13 03:23:03 -050032${cmd_prefix} ipmitool -I lanplus -C 17 -p 623 -U ${IPMI_USERNAME} -P ${IPMI_PASSWORD}
Sweta Potthuri2667f2c2022-10-11 07:55:21 -050033${test_ipv4_addr} 10.7.7.7
34${test_ipv4_addr2} 10.7.7.8
35${test_subnet_mask} 255.255.255.0
Anves Kumar rayankulad0a2f332021-07-14 07:53:12 -050036
Anves Kumar rayankulad2e98ff2021-06-29 05:03:02 -050037*** Test Cases ***
38
Anves Kumar rayankula4fa52d72021-07-04 02:37:30 -050039Verify Both Interfaces BMC IP Addresses Accessible Via SSH
Anves Kumar rayankulad2e98ff2021-06-29 05:03:02 -050040 [Documentation] Verify both interfaces (eth0, eth1) BMC IP addresses accessible via SSH.
41 [Tags] Verify_Both_Interfaces_BMC_IP_Addresses_Accessible_Via_SSH
42
43 Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} host=${OPENBMC_HOST}
George Keishingf7b4e6d2025-02-24 15:20:36 +053044 Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} host=${OPENBMC_HOST_ETH1}
Anves Kumar rayankulad2e98ff2021-06-29 05:03:02 -050045 Close All Connections
46
47
Anves Kumar rayankula55d51922021-07-01 06:37:00 -050048Verify Redfish Works On Both Interfaces
49 [Documentation] Verify access BMC with both interfaces (eth0, eth1) IP addresses via Redfish.
50 [Tags] Verify_Redfish_Works_On_Both_Interfaces
51 [Teardown] Run Keywords
52 ... Configure Hostname ${hostname} AND Validate Hostname On BMC ${hostname}
53
Anves Kumar rayankula55d51922021-07-01 06:37:00 -050054 ${hostname}= Redfish.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName
55 ${data}= Create Dictionary HostName=openbmc
56 Redfish1.patch ${REDFISH_NW_ETH_IFACE}eth1 body=&{data}
57 ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
58
59 Validate Hostname On BMC openbmc
60
61 ${resp1}= Redfish.Get ${REDFISH_NW_ETH_IFACE}eth0
62 ${resp2}= Redfish1.Get ${REDFISH_NW_ETH_IFACE}eth1
63 Should Be Equal ${resp1.dict['HostName']} ${resp2.dict['HostName']}
64
Anves Kumar rayankula4fa52d72021-07-04 02:37:30 -050065
66Verify LDAP Login Works When Eth1 IP Is Not Configured
67 [Documentation] Verify LDAP login works when eth1 IP is erased.
68 [Tags] Verify_LDAP_Login_Works_When_Eth1_IP_Is_Not_Configured
kothais01f95fc2023-11-01 14:12:51 +000069 [Setup] Run Keywords Set Test Variable ${CHANNEL_NUMBER} ${SECONDARY_CHANNEL_NUMBER}
George Keishingf7b4e6d2025-02-24 15:20:36 +053070 ... AND Redfish.Login AND Delete IP Address ${OPENBMC_HOST_ETH1}
Anvesh-Kumar_Rayankula58b55692024-09-13 03:23:03 -050071 [Teardown] Run Keywords Redfish.Logout AND Redfish.Login AND
George Keishingf7b4e6d2025-02-24 15:20:36 +053072 ... Add IP Address ${OPENBMC_HOST_ETH1} ${eth1_subnet_mask} ${eth1_gateway}
Anves Kumar rayankula4fa52d72021-07-04 02:37:30 -050073
74 Create LDAP Configuration
Anves Kumar rayankula4fa52d72021-07-04 02:37:30 -050075 Redfish.Logout
Anvesh-Kumar_Rayankula58b55692024-09-13 03:23:03 -050076 Sleep 30
Sweta Potthurib9513c62023-03-01 01:11:43 -060077 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
78
79
80Verify LDAP Login Works When Both Interfaces Are Configured
81 [Documentation] Verify LDAP login works when both interfaces are configured.
82 [Tags] Verify_LDAP_Login_Works_When_Both_Interfaces_Are_Configured
Sweta Potthurib9513c62023-03-01 01:11:43 -060083
84 Create LDAP Configuration
85 Redfish.Logout
Anvesh-Kumar_Rayankula58b55692024-09-13 03:23:03 -050086 Sleep 30
Sweta Potthurib9513c62023-03-01 01:11:43 -060087 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
88
89
90Verify Secure LDAP Login Works When Both Interfaces Are Configured
91 [Documentation] Verify Secure LDAP login works when both the interfaces are configured.
92 [Tags] Verify_Secure_LDAP_Login_Works_When_Both_Interfaces_Are_Configured
Sweta Potthurib9513c62023-03-01 01:11:43 -060093
94 Create LDAP Configuration ${LDAP_TYPE} ${LDAP_SERVER_URI_1} ${LDAP_BIND_DN}
95 ... ${LDAP_BIND_DN_PASSWORD} ${LDAP_BASE_DN}
96 Redfish.Logout
Anvesh-Kumar_Rayankula58b55692024-09-13 03:23:03 -050097 Sleep 30
Sweta Potthurib9513c62023-03-01 01:11:43 -060098 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
Anves Kumar rayankula4fa52d72021-07-04 02:37:30 -050099
100
Anves Kumar rayankula2f9632f2021-07-05 04:37:45 -0500101Verify SNMP Works When Eth1 IP Is Not Configured
102 [Documentation] Verify SNMP works when eth1 IP is not configured.
103 [Tags] Verify_SNMP_Works_When_Eth1_IP_Is_Not_Configured
Anvesh-Kumar_Rayankula58b55692024-09-13 03:23:03 -0500104 [Setup] Run Keywords Redfish.Login AND
105 ... Set Test Variable ${CHANNEL_NUMBER} ${SECONDARY_CHANNEL_NUMBER}
George Keishingf7b4e6d2025-02-24 15:20:36 +0530106 ... AND Delete IP Address ${OPENBMC_HOST_ETH1}
107 [Teardown] Add IP Address ${OPENBMC_HOST_ETH1} ${eth1_subnet_mask} ${eth1_gateway}
Anves Kumar rayankula2f9632f2021-07-05 04:37:45 -0500108
109 Create Error On BMC And Verify Trap
110
111
Anves Kumar rayankula04bc48c2021-07-08 23:33:37 -0500112Disable And Enable Eth0 Interface
113 [Documentation] Disable and Enable eth0 ethernet interface via redfish.
114 [Tags] Disable_And_Enable_Eth0_Interface
115 [Template] Set BMC Ethernet Interfaces State
116
117 # interface_ip interface enabled
118 ${OPENBMC_HOST} eth0 ${False}
119 ${OPENBMC_HOST} eth0 ${True}
120
121
Anves Kumar rayankulaa38ec2e2021-07-10 01:09:23 -0500122Verify Both Interfaces Access Concurrently Via Redfish
123 [Documentation] Verify both interfaces access conurrently via redfish.
124 [Tags] Verify_Both_Interfaces_Access_Concurrently_Via_Redfish
125
Anves Kumar rayankulaa38ec2e2021-07-10 01:09:23 -0500126 ${dict}= Execute Process Multi Keyword ${2}
Sweta Potthuri79ba8a22024-09-25 04:09:45 -0500127 ... Redfish.patch ${REDFISH_NW_ETH_IFACE}eth0 body={'DHCPv4':{'UseDNSServers':${True}}}
128 ... Redfish1.patch ${REDFISH_NW_ETH_IFACE}eth1 body={'DHCPv4':{'UseDNSServers':${True}}}
Anves Kumar rayankulaa38ec2e2021-07-10 01:09:23 -0500129
130 Dictionary Should Not Contain Value ${dict} False
131 ... msg=One or more operations has failed.
132
133 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}eth0
134 ${resp1}= Redfish1.Get ${REDFISH_NW_ETH_IFACE}eth1
135
136 Should Be Equal ${resp.dict["DHCPv4"]['UseDNSServers']} ${True}
137 Should Be Equal ${resp1.dict["DHCPv4"]['UseDNSServers']} ${True}
138
Anves Kumar rayankula54482cd2021-07-09 07:13:25 -0500139Able To Access Serial Console Via Both Network Interfaces
140 [Documentation] Able to access serial console via both network interfaces.
George Keishingc4914b72021-07-27 08:03:19 -0500141 [Tags] Able_To_Access_Serial_Console_Via_Both_Network_Interfaces
Anves Kumar rayankula54482cd2021-07-09 07:13:25 -0500142
143 Open Connection And Log In host=${OPENBMC_HOST} port=2200
George Keishingf7b4e6d2025-02-24 15:20:36 +0530144 Open Connection And Log In host=${OPENBMC_HOST_ETH1} port=2200
Anves Kumar rayankula54482cd2021-07-09 07:13:25 -0500145 Close All Connections
146
Anves Kumar rayankulad0a2f332021-07-14 07:53:12 -0500147Verify IPMI Works On Both Network Interfaces
148 [Documentation] Verify IPMI works on both network interfaces.
149 [Tags] Verify_IPMI_Works_On_Both_Network_Interfaces
150
George Keishingf7b4e6d2025-02-24 15:20:36 +0530151 Run IPMI ${OPENBMC_HOST_ETH1} power on
Anves Kumar rayankulad0a2f332021-07-14 07:53:12 -0500152 ${status1}= Run IPMI ${OPENBMC_HOST} power status
George Keishingf7b4e6d2025-02-24 15:20:36 +0530153 ${status2}= Run IPMI ${OPENBMC_HOST_ETH1} power status
Anves Kumar rayankulad0a2f332021-07-14 07:53:12 -0500154 Should Be Equal ${status1} ${status2}
155
Sweta Potthuri2667f2c2022-10-11 07:55:21 -0500156Verify Modifying IP Address Multiple Times On Interface
157 [Documentation] Verify modifying IP address multiple times on interface.
158 [Tags] Verify_Modifying_IP_Address_Multiple_Times_On_Interface
159 [Teardown] Run Keywords
Anvesh-Kumar_Rayankula58b55692024-09-13 03:23:03 -0500160 ... Delete IP Address ${test_ipv4_addr} AND Redfish.Logout
Sweta Potthuri2667f2c2022-10-11 07:55:21 -0500161
162 ${test_gateway}= Get BMC Default Gateway
163 Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway}
164 Update IP Address ${test_ipv4_addr} ${test_ipv4_addr2} ${test_subnet_mask} ${test_gateway}
165 Update IP Address ${test_ipv4_addr2} ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway}
166 Run Keyword Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
George Keishingf7b4e6d2025-02-24 15:20:36 +0530167 Run Keyword Wait For Host To Ping ${OPENBMC_HOST_ETH1} ${NETWORK_TIMEOUT}
Anves Kumar rayankula75ac4292021-07-14 01:30:43 -0500168
169Verify Able To Load Certificates Via Eth1 IP Address
George Keishingb13682a2021-07-20 08:52:39 -0500170 [Documentation] Verify able to load certificates via eth1 IP address.
Anves Kumar rayankula75ac4292021-07-14 01:30:43 -0500171 [Tags] Verify_Able_To_Load_Certificates_Via_Eth1_IP_Address
Anves Kumar rayankula75ac4292021-07-14 01:30:43 -0500172 [Template] Install Certificate Via Redfish And Verify
173
174 # cert_type cert_format expected_status
175 CA Valid Certificate ok
176 Client Valid Certificate Valid Privatekey ok
177
Sweta Potthuri79ba8a22024-09-25 04:09:45 -0500178Enable SSH Protocol Via Eth1 And Verify On Both Interfaces
179 [Documentation] Enable SSH protocol via eth1 and verify on both interfaces.
180 [Tags] Enable_SSH_Protocol_Via_Eth1_And_Verify_On_Both_Interfaces
181
182 Set SSH Value Via Eth1 ${True}
183 # Check if SSH is really enabled via Redfish via eth1.
184 Verify SSH Protocol State Via Eth1 ${True}
185 # Check if SSH login and commands on SSH session work on both interfaces.
186 Verify SSH Login And Commands Work
George Keishingf7b4e6d2025-02-24 15:20:36 +0530187 Verify SSH Login And Commands Work ${OPENBMC_HOST_ETH1}
Sweta Potthuri79ba8a22024-09-25 04:09:45 -0500188
189Disable SSH Protocol Via Eth1 And Verify On Both Interfaces
190 [Documentation] Disable SSH protocol via eth1 and verify on both interfaces.
191 [Tags] Disable_SSH_Protocol_Via_Eth1_And_Verify_On_Both_Interfaces
192 [Teardown] Set SSH Value Via Eth1 ${True}
193
194 Set SSH Value Via Eth1 ${False}
195 # Check if SSH is really disabled via Redfish via eth1.
196 Verify SSH Protocol State Via Eth1 ${False}
197 # Check if SSH login and commands fail on eth1.
198 ${status}= Run Keyword And Return Status
George Keishingf7b4e6d2025-02-24 15:20:36 +0530199 ... Verify SSH Login And Commands Work ${OPENBMC_HOST_ETH1}
Sweta Potthuri79ba8a22024-09-25 04:09:45 -0500200
201 Should Be Equal As Strings ${status} False
202 ... msg=SSH Login and commands are working after disabling SSH via eth1.
203
204 # Check if SSH login and commands fail.
205 ${status}= Run Keyword And Return Status
206 ... Verify SSH Login And Commands Work
207
208 Should Be Equal As Strings ${status} False
209 ... msg=SSH Login and commands are working after disabling SSH.
210
Anves Kumar rayankulad2e98ff2021-06-29 05:03:02 -0500211*** Keywords ***
212
213Get Network Configuration Using Channel Number
214 [Documentation] Get ethernet interface.
215 [Arguments] ${channel_number}
216
217 # Description of argument(s):
218 # channel_number Ethernet channel number, 1 is for eth0 and 2 is for eth1 (e.g. "1").
219
220 ${active_channel_config}= Get Active Channel Config
221 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']}
222 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
223
224 @{network_configurations}= Get From Dictionary ${resp.dict} IPv4StaticAddresses
George Keishing409df052024-01-17 22:36:14 +0530225 RETURN @{network_configurations}
Anves Kumar rayankulad2e98ff2021-06-29 05:03:02 -0500226
227
228Suite Setup Execution
229 [Documentation] Do suite setup task.
230
George Keishingf7b4e6d2025-02-24 15:20:36 +0530231 Valid Value OPENBMC_HOST_ETH1
Anves Kumar rayankulad2e98ff2021-06-29 05:03:02 -0500232
233 # Check both interfaces are configured and reachable.
234 Ping Host ${OPENBMC_HOST}
George Keishingf7b4e6d2025-02-24 15:20:36 +0530235 Ping Host ${OPENBMC_HOST_ETH1}
Anves Kumar rayankula4fa52d72021-07-04 02:37:30 -0500236
kothais01f95fc2023-11-01 14:12:51 +0000237 ${network_configurations}= Get Network Configuration Using Channel Number ${SECONDARY_CHANNEL_NUMBER}
Anves Kumar rayankula4fa52d72021-07-04 02:37:30 -0500238 FOR ${network_configuration} IN @{network_configurations}
239
Sridevi Ramesh6dcfc392025-05-06 11:09:43 -0500240 IF '${network_configuration['Address']}' == '${OPENBMC_HOST_ETH1}'
241 Set Suite Variable ${eth1_subnet_mask} ${network_configuration['SubnetMask']}
242 Set Suite Variable ${eth1_gateway} ${network_configuration['Gateway']}
243 BREAK
244 END
Anves Kumar rayankula4fa52d72021-07-04 02:37:30 -0500245
246 END
Anves Kumar rayankula04bc48c2021-07-08 23:33:37 -0500247
248
249Set BMC Ethernet Interfaces State
250 [Documentation] Set BMC ethernet interface state.
251 [Arguments] ${interface_ip} ${interface} ${enabled}
252 [Teardown] Redfish1.Logout
253
254 # Description of argument(s):
255 # interface_ip IP address of ethernet interface.
256 # interface The ethernet interface name (eg. eth0 or eth1).
257 # enabled Indicates interface should be enabled (eg. True or False).
258
259 Redfish1.Login
260
261 ${data}= Create Dictionary InterfaceEnabled=${enabled}
262
263 Redfish1.patch ${REDFISH_NW_ETH_IFACE}${interface} body=&{data}
264 ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
265
266 Sleep ${NETWORK_TIMEOUT}s
267 ${interface_status}= Redfish1.Get Attribute ${REDFISH_NW_ETH_IFACE}${interface} InterfaceEnabled
268 Should Be Equal ${interface_status} ${enabled}
269
270 ${status}= Run Keyword And Return Status Ping Host ${interface_ip}
271
George Keishinge6e161e2025-05-08 10:18:30 +0530272 IF ${enabled} == ${True}
273 Should Be Equal ${status} ${True}
274 ELSE
275 Should Be Equal ${status} ${False}
276 END
Anves Kumar rayankulad0a2f332021-07-14 07:53:12 -0500277
278
279Run IPMI
280 [Documentation] Run IPMI command.
281 [Arguments] ${host} ${sub_cmd}
282
283 # Description of argument(s):
284 # host BMC host name or IP address.
285 # sub_cmd The IPMI command string to be executed.
286
287 ${rc} ${output}= Run And Return Rc And Output ${cmd_prefix} -H ${host} ${sub_cmd}
288 Should Be Equal As Strings ${rc} 0
George Keishing409df052024-01-17 22:36:14 +0530289 RETURN ${output}
Anves Kumar rayankulad0a2f332021-07-14 07:53:12 -0500290
Anves Kumar rayankula75ac4292021-07-14 01:30:43 -0500291
292Install Certificate Via Redfish And Verify
293 [Documentation] Install and verify certificate using Redfish.
294 [Arguments] ${cert_type} ${cert_format} ${expected_status} ${delete_cert}=${True}
Anvesh-Kumar_Rayankula58b55692024-09-13 03:23:03 -0500295 [Teardown] Remove Directory certificate_dir recursive=True
Anves Kumar rayankula75ac4292021-07-14 01:30:43 -0500296
297 # Description of argument(s):
298 # cert_type Certificate type (e.g. "Client" or "CA").
299 # cert_format Certificate file format
300 # (e.g. "Valid_Certificate_Valid_Privatekey").
301 # expected_status Expected status of certificate replace Redfish
302 # request (i.e. "ok" or "error").
303 # delete_cert Certificate will be deleted before installing if this True.
304
Anvesh-Kumar_Rayankula58b55692024-09-13 03:23:03 -0500305 Create Directory certificate_dir
Anves Kumar rayankula75ac4292021-07-14 01:30:43 -0500306 # AUTH_URI is a global variable defined in lib/resource.robot
George Keishingf7b4e6d2025-02-24 15:20:36 +0530307 Set Test Variable ${AUTH_URI} https://${OPENBMC_HOST_ETH1}
George Keishinge6e161e2025-05-08 10:18:30 +0530308 IF '${cert_type}' == 'CA' and '${delete_cert}' == '${True}'
309 Delete All CA Certificate Via Redfish
310 ELSE IF '${cert_type}' == 'Client' and '${delete_cert}' == '${True}'
311 Delete Certificate Via BMC CLI ${cert_type}
312 END
Anves Kumar rayankula75ac4292021-07-14 01:30:43 -0500313
314 ${cert_file_path}= Generate Certificate File Via Openssl ${cert_format}
315 ${bytes}= OperatingSystem.Get Binary File ${cert_file_path}
316 ${file_data}= Decode Bytes To String ${bytes} UTF-8
317
318 ${certificate_uri}= Set Variable If
319 ... '${cert_type}' == 'Client' ${REDFISH_LDAP_CERTIFICATE_URI}
320 ... '${cert_type}' == 'CA' ${REDFISH_CA_CERTIFICATE_URI}
321
322 ${cert_id}= Install Certificate File On BMC ${certificate_uri} ${expected_status} data=${file_data}
323 Logging Installed certificate id: ${cert_id}
324
325 Sleep 30s
George Keishinge6e161e2025-05-08 10:18:30 +0530326
Anves Kumar rayankula75ac4292021-07-14 01:30:43 -0500327 ${cert_file_content}= OperatingSystem.Get File ${cert_file_path}
George Keishinge6e161e2025-05-08 10:18:30 +0530328
329 ${content}= redfish_utils.Get Attribute
Anves Kumar rayankula75ac4292021-07-14 01:30:43 -0500330 ... ${certificate_uri}/${cert_id} CertificateString
George Keishinge6e161e2025-05-08 10:18:30 +0530331
332 ${bmc_cert_content}= Set Variable If '${expected_status}' == 'ok'
333 ... ${content}
334
335 IF '${expected_status}' == 'ok'
336 Should Contain ${cert_file_content} ${bmc_cert_content}
337 END
George Keishing409df052024-01-17 22:36:14 +0530338 RETURN ${cert_id}
Sweta Potthuri79ba8a22024-09-25 04:09:45 -0500339
340Set SSH Value Via Eth1
341 [Documentation] Enable or disable SSH protocol via Eth1.
342 [Arguments] ${enable_value}=${True}
343
344 # Description of argument(s}:
345 # enable_value Enable or disable SSH, e.g. (true, false).
346
347 ${ssh_state}= Create Dictionary ProtocolEnabled=${enable_value}
348 ${data}= Create Dictionary SSH=${ssh_state}
349
350 Redfish1.Login
351 Redfish1.patch ${REDFISH_NW_PROTOCOL_URI} body=&{data}
352 ... valid_status_codes=[${HTTP_NO_CONTENT}]
353
354 # Wait for timeout for new values to take effect.
355 Sleep ${NETWORK_TIMEOUT}s
356
357Verify SSH Protocol State Via Eth1
358 [Documentation] Verify SSH protocol state via eth1.
359 [Arguments] ${state}=${True}
360
361 # Description of argument(s}:
362 # state Enable or disable SSH, e.g. (true, false)
363
364 ${resp}= Redfish1.Get ${REDFISH_NW_PROTOCOL_URI}
365 Should Be Equal As Strings ${resp.dict['SSH']['ProtocolEnabled']} ${state}
366 ... msg=Protocol states are not matching.