Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #547 from esl/change-ldap-domain-in-tests
use esl.com instead of ejd.com in LDAP tests
- Loading branch information
Showing
5 changed files
with
48 additions
and
42 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 |
---|---|---|
@@ -1,34 +1,38 @@ | ||
#!/bin/sh | ||
|
||
LDAP_P=`cat /tmp/travis_db_password` | ||
|
||
LDAP_ROOT="cn=Manager,dc=ejd,dc=com" | ||
|
||
cat > manager.ldif << EOL | ||
dn: olcDatabase={1}hdb,cn=config | ||
changetype: modify | ||
replace: olcSuffix | ||
olcSuffix: dc=ejd,dc=com | ||
- | ||
replace: olcRootDN | ||
olcRootDN: ${LDAP_ROOT} | ||
- | ||
replace: olcRootPW | ||
olcRootPW: ${LDAP_P} | ||
EOL | ||
LDAP_ROOTPASS=`cat /tmp/travis_db_password` | ||
|
||
sudo ldapmodify -Y EXTERNAL -H ldapi:/// -f manager.ldif | ||
LDAP_ROOT="cn=admin,dc=esl,dc=com" | ||
LDAP_DOMAIN="esl.com" | ||
LDAP_ORGANISATION="Erlang Solutions" | ||
|
||
cat > init_entries.ldif << EOL | ||
dn: dc=ejd,dc=com | ||
dc: ejd | ||
objectClass: dcObject | ||
objectClass: organizationalUnit | ||
ou: ejd | ||
echo "configuring slapd" | ||
|
||
cat <<EOF | debconf-set-selections | ||
slapd slapd/internal/generated_adminpw password ${LDAP_ROOTPASS} | ||
slapd slapd/internal/adminpw password ${LDAP_ROOTPASS} | ||
slapd slapd/password2 password ${LDAP_ROOTPASS} | ||
slapd slapd/password1 password ${LDAP_ROOTPASS} | ||
slapd slapd/dump_database_destdir string /var/backups/slapd-VERSION | ||
slapd slapd/domain string ${LDAP_DOMAIN} | ||
slapd shared/organization string ${LDAP_ORGANISATION} | ||
slapd slapd/backend string HDB | ||
slapd slapd/purge_database boolean true | ||
slapd slapd/move_old_database boolean true | ||
slapd slapd/allow_ldap_v2 boolean false | ||
slapd slapd/no_configuration boolean false | ||
slapd slapd/dump_database select when needed | ||
EOF | ||
|
||
dn: ou=Users,dc=ejd,dc=com | ||
dpkg-reconfigure -f noninteractive slapd | ||
|
||
service slapd restart | ||
|
||
|
||
cat > init_entries.ldif << EOL | ||
dn: ou=Users,dc=esl,dc=com | ||
objectClass: organizationalUnit | ||
ou: users | ||
EOL | ||
|
||
ldapadd -x -D${LDAP_ROOT} -f init_entries.ldif -w ${LDAP_P} | ||
ldapadd -x -D${LDAP_ROOT} -f init_entries.ldif -w ${LDAP_ROOTPASS} |