Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2018-05-22 19:07:25 +0300
committerArthur Schiwon <blizzz@arthur-schiwon.de>2018-08-10 01:28:44 +0300
commit59e35e3bf7fc46980bd6d415e1a56c6be81c6899 (patch)
treeb7151ffc796f38576feaafd760a500139399d3ea /build/integration
parentb069b132267aee0f34da5bf16c828de66ec518ed (diff)
tests for user storage location
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'build/integration')
-rw-r--r--build/integration/features/bootstrap/LDAPContext.php23
-rw-r--r--build/integration/ldap_features/ldap-openldap.feature4
-rw-r--r--build/integration/ldap_features/openldap-uid-username.feature28
3 files changed, 44 insertions, 11 deletions
diff --git a/build/integration/features/bootstrap/LDAPContext.php b/build/integration/features/bootstrap/LDAPContext.php
index 5b226753e5c..30e3d1a3d2f 100644
--- a/build/integration/features/bootstrap/LDAPContext.php
+++ b/build/integration/features/bootstrap/LDAPContext.php
@@ -116,14 +116,7 @@ class LDAPContext implements Context {
$userId = array_shift($userResults);
$this->sendingTo('GET', '/cloud/users/' . $userId);
-
- foreach($expectations->getRowsHash() as $k => $v) {
- $value = (string)simplexml_load_string($this->response->getBody())->data[0]->$k;
- PHPUnit_Framework_Assert::assertEquals($v, $value);
- }
-
- $backend = (string)simplexml_load_string($this->response->getBody())->data[0]->backend;
- PHPUnit_Framework_Assert::assertEquals('LDAP', $backend);
+ $this->theRecordFieldsShouldMatch($expectations);
}
/**
@@ -180,6 +173,20 @@ class LDAPContext implements Context {
$uidsFound++;
}
}
+ error_log('result array ' . json_encode($extractedIDsArray)); ## TODO remove debug statement
PHPUnit_Framework_Assert::assertSame((int)$expectedCount, $uidsFound);
}
+
+ /**
+ * @Given /^the record's fields should match$/
+ */
+ public function theRecordFieldsShouldMatch(TableNode $expectations) {
+ foreach($expectations->getRowsHash() as $k => $v) {
+ $value = (string)simplexml_load_string($this->response->getBody())->data[0]->$k;
+ PHPUnit_Framework_Assert::assertEquals($v, $value);
+ }
+
+ $backend = (string)simplexml_load_string($this->response->getBody())->data[0]->backend;
+ PHPUnit_Framework_Assert::assertEquals('LDAP', $backend);
+ }
}
diff --git a/build/integration/ldap_features/ldap-openldap.feature b/build/integration/ldap_features/ldap-openldap.feature
index 299142cfedc..4c507e74595 100644
--- a/build/integration/ldap_features/ldap-openldap.feature
+++ b/build/integration/ldap_features/ldap-openldap.feature
@@ -37,8 +37,8 @@ Feature: LDAP
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 |
+ | email | alice@nextcloud.ci |
+ | displayname | Alice |
Scenario: Test group filter with one specific group
Given modify LDAP configuration
diff --git a/build/integration/ldap_features/openldap-uid-username.feature b/build/integration/ldap_features/openldap-uid-username.feature
index aa6010875c1..d267870ca26 100644
--- a/build/integration/ldap_features/openldap-uid-username.feature
+++ b/build/integration/ldap_features/openldap-uid-username.feature
@@ -11,8 +11,34 @@ Feature: LDAP
Then the OCS status code should be "200"
And the "users" result should match
| alice | 1 |
+ | elisa | 1 |
| ghost | 0 |
+ Scenario: check default home of an LDAP user
+ Given As an "admin"
+ And sending "GET" to "/cloud/users/alice"
+ Then the OCS status code should be "200"
+ And the record's fields should match
+ | storageLocation | /dev/shm/nc_int/alice |
+
+ Scenario: check custom relative home of an LDAP user
+ Given modify LDAP configuration
+ | homeFolderNamingRule | sn |
+ And As an "admin"
+ And sending "GET" to "/cloud/users/alice"
+ Then the OCS status code should be "200"
+ And the record's fields should match
+ | storageLocation | /dev/shm/nc_int/Alfgeirdottir |
+
+ Scenario: check custom absolute home of an LDAP user
+ Given modify LDAP configuration
+ | homeFolderNamingRule | roomNumber |
+ And As an "admin"
+ And sending "GET" to "/cloud/users/elisa"
+ Then the OCS status code should be "200"
+ And the record's fields should match
+ | storageLocation | /dev/shm/elisa-data |
+
Scenario: Fetch all users, invoking pagination
Given modify LDAP configuration
| ldapBaseUsers | ou=PagingTest,dc=nextcloud,dc=ci |
@@ -45,7 +71,7 @@ Feature: LDAP
| leo | 1 |
| stigur | 1 |
- Scenario: Fetch first foall users, invoking pagination
+ Scenario: Fetch from second batch of all users, invoking pagination
Given modify LDAP configuration
| ldapBaseUsers | ou=PagingTest,dc=nextcloud,dc=ci |
| ldapPagingSize | 2 |