blob: 0062e60f95a6605a1b7f1c1343fd8a3a394b5ec0 [file] [log] [blame]
Sivas SRR3ef3bea2018-10-03 09:59:32 -05001*** Settings ***
2Documentation OpenBMC LDAP user management test.
3
4Resource ../lib/rest_client.robot
5Resource ../lib/openbmc_ffdc.robot
Sivas SRR396cf142018-12-04 07:06:27 -06006Resource ../lib/user_utils.robot
Sivas SRR39909e32018-11-09 18:58:36 -06007Library ../lib/bmc_ssh_utils.py
Sivas SRR3ef3bea2018-10-03 09:59:32 -05008
9Suite Setup Suite Setup Execution
10Test Teardown FFDC On Test Case Fail
11
12*** Variables ****
13
14*** Test Cases ***
15
Sivas SRR39909e32018-11-09 18:58:36 -060016Verify LDAP API Available
Sivas SRR3ef3bea2018-10-03 09:59:32 -050017 [Documentation] Verify LDAP client service is running and API available.
Sivas SRR39909e32018-11-09 18:58:36 -060018 [Tags] Verify_LDAP_API_Available
Sivas SRR3ef3bea2018-10-03 09:59:32 -050019
Sivas SRR3ef3bea2018-10-03 09:59:32 -050020 ${resp}= Read Properties ${BMC_LDAP_URI}
Sivas SRR39909e32018-11-09 18:58:36 -060021 Should Be Empty ${resp}
Sivas SRR3ef3bea2018-10-03 09:59:32 -050022
23
Sivas SRR396cf142018-12-04 07:06:27 -060024Verify User Group And Privilege Created
25 [Documentation] Verify user group and associated privilege is created.
26 [Tags] Verify_User_Group_And_Privilege_Created
27 [Teardown] FFDC On Test Case Fail
28
29 Create Group And Privilege ${GROUP_NAME} ${GROUP_PRIVILEGE}
30 ${bmc_user_uris}= Read Properties ${BMC_USER_URI}ldap/enumerate
31 ${bmc_user_uris}= Convert To String ${bmc_user_uris}
32 Should Contain ${bmc_user_uris} ${GROUP_NAME}
33 Should Contain ${bmc_user_uris} ${GROUP_PRIVILEGE}
34
Sivas SRR3ef3bea2018-10-03 09:59:32 -050035Verify LDAP Config Is Created
36 [Documentation] Verify LDAP config is created in BMC.
37 [Tags] Verify_LDAP_Config_Is_Created
38
Sivas SRR39909e32018-11-09 18:58:36 -060039 Configure LDAP Server On BMC
Sivas SRR3ef3bea2018-10-03 09:59:32 -050040 Check LDAP Config File Generated
41
42
43Verify LDAP Config Is Deleted
44 [Documentation] Verify LDAP config is deleted in BMC.
45 [Tags] Verify_LDAP_Config_Is_Deleted
46
47 Delete LDAP Config
48 Check LDAP Config File Deleted
49
50
51Verify LDAP User Able To Login Using REST
52 [Documentation] Verify LDAP user able to login using REST.
53 [Tags] Verify_LDAP_User_Able_To_Login_Using_REST
54
Sivas SRR39909e32018-11-09 18:58:36 -060055 Configure LDAP Server On BMC
Sivas SRR3ef3bea2018-10-03 09:59:32 -050056 Check LDAP Config File Generated
Sivas SRR39909e32018-11-09 18:58:36 -060057 Sleep 60s
Sivas SRR3ef3bea2018-10-03 09:59:32 -050058
59 # REST Login to BMC with LDAP user and password.
Sivas SRR7353f5b2018-11-21 02:43:18 -060060 Initialize OpenBMC 60 1 ${LDAP_USER} ${LDAP_USER_PASSWORD}
Sivas SRR3ef3bea2018-10-03 09:59:32 -050061
62 ${bmc_user_uris}= Read Properties ${BMC_USER_URI}list
63 Should Not Be Empty ${bmc_user_uris}
64
65
66Verify LDAP User Able to Logout Using REST
67 [Documentation] Verify LDAP user able to logout using REST.
68 [Tags] Verify_LDAP_User_Able_To_Logout_Using_REST
69
Sivas SRR39909e32018-11-09 18:58:36 -060070 Configure LDAP Server On BMC
71 Sleep 60s
Sivas SRR3ef3bea2018-10-03 09:59:32 -050072 Check LDAP Config File Generated
Sivas SRR39909e32018-11-09 18:58:36 -060073 Sleep 60s
Sivas SRR3ef3bea2018-10-03 09:59:32 -050074
75 # REST Login to BMC with LDAP user and password.
Sivas SRR7353f5b2018-11-21 02:43:18 -060076 Initialize OpenBMC 60 1 ${LDAP_USER} ${LDAP_USER_PASSWORD}
Sivas SRR3ef3bea2018-10-03 09:59:32 -050077
78 # REST Logout from BMC.
79 Log Out OpenBMC
80
Sivas SRR3ef3bea2018-10-03 09:59:32 -050081
Sivas SRR39909e32018-11-09 18:58:36 -060082Verify LDAP Server URI Is Set
83 [Documentation] Verify LDAP Server URI is set using REST.
84 [Tags] Verify_LDAP_Server_URI_Is_Set
85
86 # Example: LDAP URI should be either ldap://<LDAP IP / Hostname> or
87 # ldaps://<LDAP IP / Hostname>
88 Should Contain ${LDAP_SERVER_URI} ldap
89 ${ldap_server}= Create Dictionary data=${LDAP_SERVER_URI}
90 Write Attribute ${BMC_LDAP_URI}/config LDAPServerURI data=${ldap_server}
91 ... verify=${True} expected_value=${LDAP_SERVER_URI}
92
93
94Verify LDAP Server BIND DN Is Set
95 [Documentation] Verify LDAP BIND DN is set using REST.
96 [Tags] Verify_LDAP_Server_BIND_DN_Is_Set
97
98 ${ldap_server_binddn}= Create Dictionary data=${LDAP_BIND_DN}
99 Write Attribute ${BMC_LDAP_URI}/config LDAPBindDN data=${ldap_server_binddn}
100 ... verify=${True} expected_value=${LDAP_BIND_DN}
101
102
103Verify LDAP Server BASE DN Is Set
104 [Documentation] Verify LDAP BASE DN is set using REST.
105 [Tags] Verify_LDAP_Server_BASE_DN_Is_Set
106
107 ${ldap_server_basedn}= Create Dictionary data=${LDAP_BASE_DN}
108 Write Attribute ${BMC_LDAP_URI}/config LDAPBaseDN data=${ldap_server_basedn}
109 ... verify=${True} expected_value=${LDAP_BASE_DN}
110
111
Sivas SRR7353f5b2018-11-21 02:43:18 -0600112Verify LDAP Server Type Is Set As Active Directory
113 [Documentation] Verify LDAP server type is set as "Active Directory"
114 ... using REST.
115 [Tags] Verify_LDAP_Server_Type_Is_Set_As_Active_Directory
116 [Template] Modify LDAP Server Type
Sivas SRR39909e32018-11-09 18:58:36 -0600117
Sivas SRR7353f5b2018-11-21 02:43:18 -0600118 # Server type as ActiveDirectory
119 xyz.openbmc_project.User.Ldap.Config.Type.ActiveDirectory
Sivas SRR39909e32018-11-09 18:58:36 -0600120
121
Sivas SRR7353f5b2018-11-21 02:43:18 -0600122Verify LDAP Server Type Is Set As Open LDAP
123 [Documentation] Verify LDAP server type is set as "OpenLDAP"
124 ... using REST.
125 [Tags] Verify_LDAP_Server_Type_Is_Set_As_Open_LDAP
126 [Template] Modify LDAP Server Type
Sivas SRR39909e32018-11-09 18:58:36 -0600127
Sivas SRR7353f5b2018-11-21 02:43:18 -0600128 # Server type as OpenLdap
129 xyz.openbmc_project.User.Ldap.Config.Type.OpenLdap
130
131
132Verify LDAP Search Scope Is Set As One
133 [Documentation] Verify LDAP search scope is set as "one" using REST.
134 [Tags] Verify_LDAP_Search_Scope_Is_Set_As_One
135 [Template] Modify LDAP Search Scope
136
137 # Search Scope as one
138 xyz.openbmc_project.User.Ldap.Config.SearchScope.one
139
140
141Verify LDAP Search Scope Is Set As Base
142 [Documentation] Verify LDAP search scope is set as "base" using REST.
143 [Tags] Verify_LDAP_Search_Scope_Is_Set_As_Base
144 [Template] Modify LDAP Search Scope
145
146 # Search Scope as base
147 xyz.openbmc_project.User.Ldap.Config.SearchScope.base
148
149Verify LDAP Search Scope Is Set As Sub
150 [Documentation] Verify LDAP search scope is set as "sub" using REST.
151 [Tags] Verify_LDAP_Search_Scope_Is_Set_As_Sub
152 [Template] Modify LDAP Search Scope
153
154 # Search Scope as sub
155 xyz.openbmc_project.User.Ldap.Config.SearchScope.sub
Sivas SRR39909e32018-11-09 18:58:36 -0600156
157
158Verify LDAP Binddn Password Is Set
159 [Documentation] Verify LDAP Binddn password is set using REST.
160 [Tags] Verify_LDAP_Binddn_Password_Is_Set
161
162 ${ldap_binddn_passwd}= Create Dictionary data=${LDAP_BIND_DN_PASSWORD}
163 Write Attribute ${BMC_LDAP_URI}/config LDAPBINDDNpassword data=${ldap_binddn_passwd}
164 ... verify=${True} expected_value=${LDAP_BIND_DN_PASSWORD}
Sivas SRR3ef3bea2018-10-03 09:59:32 -0500165
166
Sivas SRR396cf142018-12-04 07:06:27 -0600167Delete LDAP Group
168 [Documentation] Delete LDAP group which is configured.
169 [Tags] Delete_LDAP_Group
Sivas SRR3ef3bea2018-10-03 09:59:32 -0500170
Sivas SRR396cf142018-12-04 07:06:27 -0600171 Delete Defined LDAP Group And Privilege ${GROUP_NAME}