blob: 180ce7fde8def7d215526c1567c8451328eea4c9 [file] [log] [blame]
George Keishingf1331672018-01-18 05:19:02 -06001*** Settings ***
2Documentation OpenBMC user management test.
3
Sweta Potthuria659ad22018-01-31 12:24:51 -06004Resource ../lib/rest_client.robot
5Resource ../lib/openbmc_ffdc.robot
George Keishingf1331672018-01-18 05:19:02 -06006Library SSHLibrary
7
8Test Teardown Test Teardown Execution
9
10*** Variables ****
11
George Keishingcf3df712018-10-29 09:12:58 -050012${test_password} 0penBmc123
George Keishingf1331672018-01-18 05:19:02 -060013
14*** Test Cases ***
15
Sivas SRR1a7502d2018-09-19 03:31:54 -050016
17Verify At Least One User In List
18 [Documentation] Verify user list API list minimum one user.
19 [Tags] Verify_At_Least_One_User_In_List
George Keishingb24adb32018-10-29 13:20:08 -050020 [Teardown] FFDC On Test Case Fail
Sivas SRR1a7502d2018-09-19 03:31:54 -050021
22 ${bmc_user_uris}= Read Properties ${BMC_USER_URI}list
23 Should Not Be Empty ${bmc_user_uris}
24
25
George Keishingf1331672018-01-18 05:19:02 -060026Verify Root Password Update
27 [Documentation] Update system "root" user password and verify.
28 [Tags] Verify_Root_Password_Update
29
30 Delete All Sessions
31
32 Initialize OpenBMC
33 Update Root Password ${test_password}
34
35 # Time for user manager to sync.
36 Sleep 5 s
37
38 Delete All Sessions
39
40 # SSH Login to BMC with new "root" password.
41 SSHLibrary.Open Connection ${OPENBMC_HOST}
42 Login ${OPENBMC_USERNAME} ${test_password}
43
44 # REST Login to BMC with new "root" password.
George Keishingcf3df712018-10-29 09:12:58 -050045 Initialize OpenBMC REST_PASSWORD=${test_password}
George Keishingf1331672018-01-18 05:19:02 -060046
47 ${resp}= Get Request openbmc ${BMC_USER_URI}enumerate
48 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
49 ... msg=Verify of new root password failed, RC=${resp.status_code}.
50
51
52*** Keywords ***
53
54Test Teardown Execution
55 [Documentation] Do test teardown task.
56
57 # REST Login to BMC with new "root" password.
George Keishingcf3df712018-10-29 09:12:58 -050058 Initialize OpenBMC REST_PASSWORD=${test_password}
George Keishingf1331672018-01-18 05:19:02 -060059 Update Root Password
60 Sleep 5 s
61 Delete All Sessions
62
63 # SSH Login to BMC with user default "root" password.
64 SSHLibrary.Open Connection ${OPENBMC_HOST}
65 Login ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD}
66
67 # REST Login to BMC with user default "root" password.
68 Initialize OpenBMC
69
70 FFDC On Test Case Fail
71 Close All Connections
72
73
74Update Root Password
75 [Documentation] Update system default "root" user password.
76 [Arguments] ${user_password}=${OPENBMC_PASSWORD}
77
78 # Description of argument(s):
79 # user_password User password string.
80
81 @{password} = Create List ${user_password}
82 ${data} = Create Dictionary data=@{password}
83
84 ${headers} = Create Dictionary Content-Type=application/json
85 ${resp} = Post Request openbmc ${BMC_USER_URI}root/action/SetPassword
86 ... data=${data} headers=${headers}
87 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
88 ... msg=Updating the new root password failed, RC=${resp.status_code}.