-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It is now possible to run testsuite in docker, using supplied file. See instructions in t/README. Tests are adjusted to run on alpine linux which includes modular builds of openldap server software.
- Loading branch information
Showing
4 changed files
with
71 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
FROM python:2-alpine | ||
|
||
WORKDIR /usr/src/app/ | ||
COPY nginx-ldap-auth-daemon.py /usr/src/app/ | ||
|
||
WORKDIR /tests | ||
COPY t/ldap-auth.t /tests | ||
COPY t/runtests.sh /tests | ||
|
||
# Install required software | ||
RUN \ | ||
apk --no-cache add openldap-dev && \ | ||
apk --no-cache add openldap && \ | ||
apk --no-cache add openldap-back-hdb && \ | ||
apk --no-cache add openldap-clients && \ | ||
apk --no-cache add openssl && \ | ||
apk --no-cache add nginx && \ | ||
apk --no-cache add nginx-mod-http-geoip && \ | ||
apk --no-cache add nginx-mod-stream-geoip && \ | ||
apk --no-cache add nginx-mod-http-image-filter && \ | ||
apk --no-cache add nginx-mod-stream && \ | ||
apk --no-cache add nginx-mod-mail && \ | ||
apk --no-cache add nginx-mod-http-perl && \ | ||
apk --no-cache add nginx-mod-http-xslt-filter && \ | ||
apk --no-cache add mercurial && \ | ||
apk --no-cache add perl && \ | ||
apk --no-cache add --virtual build-dependencies build-base && \ | ||
pip install python-ldap && \ | ||
pip install coverage && \ | ||
apk del build-dependencies | ||
|
||
|
||
# Install tests | ||
RUN \ | ||
cd /tests && \ | ||
hg clone https://hg.nginx.org/nginx-tests && \ | ||
mv ldap-auth.t nginx-tests | ||
|
||
WORKDIR /usr/src/app/ | ||
|
||
ENV TEST_LDAP_DAEMON=/usr/sbin/slapd | ||
ENV TEST_LDAP_AUTH_DAEMON=/usr/src/app/nginx-ldap-auth-daemon.py | ||
ENV TEST_NGINX_BINARY=/usr/sbin/nginx | ||
ENV TEST_NGINX_MODULES=/usr/lib/nginx/modules | ||
ENV LDAPTLS_REQCERT=never | ||
|
||
WORKDIR /tests/nginx-tests | ||
|
||
CMD ["/tests/runtests.sh"] |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
# shell script to start testsuite and run coverage | ||
# to be executed as Dockerfile CMD | ||
|
||
export TEST_NGINX_LEAVE=1 | ||
rm -rf /tmp/nginx-test-* | ||
|
||
perl ldap-auth.t | ||
|
||
testdir=$(find /tmp -name 'nginx-test-*' -print -quit) | ||
cd $testdir | ||
coverage2 html && printf "Coverage report: docker cp <cid>:$testdir/htmlcov <hostdir>\n" |