ldap-openldap.feature 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. Feature: LDAP
  2. Background:
  3. Given using api version "2"
  4. And having a valid LDAP configuration
  5. Scenario: Test valid configuration by logging in
  6. Given Logging in using web as "alice"
  7. And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
  8. Then the HTTP status code should be "200"
  9. Scenario: Test valid configuration with port in the hostname by logging in
  10. Given modify LDAP configuration
  11. | ldapHost | openldap:389 |
  12. And cookies are reset
  13. And Logging in using web as "alice"
  14. And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
  15. Then the HTTP status code should be "200"
  16. Scenario: Test valid configuration with LDAP protocol by logging in
  17. Given modify LDAP configuration
  18. | ldapHost | ldap://openldap |
  19. And cookies are reset
  20. And Logging in using web as "alice"
  21. And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
  22. Then the HTTP status code should be "200"
  23. Scenario: Test valid configuration with LDAP protocol and port by logging in
  24. Given modify LDAP configuration
  25. | ldapHost | ldap://openldap:389 |
  26. And cookies are reset
  27. And Logging in using web as "alice"
  28. And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
  29. Then the HTTP status code should be "200"
  30. Scenario: Look for a known LDAP user
  31. Given As an "admin"
  32. And sending "GET" to "/cloud/users?search=alice"
  33. Then the OCS status code should be "200"
  34. And looking up details for the first result matches expectations
  35. | email | alice@nextcloud.ci |
  36. | displayname | Alice |
  37. Scenario: Test group filter with one specific group
  38. Given modify LDAP configuration
  39. | ldapGroupFilter | cn=RedGroup |
  40. | ldapBaseGroups | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci |
  41. And As an "admin"
  42. And sending "GET" to "/cloud/groups"
  43. Then the OCS status code should be "200"
  44. And the "groups" result should match
  45. | RedGroup | 1 |
  46. | GreenGroup | 0 |
  47. | BlueGroup | 0 |
  48. | PurpleGroup | 0 |
  49. Scenario: Test group filter with two specific groups
  50. Given modify LDAP configuration
  51. | ldapGroupFilter | (\|(cn=RedGroup)(cn=GreenGroup)) |
  52. | ldapBaseGroups | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci |
  53. And As an "admin"
  54. And sending "GET" to "/cloud/groups"
  55. Then the OCS status code should be "200"
  56. And the "groups" result should match
  57. | RedGroup | 1 |
  58. | GreenGroup | 1 |
  59. | BlueGroup | 0 |
  60. | PurpleGroup | 0 |
  61. Scenario: Test group filter ruling out a group from a different base
  62. Given modify LDAP configuration
  63. | ldapGroupFilter | (objectClass=groupOfNames) |
  64. | ldapBaseGroups | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci |
  65. And As an "admin"
  66. And sending "GET" to "/cloud/groups"
  67. Then the OCS status code should be "200"
  68. And the "groups" result should match
  69. | RedGroup | 1 |
  70. | GreenGroup | 1 |
  71. | BlueGroup | 1 |
  72. | PurpleGroup | 1 |
  73. | SquareGroup | 0 |
  74. Scenario: Test backup server
  75. Given modify LDAP configuration
  76. | ldapBackupHost | openldap |
  77. | ldapBackupPort | 389 |
  78. | ldapHost | foo.bar |
  79. | ldapPort | 2456 |
  80. And Logging in using web as "alice"
  81. Then the HTTP status code should be "200"
  82. Scenario: Test backup server offline
  83. Given modify LDAP configuration
  84. | ldapBackupHost | off.line |
  85. | ldapBackupPort | 3892 |
  86. | ldapHost | foo.bar |
  87. | ldapPort | 2456 |
  88. Then Expect ServerException on failed web login as "alice"
  89. Scenario: Test LDAP server offline, no backup server
  90. Given modify LDAP configuration
  91. | ldapHost | foo.bar |
  92. | ldapPort | 2456 |
  93. Then Expect ServerException on failed web login as "alice"