From c00342523ea63b67679f843c299595d3e62444fb Mon Sep 17 00:00:00 2001 From: Bertrand Gouny Date: Fri, 9 May 2014 15:25:39 +0200 Subject: [PATCH 1/2] [twgit] Init hotfix 'hotfix-0.6.1'. From a413a31ed3880db21c15eede3838fd5761b19ced Mon Sep 17 00:00:00 2001 From: Bertrand Gouny Date: Fri, 9 May 2014 15:57:03 +0200 Subject: [PATCH 2/2] nouvelle baseimage + maj tests --- Dockerfile | 4 ++-- test/db.sh | 3 ++- test/simple.sh | 3 ++- test/tls.sh | 3 ++- test/tools/run-simple.sh | 13 +++++++++++-- test/tools/run-tls.sh | 2 +- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 734416c..187538d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,8 +15,8 @@ ENV LDAP_DOMAIN example.com # Disable SSH RUN rm -rf /etc/service/sshd /etc/my_init.d/00_regen_ssh_host_keys.sh -# DIsable nginx and php -RUN rm -rf /etc/service/nginx /etc/service/php5-fpm +# Enable dnsmasq +RUN /etc/enable-service dnsmasq # Use baseimage-docker's init system. CMD ["/sbin/my_init"] diff --git a/test/db.sh b/test/db.sh index a650fbd..bc0297c 100755 --- a/test/db.sh +++ b/test/db.sh @@ -17,7 +17,8 @@ $dir/tools/delete-container.sh runOptions="-v $openldapTestDir/db:/var/lib/ldap -v $openldapTestDir/config:/etc/ldap/slapd.d" . $dir/tools/run-simple.sh -ldapsearch -x -h localhost -p 65389 -b dc=otherdomain,dc=com +echo "ldapsearch -x -h $IP -b dc=otherdomain,dc=com" +ldapsearch -x -h $IP -b dc=otherdomain,dc=com rm -r $openldapTestDir $dir/tools/delete-container.sh diff --git a/test/simple.sh b/test/simple.sh index 9832191..9c63f13 100755 --- a/test/simple.sh +++ b/test/simple.sh @@ -4,6 +4,7 @@ dir=$(dirname $0) . $dir/tools/config.prop . $dir/tools/run-simple.sh -ldapsearch -x -h localhost -p 65389 -b dc=example,dc=com +echo "ldapsearch -x -h $IP -b dc=example,dc=com" +ldapsearch -x -h $IP -b dc=example,dc=com $dir/tools/delete-container.sh diff --git a/test/tls.sh b/test/tls.sh index ea1758e..ccdcd6e 100755 --- a/test/tls.sh +++ b/test/tls.sh @@ -4,6 +4,7 @@ dir=$(dirname $0) . $dir/tools/config.prop . $dir/tools/run-tls.sh -ldapsearch -x -h $certCN -p 65389 -b dc=example,dc=com -ZZ +echo "ldapsearch -x -h $certCN -b dc=example,dc=com -ZZ" +ldapsearch -x -h $certCN -b dc=example,dc=com -ZZ . $dir/tools/end-tls.sh diff --git a/test/tools/run-simple.sh b/test/tools/run-simple.sh index d090b21..71676be 100755 --- a/test/tools/run-simple.sh +++ b/test/tools/run-simple.sh @@ -1,5 +1,14 @@ #!/bin/sh -echo "docker.io run --name $openldapTestContainer $runOptions -p 65389:389 -d $openldapTestImage" -docker.io run --name $openldapTestContainer $runOptions -p 65389:389 -d $openldapTestImage +echo "docker.io run --name $openldapTestContainer $runOptions -d $openldapTestImage" +ID=`docker.io run --name $openldapTestContainer $runOptions -d $openldapTestImage` sleep 5 + +echo " --> Obtaining IP" +IP=`docker inspect $ID | grep IPAddress | sed -e 's/.*: "//; s/".*//'` +if [ "$IP" = "" ]; then + abort "Unable to obtain container IP" + exit 1 +else + echo " -->" $IP +fi diff --git a/test/tools/run-tls.sh b/test/tools/run-tls.sh index 9f6ce74..b051d93 100755 --- a/test/tools/run-tls.sh +++ b/test/tools/run-tls.sh @@ -6,7 +6,7 @@ runOptions="--dns=127.0.0.1 -v `pwd`/test/ssl:/etc/ldap/ssl" cert=$(echo $dir/ssl/ldap.crt) certCN=$(openssl x509 -in $cert -subject -noout | sed -n 's/.*CN=\(.*\)\/*\(.*\)/\1/p') -addLine=$(echo "127.0.0.1" $certCN) +addLine=$(echo $IP $certCN) echo $addLine >> /etc/hosts cp /etc/ldap/ldap.conf /etc/ldap/ldap.conf.old