aboutsummaryrefslogtreecommitdiffstats
path: root/build/integration/ldap_features/ldap-openldap.feature
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2018-08-14 14:14:22 +0200
committerGitHub <noreply@github.com>2018-08-14 14:14:22 +0200
commitd05c815796152f0d76c459e893f154b3b78005aa (patch)
treea756ff4423b24f8fdcfaa3f90a0138734c6865ca /build/integration/ldap_features/ldap-openldap.feature
parentff50ef4b2192800ca7542929e408e67eceae1cef (diff)
parent24ef41454c59ebd17b2fceb336c2a690a854377b (diff)
downloadnextcloud-server-d05c815796152f0d76c459e893f154b3b78005aa.tar.gz
nextcloud-server-d05c815796152f0d76c459e893f154b3b78005aa.zip
Merge pull request #8855 from nextcloud/feature/noid/ldap-integration-autotests
behat integration tests for LDAP
Diffstat (limited to 'build/integration/ldap_features/ldap-openldap.feature')
-rw-r--r--build/integration/ldap_features/ldap-openldap.feature104
1 files changed, 104 insertions, 0 deletions
diff --git a/build/integration/ldap_features/ldap-openldap.feature b/build/integration/ldap_features/ldap-openldap.feature
new file mode 100644
index 00000000000..4c507e74595
--- /dev/null
+++ b/build/integration/ldap_features/ldap-openldap.feature
@@ -0,0 +1,104 @@
+Feature: LDAP
+ Background:
+ Given using api version "2"
+ And having a valid LDAP configuration
+
+ Scenario: Test valid configuration by logging in
+ Given Logging in using web as "alice"
+ And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
+ Then the HTTP status code should be "200"
+
+ Scenario: Test valid configuration with port in the hostname by logging in
+ Given modify LDAP configuration
+ | ldapHost | openldap:389 |
+ And cookies are reset
+ And Logging in using web as "alice"
+ And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
+ Then the HTTP status code should be "200"
+
+ Scenario: Test valid configuration with LDAP protocol by logging in
+ Given modify LDAP configuration
+ | ldapHost | ldap://openldap |
+ And cookies are reset
+ And Logging in using web as "alice"
+ And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
+ Then the HTTP status code should be "200"
+
+ Scenario: Test valid configuration with LDAP protoccol and port by logging in
+ Given modify LDAP configuration
+ | ldapHost | ldap://openldap:389 |
+ And cookies are reset
+ And Logging in using web as "alice"
+ And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
+ Then the HTTP status code should be "200"
+
+ Scenario: Look for a known LDAP user
+ Given As an "admin"
+ And sending "GET" to "/cloud/users?search=alice"
+ Then the OCS status code should be "200"
+ And looking up details for the first result matches expectations
+ | email | alice@nextcloud.ci |
+ | displayname | Alice |
+
+ Scenario: Test group filter with one specific group
+ Given modify LDAP configuration
+ | ldapGroupFilter | cn=RedGroup |
+ | ldapBaseGroups | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci |
+ And As an "admin"
+ And sending "GET" to "/cloud/groups"
+ Then the OCS status code should be "200"
+ And the "groups" result should match
+ | RedGroup | 1 |
+ | GreenGroup | 0 |
+ | BlueGroup | 0 |
+ | PurpleGroup | 0 |
+
+ Scenario: Test group filter with two specific groups
+ Given modify LDAP configuration
+ | ldapGroupFilter | (\|(cn=RedGroup)(cn=GreenGroup)) |
+ | ldapBaseGroups | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci |
+ And As an "admin"
+ And sending "GET" to "/cloud/groups"
+ Then the OCS status code should be "200"
+ And the "groups" result should match
+ | RedGroup | 1 |
+ | GreenGroup | 1 |
+ | BlueGroup | 0 |
+ | PurpleGroup | 0 |
+
+ Scenario: Test group filter ruling out a group from a different base
+ Given modify LDAP configuration
+ | ldapGroupFilter | (objectClass=groupOfNames) |
+ | ldapBaseGroups | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci |
+ And As an "admin"
+ And sending "GET" to "/cloud/groups"
+ Then the OCS status code should be "200"
+ And the "groups" result should match
+ | RedGroup | 1 |
+ | GreenGroup | 1 |
+ | BlueGroup | 1 |
+ | PurpleGroup | 1 |
+ | SquareGroup | 0 |
+
+ Scenario: Test backup server
+ Given modify LDAP configuration
+ | ldapBackupHost | openldap |
+ | ldapBackupPort | 389 |
+ | ldapHost | foo.bar |
+ | ldapPort | 2456 |
+ And Logging in using web as "alice"
+ Then the HTTP status code should be "200"
+
+ Scenario: Test backup server offline
+ Given modify LDAP configuration
+ | ldapBackupHost | off.line |
+ | ldapBackupPort | 3892 |
+ | ldapHost | foo.bar |
+ | ldapPort | 2456 |
+ Then Expect ServerException on failed web login as "alice"
+
+ Scenario: Test LDAP server offline, no backup server
+ Given modify LDAP configuration
+ | ldapHost | foo.bar |
+ | ldapPort | 2456 |
+ Then Expect ServerException on failed web login as "alice"