1
0
Эх сурвалжийг харах

Merge branch 'hotfix-0.6.1' into stable

Bertrand Gouny 11 жил өмнө
parent
commit
676d3d736d

+ 2 - 2
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"]

+ 2 - 1
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

+ 2 - 1
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

+ 2 - 1
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

+ 11 - 2
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

+ 1 - 1
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