@@ -16,12 +16,14 @@ Resource ../../lib/bmc_ldap_utils.robot
16
16
Resource ../../lib/snmp/resource.robot
17
17
Resource ../../lib/snmp/redfish_snmp_utils.robot
18
18
Resource ../../lib/certificate_utils.robot
19
+ Resource ../../lib/protocol_setting_utils.robot
19
20
Library ../../lib/jobs_processing.py
20
21
Library OperatingSystem
21
22
22
23
Suite Setup Suite Setup Execution
23
24
Test Setup Run Keywords Redfish.Login AND Redfish1.Login
24
25
Test Teardown Run Keywords FFDC On Test Case Fail AND Redfish.Logout AND Redfish1.Logout
26
+ Suite Teardown Run Keywords Redfish1.Logout AND Redfish.Logout
25
27
26
28
*** Variables ***
27
29
@@ -120,8 +122,8 @@ Verify Both Interfaces Access Concurrently Via Redfish
120
122
[Tags] Verify_Both_Interfaces_Access_Concurrently_Via_Redfish
121
123
122
124
${dict } = Execute Process Multi Keyword ${2 }
123
- ... Redfish.Patch ${REDFISH_NW_ETH_IFACE } eth0 body={'DHCPv4':{'UseDNSServers':${True } }}
124
- ... Redfish1.Patch ${REDFISH_NW_ETH_IFACE } eth1 body={'DHCPv4':{'UseDNSServers':${True } }}
125
+ ... Redfish.patch ${REDFISH_NW_ETH_IFACE } eth0 body={'DHCPv4':{'UseDNSServers':${True } }}
126
+ ... Redfish1.patch ${REDFISH_NW_ETH_IFACE } eth1 body={'DHCPv4':{'UseDNSServers':${True } }}
125
127
126
128
Dictionary Should Not Contain Value ${dict } False
127
129
... msg=One or more operations has failed.
@@ -171,6 +173,39 @@ Verify Able To Load Certificates Via Eth1 IP Address
171
173
CA Valid Certificate ok
172
174
Client Valid Certificate Valid Privatekey ok
173
175
176
+ Enable SSH Protocol Via Eth1 And Verify On Both Interfaces
177
+ [Documentation] Enable SSH protocol via eth1 and verify on both interfaces.
178
+ [Tags] Enable_SSH_Protocol_Via_Eth1_And_Verify_On_Both_Interfaces
179
+
180
+ Set SSH Value Via Eth1 ${True }
181
+ # Check if SSH is really enabled via Redfish via eth1.
182
+ Verify SSH Protocol State Via Eth1 ${True }
183
+ # Check if SSH login and commands on SSH session work on both interfaces.
184
+ Verify SSH Login And Commands Work
185
+ Verify SSH Login And Commands Work ${OPENBMC_HOST_1 }
186
+
187
+ Disable SSH Protocol Via Eth1 And Verify On Both Interfaces
188
+ [Documentation] Disable SSH protocol via eth1 and verify on both interfaces.
189
+ [Tags] Disable_SSH_Protocol_Via_Eth1_And_Verify_On_Both_Interfaces
190
+ [Teardown] Set SSH Value Via Eth1 ${True }
191
+
192
+ Set SSH Value Via Eth1 ${False }
193
+ # Check if SSH is really disabled via Redfish via eth1.
194
+ Verify SSH Protocol State Via Eth1 ${False }
195
+ # Check if SSH login and commands fail on eth1.
196
+ ${status } = Run Keyword And Return Status
197
+ ... Verify SSH Login And Commands Work ${OPENBMC_HOST_1 }
198
+
199
+ Should Be Equal As Strings ${status } False
200
+ ... msg=SSH Login and commands are working after disabling SSH via eth1.
201
+
202
+ # Check if SSH login and commands fail.
203
+ ${status } = Run Keyword And Return Status
204
+ ... Verify SSH Login And Commands Work
205
+
206
+ Should Be Equal As Strings ${status } False
207
+ ... msg=SSH Login and commands are working after disabling SSH.
208
+
174
209
*** Keywords ***
175
210
176
211
Get Network Configuration Using Channel Number
@@ -286,3 +321,31 @@ Install Certificate Via Redfish And Verify
286
321
... ${certificate_uri } /${cert_id } CertificateString
287
322
Run Keyword If '${expected_status } ' == 'ok' Should Contain ${cert_file_content } ${bmc_cert_content }
288
323
RETURN ${cert_id }
324
+
325
+ Set SSH Value Via Eth1
326
+ [Documentation] Enable or disable SSH protocol via Eth1.
327
+ [Arguments] ${enable_value } =${True }
328
+
329
+ # Description of argument(s}:
330
+ # enable_value Enable or disable SSH, e.g. (true, false).
331
+
332
+ ${ssh_state } = Create Dictionary ProtocolEnabled=${enable_value }
333
+ ${data } = Create Dictionary SSH=${ssh_state }
334
+
335
+ Redfish1.Login
336
+ Redfish1.patch ${REDFISH_NW_PROTOCOL_URI } body=&{data }
337
+ ... valid_status_codes=[${HTTP_NO_CONTENT } ]
338
+
339
+ # Wait for timeout for new values to take effect.
340
+ Sleep ${NETWORK_TIMEOUT } s
341
+
342
+ Verify SSH Protocol State Via Eth1
343
+ [Documentation] Verify SSH protocol state via eth1.
344
+ [Arguments] ${state } =${True }
345
+
346
+ # Description of argument(s}:
347
+ # state Enable or disable SSH, e.g. (true, false)
348
+
349
+ ${resp } = Redfish1.Get ${REDFISH_NW_PROTOCOL_URI }
350
+ Should Be Equal As Strings ${resp.dict['SSH']['ProtocolEnabled'] } ${state }
351
+ ... msg=Protocol states are not matching.
0 commit comments