Skip to content

LDAP Testing #39

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

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Next Next commit
make changes to travis settings for ldap testing
  • Loading branch information
Arcath committed Aug 30, 2013
commit e0f17dde356367050f6197cf48fa6d69cf84f536
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ rvm:
env:
- "rake=0.9"
script: "bundle exec rspec -t no_ad"
before_script: "mkdir log"
before_install:
- travis/before_install.sh
before_script:
- travis/before_script.sh
notifications:
email: false
matrix:
Expand Down
5 changes: 5 additions & 0 deletions travis/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

set -e

sudo apt-get install -y ldap-utils slapd
31 changes: 31 additions & 0 deletions travis/before_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

mkdir log

password = "secret"
crypted_password = `slappasswd -s $password`
cat <<EOF | sudo ldapmodify -Y EXTERNAL -H ldapi:///
version: 1
dn: olcDatabase={1}hdb,cn=config
changetype: modify
replace: olcRootPW
olcRootPW: ${crypted_password}
-
EOF

sudo ldapmodify -Y EXTERNAL -H ldapi:/// -f travis/ldif/phonetic-attribute-options.ldif

base="dc=`echo get slapd/domain | sudo debconf-communicate slapd | sed -e 's/^0 //' | sed -e 's/^\.//; s/\./,dc=/g'`"

cat <<EOF > spec/test_data.yml
domain:
domain: ed-itsolutions.com
port: 389
base: ${base}
server: 127.0.0.1
query_user: admin
query_password: ${password}
breakable_user: foo
breakable_password: bar
testable_ou: Foo
EOF
5 changes: 5 additions & 0 deletions travis/ldif/phonetic-attribute-options.ldif
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: 1
dn: cn=config
changetype: modify
add: olcAttributeOptions
olcAttributeOptions: phonetic lang-