-
Notifications
You must be signed in to change notification settings - Fork 252
[CI] Add OpenLDAP integration tests #129
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
eda12bb
Add integration test with OpenLDAP to Travis matrix
mtodd 9ee2730
Add INTEGRATION flag constant
mtodd 0abd796
Add OpenLDAP installer, seed/config fixtures
mtodd 879fd51
Add basic integration tests for bind
mtodd 415dd9d
Fix test class name
mtodd 1ebd71a
No email notifications for CI builds
mtodd 66dc72f
Show operation result for failed binds
mtodd 05133c1
Inspect the operation result struct for details
mtodd a1978eb
Bind with full DN
mtodd cb5f0ef
Expect anonymous auth to fail
mtodd 6b6edac
Merge branch 'master' into ci-openldap
mtodd 26ebfff
Override Test::Unit::TestCase#run for disabled integration tests
mtodd 54dcd12
Move bind integration test under test/integration/
mtodd 03e0ec6
Relative path has changed
mtodd a589c8b
Add basic search integration tests
mtodd 50b651b
Testing return_result: false
mtodd 180e615
Allow integration host override
mtodd 15a99a7
Add Vagrant VM for local integration testing
mtodd 85ec2d2
No need to run CI without integration tests
mtodd 77862a2
Link to Vagrant, clarify installing vagrant binary
mtodd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env sh | ||
set -e | ||
set -x | ||
|
||
BASE_PATH="$( cd `dirname $0`/../test/fixtures/openldap && pwd )" | ||
SEED_PATH="$( cd `dirname $0`/../test/fixtures && pwd )" | ||
|
||
DEBIAN_FRONTEND=noninteractive sudo -E apt-get install -y --force-yes slapd time ldap-utils | ||
|
||
sudo /etc/init.d/slapd stop | ||
|
||
TMPDIR=$(mktemp -d) | ||
cd $TMPDIR | ||
|
||
# Delete data and reconfigure. | ||
sudo cp -v /var/lib/ldap/DB_CONFIG ./DB_CONFIG | ||
sudo rm -rf /etc/ldap/slapd.d/* | ||
sudo rm -rf /var/lib/ldap/* | ||
sudo cp -v ./DB_CONFIG /var/lib/ldap/DB_CONFIG | ||
sudo slapadd -F /etc/ldap/slapd.d -b "cn=config" -l $BASE_PATH/slapd.conf.ldif | ||
# Load memberof and ref-int overlays and configure them. | ||
sudo slapadd -F /etc/ldap/slapd.d -b "cn=config" -l $BASE_PATH/memberof.ldif | ||
|
||
# Add base domain. | ||
sudo slapadd -F /etc/ldap/slapd.d <<EOM | ||
dn: dc=rubyldap,dc=com | ||
objectClass: top | ||
objectClass: domain | ||
dc: rubyldap | ||
EOM | ||
|
||
sudo chown -R openldap.openldap /etc/ldap/slapd.d | ||
sudo chown -R openldap.openldap /var/lib/ldap | ||
|
||
sudo /etc/init.d/slapd start | ||
|
||
# Import seed data. | ||
# NOTE: use ldapadd in order for memberOf and refint to apply, instead of: | ||
# cat $SEED_PATH/seed.ldif | sudo slapadd -F /etc/ldap/slapd.d | ||
/usr/bin/time sudo ldapadd -x -D "cn=admin,dc=rubyldap,dc=com" -w passworD1 \ | ||
-h localhost -p 389 \ | ||
-f $SEED_PATH/seed.ldif | ||
|
||
sudo rm -rf $TMPDIR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
dn: cn=module,cn=config | ||
cn: module | ||
objectClass: olcModuleList | ||
objectClass: top | ||
olcModulePath: /usr/lib/ldap | ||
olcModuleLoad: memberof.la | ||
|
||
dn: olcOverlay={0}memberof,olcDatabase={1}hdb,cn=config | ||
objectClass: olcConfig | ||
objectClass: olcMemberOf | ||
objectClass: olcOverlayConfig | ||
objectClass: top | ||
olcOverlay: memberof | ||
olcMemberOfDangling: ignore | ||
olcMemberOfRefInt: TRUE | ||
olcMemberOfGroupOC: groupOfNames | ||
olcMemberOfMemberAD: member | ||
olcMemberOfMemberOfAD: memberOf | ||
|
||
dn: cn=module,cn=config | ||
cn: module | ||
objectclass: olcModuleList | ||
objectclass: top | ||
olcmoduleload: refint.la | ||
olcmodulepath: /usr/lib/ldap | ||
|
||
dn: olcOverlay={1}refint,olcDatabase={1}hdb,cn=config | ||
objectClass: olcConfig | ||
objectClass: olcOverlayConfig | ||
objectClass: olcRefintConfig | ||
objectClass: top | ||
olcOverlay: {1}refint | ||
olcRefintAttribute: memberof member manager owner |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
dn: cn=config | ||
objectClass: olcGlobal | ||
cn: config | ||
olcPidFile: /var/run/slapd/slapd.pid | ||
olcArgsFile: /var/run/slapd/slapd.args | ||
olcLogLevel: none | ||
olcToolThreads: 1 | ||
|
||
dn: olcDatabase={-1}frontend,cn=config | ||
objectClass: olcDatabaseConfig | ||
objectClass: olcFrontendConfig | ||
olcDatabase: {-1}frontend | ||
olcSizeLimit: 500 | ||
olcAccess: {0}to * by dn.exact=gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth manage by * break | ||
olcAccess: {1}to dn.exact="" by * read | ||
olcAccess: {2}to dn.base="cn=Subschema" by * read | ||
|
||
dn: olcDatabase=config,cn=config | ||
objectClass: olcDatabaseConfig | ||
olcDatabase: config | ||
olcAccess: to * by dn.exact=gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth manage by * break | ||
|
||
dn: cn=schema,cn=config | ||
objectClass: olcSchemaConfig | ||
cn: schema | ||
|
||
include: file:///etc/ldap/schema/core.ldif | ||
include: file:///etc/ldap/schema/cosine.ldif | ||
include: file:///etc/ldap/schema/nis.ldif | ||
include: file:///etc/ldap/schema/inetorgperson.ldif | ||
|
||
dn: cn=module{0},cn=config | ||
objectClass: olcModuleList | ||
cn: module{0} | ||
olcModulePath: /usr/lib/ldap | ||
olcModuleLoad: back_hdb | ||
|
||
dn: olcBackend=hdb,cn=config | ||
objectClass: olcBackendConfig | ||
olcBackend: hdb | ||
|
||
dn: olcDatabase=hdb,cn=config | ||
objectClass: olcDatabaseConfig | ||
objectClass: olcHdbConfig | ||
olcDatabase: hdb | ||
olcDbCheckpoint: 512 30 | ||
olcDbConfig: set_cachesize 1 0 0 | ||
olcDbConfig: set_lk_max_objects 1500 | ||
olcDbConfig: set_lk_max_locks 1500 | ||
olcDbConfig: set_lk_max_lockers 1500 | ||
olcLastMod: TRUE | ||
olcSuffix: dc=rubyldap,dc=com | ||
olcDbDirectory: /var/lib/ldap | ||
olcRootDN: cn=admin,dc=rubyldap,dc=com | ||
# admin's password: "passworD1" | ||
olcRootPW: {SHA}LFSkM9eegU6j3PeGG7UuHrT/KZM= | ||
olcDbIndex: objectClass eq | ||
olcAccess: to attrs=userPassword,shadowLastChange | ||
by self write | ||
by anonymous auth | ||
by dn="cn=admin,dc=rubyldap,dc=com" write | ||
by * none | ||
olcAccess: to dn.base="" by * read | ||
olcAccess: to * | ||
by self write | ||
by dn="cn=admin,dc=rubyldap,dc=com" write | ||
by * read |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jch are you thinking we should 🔥 the
skip
option here and just always run with integration?Obviously the plan here is to add
activedirectory
as an option at some point, once we work out how to do that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In travis, yes, I think we should always run with integration tests. We can keep other tests running fast so contributors can get a quick sanity check before they make a PR, but then let Travis do the heavy lifting with different rubies and ldap servers.