Skip to content

Commit 2f1ca98

Browse files
committed
add test for dynamic user id and thus run against master
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
1 parent 4338fed commit 2f1ca98

File tree

4 files changed

+26
-5
lines changed

4 files changed

+26
-5
lines changed

.drone.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ trigger:
6060
- push
6161
---
6262
kind: pipeline
63-
name: integration-stable16
63+
name: integration-master
6464
steps:
6565
- name: integration
6666
image: nextcloudci/php7.1:php7.1-16
6767
environment:
6868
APP_NAME: ldap_write_support
69-
CORE_BRANCH: stable16
69+
CORE_BRANCH: master
7070
DB: sqlite
7171
commands:
7272
# Pre-setup steps

tests/integration/features/bootstrap/FeatureContext.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,11 @@
2525
use Behat\Behat\Context\Context;
2626

2727
class FeatureContext extends LDAPContext implements Context {
28+
29+
/**
30+
* @BeforeScenario
31+
*/
32+
public function ensureNoBrandNewUser() {
33+
$this->deleteUser('brand-new-user');
34+
}
2835
}

tests/integration/features/user.feature

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ Feature: user
33
Background:
44
Given using api version "2"
55
And having a valid LDAP configuration
6+
And modify LDAP configuration
7+
| ldapBaseUsers | ou=PagingTest,dc=nextcloud,dc=ci |
68

79
Scenario: create a new user
810
Given As an "admin"
9-
And modify LDAP configuration
10-
| ldapBaseUsers | ou=PagingTest,dc=nextcloud,dc=ci |
1111
And user "brand-new-user" does not exist
1212
When sending "POST" to "/cloud/users" with
1313
| userid | brand-new-user |
@@ -17,4 +17,15 @@ Feature: user
1717
And user "brand-new-user" exists
1818
And invoking occ with "user:info brand-new-user"
1919
And the command output contains the text "backend: LDAP"
20+
21+
# requires NC 17
22+
Scenario: create a new user with dynamic user id
23+
Given As an "admin"
24+
And parameter "newUser.generateUserID" of app "core" is set to "yes"
25+
When sending "POST" to "/cloud/users" with
26+
| userid | |
27+
| password | 123456 |
28+
Then the OCS status code should be "200"
29+
And the HTTP status code should be "200"
30+
2031

tests/integration/run.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ HIDE_OC_LOGS=$2
1212
)
1313
INSTALLED=$($OCC status | grep installed: | cut -d " " -f 5)
1414

15-
if [ "$INSTALLED" != "true" ]; then
15+
if [ "$INSTALLED" == "true" ]; then
16+
$OCC app:enable user_ldap
17+
$OCC app:enable ldap_write_support
18+
else
1619
echo "Nextcloud instance needs to be installed" >&2
1720
exit 1
1821
fi

0 commit comments

Comments
 (0)