openldap-uid-username.feature 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. Feature: LDAP
  2. Background:
  3. Given using api version "2"
  4. And having a valid LDAP configuration
  5. And modify LDAP configuration
  6. | ldapExpertUsernameAttr | uid |
  7. Scenario: Look for a expected LDAP users
  8. Given As an "admin"
  9. And sending "GET" to "/cloud/users"
  10. Then the OCS status code should be "200"
  11. And the "users" result should match
  12. | alice | 1 |
  13. | elisa | 1 |
  14. | ghost | 0 |
  15. Scenario: check default home of an LDAP user
  16. Given As an "admin"
  17. And sending "GET" to "/cloud/users/alice"
  18. Then the OCS status code should be "200"
  19. And the record's fields should match
  20. | storageLocation | /dev/shm/nc_int/alice |
  21. Scenario: check custom relative home of an LDAP user
  22. Given modify LDAP configuration
  23. | homeFolderNamingRule | sn |
  24. And As an "admin"
  25. And sending "GET" to "/cloud/users/alice"
  26. Then the OCS status code should be "200"
  27. And the record's fields should match
  28. | storageLocation | /dev/shm/nc_int/Alfgeirdottir |
  29. Scenario: check custom absolute home of an LDAP user
  30. Given modify LDAP configuration
  31. | homeFolderNamingRule | roomNumber |
  32. And As an "admin"
  33. And sending "GET" to "/cloud/users/elisa"
  34. Then the OCS status code should be "200"
  35. And the record's fields should match
  36. | storageLocation | /dev/shm/elisa-data |
  37. Scenario: Fetch all users, invoking pagination
  38. Given modify LDAP configuration
  39. | ldapBaseUsers | ou=PagingTest,dc=nextcloud,dc=ci |
  40. | ldapPagingSize | 2 |
  41. And As an "admin"
  42. And sending "GET" to "/cloud/users"
  43. Then the OCS status code should be "200"
  44. And the "users" result should match
  45. | ebba | 1 |
  46. | eindis | 1 |
  47. | fjolnir | 1 |
  48. | gunna | 1 |
  49. | juliana | 1 |
  50. | leo | 1 |
  51. | stigur | 1 |
  52. Scenario: Fetch all users, invoking pagination
  53. Given modify LDAP configuration
  54. | ldapBaseUsers | ou=PagingTest,dc=nextcloud,dc=ci |
  55. | ldapPagingSize | 2 |
  56. And As an "admin"
  57. And sending "GET" to "/cloud/users?limit=10"
  58. Then the OCS status code should be "200"
  59. And the "users" result should match
  60. | ebba | 1 |
  61. | eindis | 1 |
  62. | fjolnir | 1 |
  63. | gunna | 1 |
  64. | juliana | 1 |
  65. | leo | 1 |
  66. | stigur | 1 |
  67. Scenario: Fetch from second batch of all users, invoking pagination
  68. Given modify LDAP configuration
  69. | ldapBaseUsers | ou=PagingTest,dc=nextcloud,dc=ci |
  70. | ldapPagingSize | 2 |
  71. And As an "admin"
  72. And sending "GET" to "/cloud/users?limit=10&offset=2"
  73. Then the OCS status code should be "200"
  74. And the "users" result should contain "5" of
  75. | ebba |
  76. | eindis |
  77. | fjolnir |
  78. | gunna |
  79. | juliana |
  80. | leo |
  81. | stigur |
  82. Scenario: Fetch from second batch of all users, invoking pagination with two bases
  83. Given modify LDAP configuration
  84. | ldapBaseUsers | ou=PagingTest,dc=nextcloud,dc=ci;ou=PagingTestSecondBase,dc=nextcloud,dc=ci |
  85. | ldapPagingSize | 2 |
  86. And As an "admin"
  87. And sending "GET" to "/cloud/users?limit=10&offset=2"
  88. Then the OCS status code should be "200"
  89. And the "users" result should contain "5" of
  90. | ebba |
  91. | eindis |
  92. | fjolnir |
  93. | gunna |
  94. | juliana |
  95. | leo |
  96. | stigur |
  97. And the "users" result should contain "3" of
  98. | allisha |
  99. | dogukan |
  100. | lloyd |
  101. | priscilla |
  102. | shannah |
  103. Scenario: Fetch from second batch of all users, invoking pagination with two bases, third page
  104. Given modify LDAP configuration
  105. | ldapBaseUsers | ou=PagingTest,dc=nextcloud,dc=ci;ou=PagingTestSecondBase,dc=nextcloud,dc=ci |
  106. | ldapPagingSize | 2 |
  107. And As an "admin"
  108. And sending "GET" to "/cloud/users?limit=10&offset=4"
  109. Then the OCS status code should be "200"
  110. And the "users" result should contain "3" of
  111. | ebba |
  112. | eindis |
  113. | fjolnir |
  114. | gunna |
  115. | juliana |
  116. | leo |
  117. | stigur |
  118. And the "users" result should contain "1" of
  119. | allisha |
  120. | dogukan |
  121. | lloyd |
  122. | priscilla |
  123. | shannah |
  124. Scenario: Deleting an unavailable LDAP user
  125. Given As an "admin"
  126. And sending "GET" to "/cloud/users"
  127. And modify LDAP configuration
  128. | ldapUserFilter | (&(objectclass=inetorgperson)(!(uid=alice))) |
  129. And invoking occ with "ldap:check-user alice"
  130. And the command output contains the text "Clean up the user's remnants by"
  131. And invoking occ with "user:delete alice"
  132. Then the command output contains the text "The specified user was deleted"
  133. Scenario: Search only with group members - allowed
  134. Given modify LDAP configuration
  135. | ldapGroupFilter | cn=Orcharding |
  136. | ldapGroupMemberAssocAttr | member |
  137. | ldapBaseGroups | ou=OtherGroups,dc=nextcloud,dc=ci |
  138. | ldapAttributesForUserSearch | employeeNumber |
  139. | useMemberOfToDetectMembership | 1 |
  140. And parameter "shareapi_only_share_with_group_members" of app "core" is set to "yes"
  141. And As an "alice"
  142. When getting sharees for
  143. # "5" is part of the employee number of some LDAP records
  144. | search | 5 |
  145. | itemType | file |
  146. Then the OCS status code should be "200"
  147. And the HTTP status code should be "200"
  148. And "exact users" sharees returned is empty
  149. And "users" sharees returned are
  150. | Elisa | 0 | elisa |
  151. And "exact groups" sharees returned is empty