Skip to content

Commit a3a04fa

Browse files
committed
Python 3 support for the testsuite
1 parent b5eca06 commit a3a04fa

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

Dockerfile.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM python:2-alpine
1+
ARG PYTHON_VERSION=2
2+
FROM python:${PYTHON_VERSION}-alpine
23

34
WORKDIR /usr/src/app/
45
COPY nginx-ldap-auth-daemon.py /usr/src/app/

t/README

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
To run tests use supplied Dockerfile.test:
22

3-
docker build -f Dockerfile.test -t my-tag .
3+
docker build -f Dockerfile.test -t my-tag
4+
5+
If you desire to use a container with Python3, you can supply an appropriate
6+
build argument:
7+
8+
docker build -f Dockerfile.test -t my-tag --build-arg PYTHON_VERSION=3 .
49
docker run my-tag
510

611
To run without Docker:

t/ldap-auth.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ system("ldapadd -H ldap://127.0.0.1:$p5 -x -D \"cn=root,ou=Users,dc=test,dc=loca
433433
$t->write_file_expand("auth_daemon.sh", <<"EOF");
434434
AUTHBIN=\$(realpath $AUTHD)
435435
cd $d
436-
exec coverage2 run \$AUTHBIN --host 127.0.0.1 \\
436+
exec coverage run \$AUTHBIN --host 127.0.0.1 \\
437437
-p %%PORT_8888%% >$d/nginx-ldap-auth-dameon.stdlog 2>&1
438438
EOF
439439

t/runtests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ perl ldap-auth.t
1010

1111
testdir=$(find /tmp -name 'nginx-test-*' -print -quit)
1212
cd $testdir
13-
coverage2 html && printf "Coverage report: docker cp <cid>:$testdir/htmlcov <hostdir>\n"
13+
coverage html && printf "Coverage report: docker cp <cid>:$testdir/htmlcov <hostdir>\n"

0 commit comments

Comments
 (0)