openldap-uid-username.feature 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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: Deleting an unavailable LDAP user
  104. Given As an "admin"
  105. And sending "GET" to "/cloud/users"
  106. And modify LDAP configuration
  107. | ldapUserFilter | (&(objectclass=inetorgperson)(!(uid=alice))) |
  108. And invoking occ with "ldap:check-user alice"
  109. And the command output contains the text "Clean up the user's remnants by"
  110. And invoking occ with "user:delete alice"
  111. Then the command output contains the text "The specified user was deleted"
  112. Scenario: Search only with group members - allowed
  113. Given modify LDAP configuration
  114. | ldapGroupFilter | cn=Orcharding |
  115. | ldapGroupMemberAssocAttr | member |
  116. | ldapBaseGroups | ou=OtherGroups,dc=nextcloud,dc=ci |
  117. | ldapAttributesForUserSearch | employeeNumber |
  118. | useMemberOfToDetectMembership | 1 |
  119. And parameter "shareapi_only_share_with_group_members" of app "core" is set to "yes"
  120. And As an "alice"
  121. When getting sharees for
  122. # "5" is part of the employee number of some LDAP records
  123. | search | 5 |
  124. | itemType | file |
  125. Then the OCS status code should be "200"
  126. And the HTTP status code should be "200"
  127. And "exact users" sharees returned is empty
  128. And "users" sharees returned are
  129. | Elisa | 0 | elisa |
  130. And "exact groups" sharees returned is empty