blob: a92ed47c67d12371ae06182887ad8aaa9435717f [file] [log] [blame]
Anves Kumar rayankulaa87b1b12020-05-06 01:18:28 -05001*** Settings ***
2Documentation Test root user expire password.
3
4Resource ../lib/resource.robot
5Resource ../lib/bmc_redfish_resource.robot
6Resource ../lib/ipmi_client.robot
7Library ../lib/bmc_ssh_utils.py
8Library SSHLibrary
9
10Test Setup Test Setup Execution
11Test Teardown Test Teardown Execution
12
13*** Test Cases ***
14
15Expire Root Password And Check IPMI Access Fails
16 [Documentation] Expire root user password and expect an error while access via IPMI.
17 [Tags] Expire_Root_Password_And_Check_IPMI_Access_Fails
18 [Teardown] Run Keywords FFDC On Test Case Fail AND
19 ... Wait Until Keyword Succeeds 1 min 10 sec
20 ... Restore Default Password For Root User
21
22 Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD}
23
24 ${output} ${stderr} ${rc}= BMC Execute Command passwd --expire ${OPENBMC_USERNAME}
25 Should Contain ${output} password expiry information changed
26
27 ${status}= Run Keyword And Return Status Run External IPMI Standard Command lan print -v
28 Should Be Equal ${status} ${False}
29
30
31*** Keywords ***
32
33Test Setup Execution
34 [Documentation] Test setup execution.
35
36 Redfish.login
37 Valid Length OPENBMC_PASSWORD min_length=8
38
39Restore Default Password For Root User
40 [Documentation] Restore default password for root user (i.e. 0penBmc).
41
42 # Set default password for root user.
43 ${result}= Redfish.Patch /redfish/v1/AccountService/Accounts/${OPENBMC_USERNAME}
44 ... body={'Password': '${OPENBMC_PASSWORD}'}
45 # Verify that root user is able to run Redfish command using default password.
46 Redfish.login