blob: b6be429d6c3f14abeefcc333a80d3324400e9ec2 [file] [log] [blame]
George Keishing6a514ef2018-08-27 05:19:19 -05001*** Settings ***
2Documentation Remote logging test for rsyslog.
3
4# Program arguments:
5# REMOTE_LOG_SERVER_HOST The host name or IP address of the remote
George Keishing67133672018-08-31 10:23:15 -05006# logging server.
George Keishing6a514ef2018-08-27 05:19:19 -05007# REMOTE_LOG_SERVER_PORT The port number for the remote logging server.
George Keishing67133672018-08-31 10:23:15 -05008# REMOTE_USERNAME The username for the remote logging server.
9# REMOTE_PASSWORD The password for the remote logging server.
George Keishing6a514ef2018-08-27 05:19:19 -050010
George Keishing76a5daf2018-09-14 06:00:01 -050011Library String
George Keishingf32ee4c2019-06-17 22:30:07 -050012Resource ../../lib/openbmc_ffdc.robot
13Resource ../../lib/boot_utils.robot
14Resource ../../lib/remote_logging_utils.robot
15Resource ../../lib/bmc_redfish_resource.robot
16Resource ../../lib/ipmi_client.robot
17Resource ../../lib/bmc_redfish_resource.robot
George Keishingc15a7e62019-08-09 00:23:45 -050018Resource ../../lib/ipmi_client.robot
19Library ../../lib/ipmi_utils.py
George Keishingf32ee4c2019-06-17 22:30:07 -050020Library ../../lib/gen_misc.py
George Keishing6a514ef2018-08-27 05:19:19 -050021
22Suite Setup Suite Setup Execution
George Keishing216e5842018-08-31 14:58:15 -050023Test Setup Test Setup Execution
George Keishing6a514ef2018-08-27 05:19:19 -050024Test Teardown FFDC On Test Case Fail
25
George Keishing2cec1862018-09-03 12:59:25 -050026*** Variables ***
27
George Keishingc1ca5e92018-09-03 11:19:23 -050028# Strings to check from journald.
George Keishingf32ee4c2019-06-17 22:30:07 -050029${BMC_STOP_MSG} Stopping Network IPMI daemon
George Keishing13451ed2018-09-06 12:46:16 -050030${BMC_START_MSG} Starting Flush Journal to Persistent Storage
31${BMC_BOOT_MSG} Startup finished in
32${BMC_SYSLOG_REGEX} dropbear|vrm-control.sh
George Keishingeacb1882018-09-20 00:11:00 -050033${RSYSLOG_REGEX} start|exiting on signal 15|there are no active actions configured
George Keishing686cacb2019-01-16 01:05:20 -060034${RSYSLOG_RETRY_REGEX} suspended
George Keishing80bfd312019-03-19 12:05:24 -050035${valid_password} 0penBmc1
George Keishingc15a7e62019-08-09 00:23:45 -050036${max_password_length} 20
George Keishingc1ca5e92018-09-03 11:19:23 -050037
George Keishing6a514ef2018-08-27 05:19:19 -050038*** Test Cases ***
39
George Keishingeb9fc592018-09-18 07:58:17 -050040Test BMC Hostname Service And Verify
41 [Documentation] Write to hostname interface and verify via REST and
42 ... 'hostname' command.
43 [Tags] Test_BMC_Hostname_Service_And_Verify
44
45 ${openbmc_host_name} ${openbmc_ip} ${openbmc_short_name}=
46 ... Get Host Name IP host=${OPENBMC_HOST} short_name=1
47
48 ${host_name_dict}= Create Dictionary data=${openbmc_short_name}
49 Write Attribute ${NETWORK_MANAGER}config HostName data=${host_name_dict}
50 ... verify=${TRUE} expected_value=${openbmc_short_name}
51
52 ${hostname} ${stderr} ${rc}= BMC Execute Command hostname
53
54 Should Be Equal As Strings ${hostname} ${openbmc_short_name}
55 ... msg=The hostname interface ${openbmc_short_name} and command value ${hostname} do not match.
56
57 # Override the suite hostname variable if this test is executed.
58 Set Suite Variable ${bmc_hostname} ${openbmc_short_name}
59
60
George Keishing13a64e62018-09-10 13:07:36 -050061Verify REST Logging On BMC Journal When Disabled
62 [Documentation] Enable REST logging and verify from journald.
George Keishingb77a3572018-09-13 23:26:28 -050063 [Tags] Verify_REST_Logging_On_BMC_Journal_When_Disabled
George Keishing13a64e62018-09-10 13:07:36 -050064
65 ${log_dict}= Create Dictionary data=${False}
66 Write Attribute ${BMC_LOGGING_URI}${/}rest_api_logs Enabled data=${log_dict}
67 ... verify=${True} expected_value=${False}
68
George Keishingeacb1882018-09-20 00:11:00 -050069 # If it was enabled prior, this REST footprint will show up.
70 # Takes around 5 seconds for the REST to restart service when policy is changed.
71 Sleep 10s
72
George Keishingf2a92a02019-07-22 23:49:19 -050073 ${login_footprint}= Catenate login json: None 200 OK
George Keishing4df837f2018-09-19 14:06:01 -050074 # Example: Just get the message part of the syslog
George Keishingf2a92a02019-07-22 23:49:19 -050075 # user:root POST http://xx.xx.xx.xx/login json: None 200 OK
George Keishing4df837f2018-09-19 14:06:01 -050076 ${cmd}= Catenate SEPARATOR= --no-pager | egrep '${login_footprint}'
George Keishing4df837f2018-09-19 14:06:01 -050077
78 Start Journal Log filter=${cmd}
George Keishing13a64e62018-09-10 13:07:36 -050079 Initialize OpenBMC
George Keishing4df837f2018-09-19 14:06:01 -050080 Sleep 5s
81 ${bmc_journald}= Stop Journal Log
George Keishing13a64e62018-09-10 13:07:36 -050082
George Keishing4df837f2018-09-19 14:06:01 -050083 Should Be Empty ${bmc_journald}
George Keishing13a64e62018-09-10 13:07:36 -050084 ... msg=${bmc_journald} contains unexpected REST entries.
85
86
George Keishingb77a3572018-09-13 23:26:28 -050087Verify REST Logging On BMC Journal When Enabled
George Keishing13a64e62018-09-10 13:07:36 -050088 [Documentation] Enable REST logging and verify from journald.
George Keishingb77a3572018-09-13 23:26:28 -050089 [Tags] Verify_REST_Logging_On_BMC_Journal_When_Enabled
George Keishing13a64e62018-09-10 13:07:36 -050090
91 ${log_dict}= Create Dictionary data=${True}
92 Write Attribute ${BMC_LOGGING_URI}${/}rest_api_logs Enabled data=${log_dict}
93 ... verify=${True} expected_value=${True}
94
George Keishing686cacb2019-01-16 01:05:20 -060095 Sleep 5s
96
97 Start Journal Log
George Keishing13a64e62018-09-10 13:07:36 -050098 Initialize OpenBMC
George Keishing6218e762018-10-06 13:14:36 -050099 Log Out OpenBMC
George Keishing686cacb2019-01-16 01:05:20 -0600100 ${bmc_journald}= Stop Journal Log
George Keishing13a64e62018-09-10 13:07:36 -0500101
George Keishingf2a92a02019-07-22 23:49:19 -0500102 Should Contain ${bmc_journald} login json: None 200 OK
George Keishing13a64e62018-09-10 13:07:36 -0500103 ... msg=${bmc_journald} doesn't contains REST entries.
104
105
George Keishing38733f32018-09-20 05:56:50 -0500106Test Remote API Valid Config Combination
107 [Documentation] Verify valid combination of address and port.
108 [Tags] Test_Remote_API_Valid_Config_Combination
109 [Template] Verify Configure Remote Logging Server
110 # Forego normal test setup:
111 [Setup] No Operation
112
113 # Address Port Expected result
114 ${EMPTY} ${REMOTE_LOG_SERVER_PORT} ${True}
115 ${REMOTE_LOG_SERVER_HOST} ${REMOTE_LOG_SERVER_PORT} ${True}
George Keishing38733f32018-09-20 05:56:50 -0500116 ${REMOTE_LOG_SERVER_HOST} ${0} ${True}
117
118
119Test Remote API Invalid Config Combination
120 [Documentation] Verify invalid combination of address and port.
121 [Tags] Test_Remote_API_Invalid_Config_Combination
122 [Template] Verify Configure Remote Logging Server
123 # Forego normal test setup:
124 [Setup] No Operation
125
126 # Address Port Expected result
127 ${0} ${REMOTE_LOG_SERVER_PORT} ${False}
128 "0" ${REMOTE_LOG_SERVER_PORT} ${False}
129 ${REMOTE_LOG_SERVER_HOST} ${EMPTY} ${False}
130 ${REMOTE_LOG_SERVER_HOST} "0" ${False}
131
132
George Keishing6a514ef2018-08-27 05:19:19 -0500133Test Remote Logging REST Interface And Verify Config
134 [Documentation] Test remote logging interface and configuration.
135 [Tags] Test_Remote_Logging_REST_Interface_And_Verify_Config
136
George Keishing6a514ef2018-08-27 05:19:19 -0500137 Verify Rsyslog Config On BMC
138
George Keishing6a514ef2018-08-27 05:19:19 -0500139
George Keishing13451ed2018-09-06 12:46:16 -0500140Test Remote Logging Invalid Port Config And Verify BMC Journald
141 [Documentation] Test remote logging interface and configuration.
142 [Tags] Test_Remote_Logging_Invalid_Port_Config_And_Verify_BMC_Journald
143
144 # Invalid port derived by (REMOTE_LOG_SERVER_PORT + 1) port config setting.
145 ${INVALID_PORT}= Evaluate ${REMOTE_LOG_SERVER_PORT} + ${1}
George Keishingbbfc3942018-09-19 10:15:48 -0500146 Configure Remote Log Server With Parameters
George Keishing13451ed2018-09-06 12:46:16 -0500147 ... remote_host=${REMOTE_LOG_SERVER_HOST} remote_port=${INVALID_PORT}
148
149 Sleep 3s
Joy Onyerikwudbfe97d2019-03-11 19:44:56 -0500150 # rsyslogd[1870]: action 'action 0' suspended,
151 # next retry is Fri Sep 14 05:47:39 2018 [v8.29.0 try http://www.rsyslog.com/e/2007 ]
George Keishing13451ed2018-09-06 12:46:16 -0500152 ${bmc_journald} ${stderr} ${rc}= BMC Execute Command
153 ... journalctl -b --no-pager | egrep 'rsyslog.*${RSYSLOG_RETRY_REGEX}'
154
155 Should Contain ${bmc_journald} ${RSYSLOG_RETRY_REGEX}
156 ... msg=${bmc_journald} doesn't contain rsyslog retry entries.
157
158
George Keishinge16f1582022-12-15 07:32:21 -0600159Verify BMC Journald Synced To Remote Logging Server
George Keishing67133672018-08-31 10:23:15 -0500160 [Documentation] Check that BMC journald is sync to remote rsyslog.
George Keishinge16f1582022-12-15 07:32:21 -0600161 [Tags] Verify_BMC_Journald_Synced_To_Remote_Logging_Server
George Keishing67133672018-08-31 10:23:15 -0500162
George Keishing67133672018-08-31 10:23:15 -0500163 # Restart BMC dump service and get the last entry of the journald.
164 # Example:
George Keishing96904c42018-09-20 09:25:30 -0500165 # systemd[1]: Started Phosphor Dump Manager.
George Keishing67133672018-08-31 10:23:15 -0500166 BMC Execute Command
167 ... systemctl restart xyz.openbmc_project.Dump.Manager.service
168
169 ${bmc_journald} ${stderr} ${rc}= BMC Execute Command
George Keishing82ea1d42018-09-11 13:45:36 -0500170 ... journalctl --no-pager | grep 'Started Phosphor Dump Manager'
George Keishing67133672018-08-31 10:23:15 -0500171
George Keishing96904c42018-09-20 09:25:30 -0500172 # systemd[1]: Started Phosphor Dump Manager.
George Keishing82ea1d42018-09-11 13:45:36 -0500173 ${cmd}= Catenate SEPARATOR= egrep '${bmc_hostname}.*Started Phosphor Dump Manager' /var/log/syslog
George Keishing67133672018-08-31 10:23:15 -0500174 ${remote_journald}= Remote Logging Server Execute Command command=${cmd}
175
George Keishing216e5842018-08-31 14:58:15 -0500176 # TODO: rsyslog configuration and time date template to match BMC journald.
177 # Compare the BMC journlad log. Example:
178 # systemd[1]: Started Phosphor Dump Manager.
George Keishing82ea1d42018-09-11 13:45:36 -0500179 Should Contain ${remote_journald} ${bmc_journald.split('${bmc_hostname}')[1][0]}
George Keishing216e5842018-08-31 14:58:15 -0500180 ... msg= ${bmc_journald} doesn't match remote rsyslog:${remote_journald}.
George Keishing67133672018-08-31 10:23:15 -0500181
182
George Keishing2cec1862018-09-03 12:59:25 -0500183Verify Journald Post BMC Reset
184 [Documentation] Check that BMC journald is sync'ed to remote rsyslog after
185 ... BMC reset.
186 [Tags] Verify_Journald_Post_BMC_Reset
187
188 ${hostname} ${stderr} ${rc}= BMC Execute Command hostname
189 OBMC Reboot (off)
190
191 ${cmd}= Catenate grep ${hostname} /var/log/syslog |
192 ... egrep '${BMC_STOP_MSG}|${BMC_START_MSG}|${BMC_BOOT_MSG}'
193 ${remote_journald}= Remote Logging Server Execute Command command=${cmd}
194
195 # 1. Last reboot message to verify.
196 Should Contain ${remote_journald} ${BMC_STOP_MSG}
197 ... msg=The remote journald doesn't contain the IPMI shutdown message: ${BMC_STOP_MSG}.
198
199 # 2. Earliest booting message on journald.
200 Should Contain ${remote_journald} ${BMC_START_MSG}
201 ... msg=The remote journald doesn't contain the start message: ${BMC_START_MSG}.
202
203 # 3. Unique boot to standby message.
204 # Startup finished in 9.961s (kernel) + 1min 59.039s (userspace) = 2min 9.000s
205 ${bmc_journald} ${stderr} ${rc}= BMC Execute Command
George Keishing6218e762018-10-06 13:14:36 -0500206 ... journalctl -b --no-pager | egrep '${BMC_BOOT_MSG}'
George Keishing2cec1862018-09-03 12:59:25 -0500207
208 Should Contain ${remote_journald}
209 ... ${bmc_journald.split('${hostname}')[1]}
210 ... msg=The remote journald doesn't contain the boot message: ${BMC_BOOT_MSG}.
211
212
George Keishingcc18f7c2018-09-03 09:40:11 -0500213Verify BMC Journald Contains No Credential Data
George Keishingcb3b9b62018-09-14 12:11:19 -0500214 [Documentation] Check that BMC journald doesn't log any credential data.
George Keishingcc18f7c2018-09-03 09:40:11 -0500215 [Tags] Verify_BMC_Journald_Contains_No_Credential_Data
216
George Keishingc25c55d2018-10-30 02:23:44 -0500217 Initialize OpenBMC
George Keishing80bfd312019-03-19 12:05:24 -0500218
219 Create Redfish And IPMI Users
George Keishingc25c55d2018-10-30 02:23:44 -0500220
221 # Time for user manager to sync.
222 Sleep 5 s
223
George Keishingcc18f7c2018-09-03 09:40:11 -0500224 Open Connection And Log In
225 ${bmc_journald} ${stderr} ${rc}= BMC Execute Command
226 ... journalctl -o json-pretty | cat
227
George Keishing7981f432023-11-15 23:49:16 +0530228 Should Not Contain Any ${bmc_journald} ${OPENBMC_PASSWORD} ${valid_password}
George Keishingc15a7e62019-08-09 00:23:45 -0500229 ... ignore_case=False msg=Journald logs BMC credentials/password ${OPENBMC_PASSWORD}.
George Keishingcc18f7c2018-09-03 09:40:11 -0500230
231
George Keishing9a0d4802018-08-31 13:29:40 -0500232Audit BMC SSH Login And Remote Logging
233 [Documentation] Check that the SSH login to BMC is logged and synced to
234 ... remote logging server.
235 [Tags] Audit_BMC_SSH_Login_And_Remote_Logging
236
George Keishingaef483e2018-09-19 07:57:22 -0500237 ${login_footprint}= Catenate Started SSH Per-Connection Server
238 # Example: Just get the message part of the syslog
239 # Started SSH Per-Connection Server (xx.xx.xx.xx:51292)
240 ${cmd}= Catenate SEPARATOR= --no-pager | egrep '${login_footprint}'
241 ... | awk -F': ' '{print $2}'
George Keishing9a0d4802018-08-31 13:29:40 -0500242
George Keishingaef483e2018-09-19 07:57:22 -0500243 Start Journal Log filter=${cmd}
George Keishing9a0d4802018-08-31 13:29:40 -0500244 Open Connection And Log In
George Keishingaef483e2018-09-19 07:57:22 -0500245 Sleep 5s
246 ${bmc_journald}= Stop Journal Log
247 @{ssh_entry}= Split To Lines ${bmc_journald}
George Keishing9a0d4802018-08-31 13:29:40 -0500248
George Keishingaef483e2018-09-19 07:57:22 -0500249 ${cmd}= Catenate SEPARATOR= egrep -E '*${bmc_hostname}.*${login_footprint}' /var/log/syslog
George Keishing9a0d4802018-08-31 13:29:40 -0500250
251 ${remote_journald}= Remote Logging Server Execute Command command=${cmd}
252
George Keishingaef483e2018-09-19 07:57:22 -0500253 Should Contain ${remote_journald} ${ssh_entry[0]}
George Keishing9a0d4802018-08-31 13:29:40 -0500254 ... msg=${remote_journald} don't contain ${bmc_journald} entry.
255
256
George Keishing6218e762018-10-06 13:14:36 -0500257Verify Rsyslog Does Not Log On BMC
258 [Documentation] Check that rsyslog journald doesn't log on BMC.
259 [Tags] Verify_Rsyslog_Does_Not_Log_On_BMC
260
261 # Expected filter rsyslog entries.
262 # Example:
Joy Onyerikwudbfe97d2019-03-11 19:44:56 -0500263 # syslogd[3356]:
264 # [origin software="rsyslogd" swVersion="8.29.0" x-pid="3356" x-info="http://www.rsyslog.com"]
265 # exiting on signal 15.
266 # rsyslogd[3364]:
267 # [origin software="rsyslogd" swVersion="8.29.0" x-pid="3364" x-info="http://www.rsyslog.com"] start
George Keishing6218e762018-10-06 13:14:36 -0500268 ${bmc_journald} ${stderr} ${rc}= BMC Execute Command
269 ... journalctl -b --no-pager | egrep 'rsyslog' | egrep -Ev '${RSYSLOG_REGEX}|${RSYSLOG_RETRY_REGEX}'
270 ... ignore_err=${1}
271
272 Should Be Empty ${bmc_journald}
273 ... msg=${bmc_journald} contains unexpected rsyslog entries.
274
275
George Keishing76a5daf2018-09-14 06:00:01 -0500276Boot Host And Verify Data Is Synced To Remote Server
277 [Documentation] Boot host and verify the power on sequence logs are synced
278 ... to remote logging server.
279 [Tags] Boot_Host_And_Verify_Data_Is_Synced_To_Remote_Server
280
George Keishing307c3fa2018-10-25 11:43:23 -0500281 # Filter kernel dmesg from the journald log.
282 # Example: xx.xx.xx kernel:
283
284 ${openbmc_host_name} ${openbmc_ip} ${openbmc_short_name}=
285 ... Get Host Name IP host=${OPENBMC_HOST} short_name=1
286
287 ${cmd}= Catenate SEPARATOR= --no-pager | egrep -Ev '${BMC_SYSLOG_REGEX}
288 ... |${openbmc_short_name} kernel' | awk -F': ' '{print $2}'
George Keishing76a5daf2018-09-14 06:00:01 -0500289
290 # Example: Just get the message part of the syslog
291 # Started OpenPOWER OCC Active Disable.
292 Start Journal Log filter=${cmd}
293
294 # Irrespective of the outcome, the journald should be synced.
George Keishingf32ee4c2019-06-17 22:30:07 -0500295 Run Keyword And Ignore Error Redfish Power On
George Keishing76a5daf2018-09-14 06:00:01 -0500296 ${bmc_journald}= Stop Journal Log
297
George Keishing274f3bd2019-07-09 10:25:34 -0500298 ${cmd}= Catenate SEPARATOR= egrep -a '${bmc_hostname}' /var/log/syslog
George Keishing76a5daf2018-09-14 06:00:01 -0500299 ${remote_journald}= Remote Logging Server Execute Command command=${cmd}
300
301 @{lines}= Split To Lines ${bmc_journald}
George Keishing307c3fa2018-10-25 11:43:23 -0500302
Sushma M Md27fc312020-06-19 08:26:50 -0500303 FOR ${line} IN @{lines}
304 Log To Console \n ${line}
305 Should Contain ${remote_journald} ${line}
306 ... mgs=${line} line doesn't contain in ${remote_journald}.
307 END
George Keishing76a5daf2018-09-14 06:00:01 -0500308
309
George Keishing6a514ef2018-08-27 05:19:19 -0500310*** Keywords ***
311
312Suite Setup Execution
313 [Documentation] Do the suite setup.
314
315 Should Not Be Empty ${REMOTE_LOG_SERVER_HOST}
316 Should Not Be Empty ${REMOTE_LOG_SERVER_PORT}
George Keishing67133672018-08-31 10:23:15 -0500317 Should Not Be Empty ${REMOTE_USERNAME}
318 Should Not Be Empty ${REMOTE_PASSWORD}
George Keishing6a514ef2018-08-27 05:19:19 -0500319 Ping Host ${REMOTE_LOG_SERVER_HOST}
George Keishing67133672018-08-31 10:23:15 -0500320 Remote Logging Server Execute Command true
George Keishing6a514ef2018-08-27 05:19:19 -0500321 Remote Logging Interface Should Exist
322
George Keishing216e5842018-08-31 14:58:15 -0500323 ${hostname} ${stderr} ${rc}= BMC Execute Command /bin/hostname
324 Set Suite Variable ${bmc_hostname} ${hostname}
George Keishingbbfc3942018-09-19 10:15:48 -0500325 Configure Remote Log Server With Parameters
George Keishing216e5842018-08-31 14:58:15 -0500326
327
328Test Setup Execution
329 [Documentation] Do the test setup.
330
George Keishingb77a3572018-09-13 23:26:28 -0500331 # Retain only the past 1 second log:
332 BMC Execute Command journalctl --vacuum-time=1s
George Keishing13a64e62018-09-10 13:07:36 -0500333
334 ${config_status}= Run Keyword And Return Status
George Keishing216e5842018-08-31 14:58:15 -0500335 ... Get Remote Log Server Configured
336
George Keishingbbfc3942018-09-19 10:15:48 -0500337 Run Keyword If ${config_status}==${FALSE}
338 ... Configure Remote Log Server With Parameters
George Keishing216e5842018-08-31 14:58:15 -0500339
George Keishing6a514ef2018-08-27 05:19:19 -0500340
341Remote Logging Interface Should Exist
342 [Documentation] Check that the remote logging URI exist.
343
344 ${resp}= OpenBMC Get Request ${REMOTE_LOGGING_URI}
345 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
George Keishing38733f32018-09-20 05:56:50 -0500346
347
348Verify Configure Remote Logging Server
349 [Documentation] Configure the remote logging REST interface on BMC.
350 [Arguments] ${remote_host} ${remote_port} ${expectation}
351
352 # Description of argument(s):
353 # remote_host The host name or IP address of the remote logging server
354 # (e.g. "xx.xx.xx.xx").
355 # remote_port Remote ryslog server port number (e.g. "514").
356 # expectation Expect boolean True/False.
357
358
359 ${status}= Run Keyword And Return Status
George Keishingccd6d092018-09-21 00:39:43 -0500360 ... Configure Remote Log Server With Parameters remote_host=${remote_host} remote_port=${remote_port}
George Keishing38733f32018-09-20 05:56:50 -0500361
362 Should Be Equal ${status} ${expectation}
363 ... msg=Test result ${status} and expectation ${expectation} do not match.
George Keishing80bfd312019-03-19 12:05:24 -0500364
365
366Create Redfish And IPMI Users
367 [Documentation] Create a valid Redfish and IPMI local user accounts and
368 ... delete them.
369
370 # Create redfish local valid user.
371 ${redfish_username}= Generate Random String 8 [LETTERS]
372
373 Redfish.Login
374
375 ${payload}= Create Dictionary
376 ... UserName=${redfish_username} Password=${valid_password}
377 ... RoleId=Administrator Enabled=${True}
378 Redfish.Post /redfish/v1/AccountService/Accounts body=&{payload}
379 ... valid_status_codes=[${HTTP_CREATED}]
380
381 # Delete newly created user.
382 Redfish.Delete /redfish/v1/AccountService/Accounts/${redfish_username}
383
384 Redfish.Logout
385
386 # Create IPMI local valid user.
George Keishingc15a7e62019-08-09 00:23:45 -0500387 ${random_username}= Generate Random String 8 [LETTERS]
388 Set Test Variable ${random_username}
George Keishing80bfd312019-03-19 12:05:24 -0500389 ${random_userid}= Evaluate random.randint(2, 15) modules=random
George Keishingc15a7e62019-08-09 00:23:45 -0500390 IPMI Create User ${random_userid} ${random_username}
391
392 Run IPMI Standard Command user set password ${random_userid} ${valid_password}
393
394 ${msg}= Run IPMI Standard Command user test ${random_userid} ${max_password_length} ${valid_password}
395 Should Contain ${msg} Success
George Keishing80bfd312019-03-19 12:05:24 -0500396
397 # Delete IPMI user.
398 Run IPMI Standard Command user set name ${random_userid} ""