Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only] Make LDAP based test config more flexible for being able to run with libregraph/idm default config #39893

Merged
merged 7 commits into from
Mar 22, 2022

Conversation

rhafer
Copy link
Contributor

@rhafer rhafer commented Mar 16, 2022

Description

This adds a couple of new LDAP related settings (via enviroment variables) in order to be able to run the LDAP based testsuite against the default libregraph-idm configuration as created by ocis (see: owncloud/ocis#3331). Those settings can also be useful when testing ocis against different LDAP setups.

Motivation and Context

To provide more flexibility when testing oCIS with and LDAP backend.

How Has This Been Tested?

  • manual run against oCIS

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

@rhafer rhafer requested a review from phil-davis March 16, 2022 14:54
@rhafer rhafer self-assigned this Mar 16, 2022
@CLAassistant
Copy link

CLAassistant commented Mar 16, 2022

CLA assistant check
All committers have signed the CLA.

@phil-davis
Copy link
Contributor

@rhafer GitHub claims that you have not signed the CLA yet? Please click the button...

Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - only 1 suggestion.

tests/TestHelpers/OcisHelper.php Outdated Show resolved Hide resolved
@phil-davis
Copy link
Contributor

https://drone.owncloud.com/owncloud/core/34961/3/6
code-style found a couple of very minor spacing issues that need fixing.

@rhafer rhafer force-pushed the ldapsettings branch 2 times, most recently from 37b0dab to 60a6e0f Compare March 18, 2022 08:57
@ownclouders
Copy link
Contributor

ownclouders commented Mar 18, 2022

💥 Acceptance tests pipeline webUICreateDelete-chrome-mariadb10.2-php7.4 failed. The build has been cancelled.

https://drone.owncloud.com/owncloud/core/34974/130

@phil-davis
Copy link
Contributor

@rhafer feel free to merge if this is ready from your PoV.

@rhafer
Copy link
Contributor Author

rhafer commented Mar 21, 2022

@phil-davis Thanks. Will do. I still need to re-run this once more against reva, to make sure it doesn't break anything there.

@rhafer rhafer force-pushed the ldapsettings branch 3 times, most recently from d64194a to 238b45a Compare March 22, 2022 07:42
The "ou" values for Test Users and Groups and the baseDN are defined via
config. Remove the hardcoded references to "dc=owncloud,dc=com" and
"ou=TestUsers/Groups" from the code.
This introduces two new env setttings: REVA_LDAP_USESSL and REVA_LDAP_BIND_PASSWORD.
Set REVA_LDAP_USESSL to true to be able to force the usage of LDAPS even
when not running on the standard port (636).
REVA_LDAP_BIND_PASSWORD can be used to override the LDAP bind password.
The purpose of this change is to be able to test against exiting LDAP servers and
the embeded libregraph-idm that is deployed be the default configuration in ocis.
This is merely a cosmetic change and the attribute is already used as the
naming attribute in the users's DN (thus set implicitly). This is just making things
explicit and visible.
In order to be a bit more flexible when testing against libregraph-idm
introduce the new variable REVA_LDAP_SKIP_LDIF_IMPORT to allow to skip
the import of the base LDIF file that creates the ou objects for users
and groups (these objects are already present in such a setup).

This also means that when removing users and groups after each test we
cannot rely on recursivly removing the ou object about explicitly delete
every user/group.
The objectclasses "person", "organizationalPerson" and "top" are valid
for all setups (alternatively they could be left out as they are
implicitly added via inheritance)

When testing against oCIS alway add the "owncloud" objectclass and the
"owncloudUUID" attribute independent of the parallel deployment setting.
This allows to switch between different types of LDAP Groups. The
default behaviour (REVA_LDAP_GROUP_SCHEMA="rfc2307") is to use the
"posixGroup" objectclass with "memberUID" attribute. Any other value for
REVA_LDAP_GROUP_SCHEMA will switch the behaviour to objectclass
"groupOfNames" and the "member" Attribute.
@sonarcloud
Copy link

sonarcloud bot commented Mar 22, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

50.0% 50.0% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants