diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..d1a9966 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,18 @@ +before_install: + - sudo apt-get update -qq + - sudo apt-get install ldap-utils + - sudo apt-get install python-ldap + - sudo DEBIAN_FRONTEND=noninteractive apt-get install slapd -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -f -q -y + - sudo ./tests/cfg/deploy.sh + +language: python +python: + - "2.7" + - "3.2" + - "3.3" +# command to install dependencies +install: + - pip install -e . --use-mirrors + - pip install passlib +# command to run tests +script: "./run_test.sh" diff --git a/run_test.sh b/run_test.sh new file mode 100755 index 0000000..1695360 --- /dev/null +++ b/run_test.sh @@ -0,0 +1,3 @@ +#!/bin/sh +cd `dirname $0` +python setup.py test diff --git a/tests/cfg/deploy.sh b/tests/cfg/deploy.sh index 2cf8c13..ee35d28 100755 --- a/tests/cfg/deploy.sh +++ b/tests/cfg/deploy.sh @@ -1,11 +1,11 @@ #!/bin/sh -sudo rsync -a `dirname $0`/ / +rsync -a `dirname $0`/ / cd `dirname $0`/../../ sudo sed -i "s%template_dir.*%template_dir = '`pwd`/resources/templates/'%" /etc/ldapcherry/ldapcherry.ini sudo sed -i "s%tools.staticdir.dir.*%tools.staticdir.dir = '`pwd`/resources/static/'%" /etc/ldapcherry/ldapcherry.ini -sudo chown -R openldap:openldap /etc/ldap/ -sudo /etc/init.d/slapd restart +chown -R openldap:openldap /etc/ldap/ +/etc/init.d/slapd restart ldapadd -H ldap://localhost -x -D "cn=admin,dc=example,dc=org" -f /etc/ldap/content.ldif -w password sed -i "s/\(127.0.0.1.*\)/\1 ldap.ldapcherry.org/" /etc/hosts