simplify tests and move some out to a new feature as we need a pristine

database for them

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2018-04-13 15:39:12 +02:00
parent eaf352b8d1
commit 8808da816d
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
3 changed files with 35 additions and 27 deletions

View File

@ -572,6 +572,16 @@ pipeline:
when: when:
matrix: matrix:
TESTS: integration-ldap-openldap-features TESTS: integration-ldap-openldap-features
integration-ldap-openldap-uid-features:
image: nextcloudci/integration-php7.0:integration-php7.0-6
commands:
- ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
- ./occ app:enable user_ldap
- cd build/integration
- ./run.sh ldap_features/openldap-uid-username.feature
when:
matrix:
TESTS: integration-ldap-openldap-uid-features
integration-trashbin: integration-trashbin:
image: nextcloudci/integration-php7.0:integration-php7.0-8 image: nextcloudci/integration-php7.0:integration-php7.0-8
commands: commands:
@ -840,6 +850,8 @@ matrix:
- TESTS: integration-ldap-features - TESTS: integration-ldap-features
- TESTS: integration-ldap-openldap-features - TESTS: integration-ldap-openldap-features
ENABLE_OPENLDAP: true ENABLE_OPENLDAP: true
- TESTS: integration-ldap-openldap-uid-features
ENABLE_OPENLDAP: true
- TESTS: integration-trashbin - TESTS: integration-trashbin
- TESTS: integration-remote-api - TESTS: integration-remote-api
- TESTS: integration-download - TESTS: integration-download

View File

@ -1,36 +1,23 @@
Feature: LDAP Feature: LDAP
Background: Background:
Given using api version "2" Given using api version "2"
And having a valid LDAP configuration
Scenario: Test valid configuration by logging in Scenario: Test valid configuration by logging in
Given having a valid LDAP configuration Given Logging in using web as "alice"
When Logging in using web as "alice"
And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
Then the HTTP status code should be "200" Then the HTTP status code should be "200"
Scenario: Look for a known LDAP user Scenario: Look for a known LDAP user
Given having a valid LDAP configuration Given As an "admin"
And As an "admin"
And sending "GET" to "/cloud/users?search=alice" And sending "GET" to "/cloud/users?search=alice"
Then the OCS status code should be "200" Then the OCS status code should be "200"
And looking up details for the first result matches expectations And looking up details for the first result matches expectations
| email | alice@nextcloud.ci | | email | alice@nextcloud.ci |
| displayname | Alice | | displayname | Alice |
Scenario: Look for a expected LDAP users
Given having a valid LDAP configuration
And modify LDAP configuration
| ldapExpertUsernameAttr | uid |
And As an "admin"
And sending "GET" to "/cloud/users"
Then the OCS status code should be "200"
And the "users" result should match
| alice | 1 |
| ghost | 0 |
Scenario: Test group filter with one specific group Scenario: Test group filter with one specific group
Given having a valid LDAP configuration Given modify LDAP configuration
And modify LDAP configuration
| ldapGroupFilter | cn=RedGroup | | ldapGroupFilter | cn=RedGroup |
| ldapBaseGroups | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci | | ldapBaseGroups | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci |
And As an "admin" And As an "admin"
@ -43,8 +30,7 @@ Feature: LDAP
| PurpleGroup | 0 | | PurpleGroup | 0 |
Scenario: Test group filter with two specific groups Scenario: Test group filter with two specific groups
Given having a valid LDAP configuration Given modify LDAP configuration
And modify LDAP configuration
| ldapGroupFilter | (\|(cn=RedGroup)(cn=GreenGroup)) | | ldapGroupFilter | (\|(cn=RedGroup)(cn=GreenGroup)) |
| ldapBaseGroups | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci | | ldapBaseGroups | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci |
And As an "admin" And As an "admin"
@ -57,8 +43,7 @@ Feature: LDAP
| PurpleGroup | 0 | | PurpleGroup | 0 |
Scenario: Test group filter ruling out a group from a different base Scenario: Test group filter ruling out a group from a different base
Given having a valid LDAP configuration Given modify LDAP configuration
And modify LDAP configuration
| ldapGroupFilter | (objectClass=groupOfNames) | | ldapGroupFilter | (objectClass=groupOfNames) |
| ldapBaseGroups | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci | | ldapBaseGroups | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci |
And As an "admin" And As an "admin"
@ -72,8 +57,7 @@ Feature: LDAP
| SquareGroup | 0 | | SquareGroup | 0 |
Scenario: Test backup server Scenario: Test backup server
Given having a valid LDAP configuration Given modify LDAP configuration
And modify LDAP configuration
| ldapBackupHost | openldap | | ldapBackupHost | openldap |
| ldapBackupPort | 389 | | ldapBackupPort | 389 |
| ldapHost | foo.bar | | ldapHost | foo.bar |
@ -82,8 +66,7 @@ Feature: LDAP
Then the HTTP status code should be "200" Then the HTTP status code should be "200"
Scenario: Test backup server offline Scenario: Test backup server offline
Given having a valid LDAP configuration Given modify LDAP configuration
And modify LDAP configuration
| ldapBackupHost | off.line | | ldapBackupHost | off.line |
| ldapBackupPort | 3892 | | ldapBackupPort | 3892 |
| ldapHost | foo.bar | | ldapHost | foo.bar |
@ -91,8 +74,7 @@ Feature: LDAP
Then Expect ServerException on failed web login as "alice" Then Expect ServerException on failed web login as "alice"
Scenario: Test LDAP server offline, no backup server Scenario: Test LDAP server offline, no backup server
Given having a valid LDAP configuration Given modify LDAP configuration
And modify LDAP configuration
| ldapHost | foo.bar | | ldapHost | foo.bar |
| ldapPort | 2456 | | ldapPort | 2456 |
Then Expect ServerException on failed web login as "alice" Then Expect ServerException on failed web login as "alice"

View File

@ -0,0 +1,14 @@
Feature: LDAP
Background:
Given using api version "2"
And having a valid LDAP configuration
And modify LDAP configuration
| ldapExpertUsernameAttr | uid |
Scenario: Look for a expected LDAP users
Given As an "admin"
And sending "GET" to "/cloud/users"
Then the OCS status code should be "200"
And the "users" result should match
| alice | 1 |
| ghost | 0 |