Skip to content

Commit

Permalink
Merge pull request #39910 from owncloud/adjust-ldap-test-code
Browse files Browse the repository at this point in the history
[tests-only] Make deleteLdapUsersAndGroups backward-compatible for oC10 user_ldap testing
  • Loading branch information
phil-davis authored Mar 23, 2022
2 parents 80cca97 + 61e1b67 commit 8fc353d
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions tests/acceptance/features/bootstrap/Provisioning.php
Original file line number Diff line number Diff line change
Expand Up @@ -853,19 +853,25 @@ public function setLdapSetting(string $configId, string $configKey, string $conf
* @throws Exception
*/
public function deleteLdapUsersAndGroups():void {
// pdd
$isOcisOrReva = OcisHelper::isTestingOnOcisOrReva();
foreach ($this->ldapCreatedUsers as $user) {
$this->ldap->delete(
"uid=" . ldap_escape($user, "", LDAP_ESCAPE_DN) . ",ou=" . $this->ldapUsersOU . "," . $this->ldapBaseDN,
);
if ($isOcisOrReva) {
$this->ldap->delete(
"uid=" . ldap_escape($user, "", LDAP_ESCAPE_DN) . ",ou=" . $this->ldapUsersOU . "," . $this->ldapBaseDN,
);
}
$this->rememberThatUserIsNotExpectedToExist($user);
}
foreach ($this->ldapCreatedGroups as $group) {
$this->ldap->delete(
"cn=" . ldap_escape($group, "", LDAP_ESCAPE_DN) . ",ou=" . $this->ldapGroupsOU . "," . $this->ldapBaseDN,
);
if ($isOcisOrReva) {
$this->ldap->delete(
"cn=" . ldap_escape($group, "", LDAP_ESCAPE_DN) . ",ou=" . $this->ldapGroupsOU . "," . $this->ldapBaseDN,
);
}
$this->rememberThatGroupIsNotExpectedToExist($group);
}
if (!$this->skipImportLdif) {
if (!$isOcisOrReva || !$this->skipImportLdif) {
//delete ou from LDIF import
$this->ldap->delete(
"ou=" . $this->ldapUsersOU . "," . $this->ldapBaseDN,
Expand Down

0 comments on commit 8fc353d

Please sign in to comment.