directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1676060 - in /directory/apacheds/trunk/installers/src/test/docker: archive.test deb.test run-tests.sh
Date Sat, 25 Apr 2015 19:46:14 GMT
Author: seelmann
Date: Sat Apr 25 19:46:14 2015
New Revision: 1676060

URL: http://svn.apache.org/r1676060
Log:
Add tests for zip and tar.gz archive (DIRSERVER-2055, DIRSERVER-2065, DIRSERVER-2063)

Added:
    directory/apacheds/trunk/installers/src/test/docker/archive.test
Modified:
    directory/apacheds/trunk/installers/src/test/docker/deb.test
    directory/apacheds/trunk/installers/src/test/docker/run-tests.sh

Added: directory/apacheds/trunk/installers/src/test/docker/archive.test
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers/src/test/docker/archive.test?rev=1676060&view=auto
==============================================================================
--- directory/apacheds/trunk/installers/src/test/docker/archive.test (added)
+++ directory/apacheds/trunk/installers/src/test/docker/archive.test Sat Apr 25 19:46:14 2015
@@ -0,0 +1,102 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License. 
+
+# 
+# Script to test Debian installer within Docker container.
+#
+
+NAME="apacheds-${project.version}"
+DIRNAME="${NAME}"
+
+wait_for_apacheds_up() {
+    timeout 15  sh -c "while ! nc -z localhost 10389; do sleep 1; done"
+}
+wait_for_apacheds_down() {
+    timeout 15  sh -c "while nc -z localhost 10389; do sleep 1; done"
+}
+
+# stop execution if any command fails (i.e. exits with status code > 0)
+set -e
+
+# trace commands
+set -x
+
+# install
+cd /opt
+if [ -f /apacheds.tar.gz ]
+then
+    tar -xzvf /apacheds.tar.gz
+elif [ -f /apacheds.zip ]
+then
+    unzip /apacheds.zip
+    # exec permission in zip not set
+    chmod +x /opt/${DIRNAME}/bin/apacheds.sh
+else
+    exit 1
+fi
+
+# assert files and directories exist
+test -f /opt/${DIRNAME}/LICENSE
+test -f /opt/${DIRNAME}/NOTICE
+test -f /opt/${DIRNAME}/bin/apacheds.sh
+test -x /opt/${DIRNAME}/bin/apacheds.sh
+test -d /opt/${DIRNAME}/instances/default
+
+# assert not running
+/opt/${DIRNAME}/bin/apacheds.sh status | grep "ApacheDS is not running"
+
+# install required tools
+apt-get -qq update
+apt-get -qq -y install ldap-utils netcat
+
+# start
+/opt/${DIRNAME}/bin/apacheds.sh start
+wait_for_apacheds_up
+
+# assert running
+/opt/${DIRNAME}/bin/apacheds.sh status | grep "ApacheDS is running"
+
+# search
+ldapsearch -h localhost -p 10389 -x -D "uid=admin,ou=system" -w secret -s base -b "dc=example,dc=com"
+
+# restart and search a few times
+for i in 1 2 3
+do
+    /opt/${DIRNAME}/bin/apacheds.sh stop
+    wait_for_apacheds_down
+    /opt/${DIRNAME}/bin/apacheds.sh start
+    wait_for_apacheds_up
+    ldapsearch -h localhost -p 10389 -x -D "uid=admin,ou=system" -w secret -s base -b "dc=example,dc=com"
+done
+
+# stop
+/opt/${DIRNAME}/bin/apacheds.sh stop
+wait_for_apacheds_down
+
+# assert not running
+/opt/${DIRNAME}/bin/apacheds.sh status | grep "ApacheDS is not running"
+
+# assert password warning in log
+grep ".*WARN.*admin password.*security breach.*" /opt/${DIRNAME}/instances/default/log/apacheds.log
+# assert no error in log
+! grep ".*ERROR.*" /opt/${DIRNAME}/instances/default/log/apacheds.log
+
+# SUCCESS
+echo "SUCCESS"
+

Modified: directory/apacheds/trunk/installers/src/test/docker/deb.test
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers/src/test/docker/deb.test?rev=1676060&r1=1676059&r2=1676060&view=diff
==============================================================================
--- directory/apacheds/trunk/installers/src/test/docker/deb.test (original)
+++ directory/apacheds/trunk/installers/src/test/docker/deb.test Sat Apr 25 19:46:14 2015
@@ -92,7 +92,7 @@ tar -tf /var/lib/${DIRNAME}*.tgz >> /dev
 # assert files and directory no more exist
 test ! -e /opt/${DIRNAME}
 test ! -e /var/lib/${DIRNAME}/default
- 
+
 # SUCCESS
 echo "SUCCESS"
 

Modified: directory/apacheds/trunk/installers/src/test/docker/run-tests.sh
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers/src/test/docker/run-tests.sh?rev=1676060&r1=1676059&r2=1676060&view=diff
==============================================================================
--- directory/apacheds/trunk/installers/src/test/docker/run-tests.sh (original)
+++ directory/apacheds/trunk/installers/src/test/docker/run-tests.sh Sat Apr 25 19:46:14 2015
@@ -19,48 +19,87 @@
 
 set -e
 
-# Debian installer 64bit
+# Debian package 64bit
 DEB64="${project.build.directory}/installers/apacheds-${project.version}-amd64.deb"
 if [ -f ${DEB64} ]
 then
-    # Run deb installer with official Java image (Debian 8, OpenJDK 8, 64bit):
+    echo
+    echo
+    echo "Testing debian package with official Java image (Debian 8, OpenJDK 8, 64bit)"
     docker run -i --rm \
       -v ${DEB64}:/apacheds.deb \
       -v ${project.build.directory}/docker/deb.test:/deb.test \
       java:8 bash /deb.test
 
-    # Run deb installer with 'dockerfile' Java image (Ubuntu 14.04, Oracle Java 7, 64bit):
+    echo
+    echo
+    echo "Testing debian package with 'dockerfile' Java image (Ubuntu 14.04, Oracle Java
7, 64bit)"
     docker run -i --rm \
       -v ${DEB64}:/apacheds.deb \
       -v ${project.build.directory}/docker/deb.test:/deb.test \
       dockerfile/java:oracle-java7 bash /deb.test
 fi
 
-# Binary Installer 64bit
+
+# RPM package 64bit
+RPM64="${project.build.directory}/installers/apacheds-${project.version}-x86_64.rpm"
+if [ -f ${RPM64} ]
+then
+    echo
+    echo
+    echo "Testing RPM package with official Fedora image (Fedora 21, OpenJDK 8)"
+    docker run -i --rm \
+      -v ${RPM64}:/apacheds.rpm \
+      -v ${project.build.directory}/docker/rpm.test:/rpm.test \
+      fedora:21 bash /rpm.test
+
+    echo
+    echo
+    echo "Testing RPM package with official Centos image (CentOS 7, OpenJDK 8, 64bit)"
+    docker run -i --rm \
+      -v ${RPM64}:/apacheds.rpm \
+      -v ${project.build.directory}/docker/rpm.test:/rpm.test \
+      centos:7 bash /rpm.test
+fi
+
+
+# Binalry installer 64bit
 BIN64="${project.build.directory}/installers/apacheds-${project.version}-64bit.bin"
 if [ -f ${BIN64} ]
 then
-    # Run bin installer with official Java image (Debian 8, OpenJDK 8, 64bit):
+    echo
+    echo
+    echo "Testing bin installer with official Java image (Debian 8, OpenJDK 8, 64bit)"
     docker run -i --rm \
       -v ${BIN64}:/apacheds.bin \
       -v ${project.build.directory}/docker/bin.test:/bin.test \
       java:8 bash /bin.test
 fi
 
-# RPM installer 64bit
-RPM64="${project.build.directory}/installers/apacheds-${project.version}-x86_64.rpm"
-if [ -f ${RPM64} ]
-then
-    # Run rpm installer with official Fedora (Fedora 21, OpenJDK 8)
-    #docker run -i --rm \
-    #  -v ${RPM64}:/apacheds.rpm \
-    #  -v ${project.build.directory}/docker/rpm.test:/rpm.test \
-    #  fedora:latest bash /rpm.test
 
-    # Run rpm installer with official Centos (CentOS 7, OpenJDK 8)
-    docker run -i --rm \
-      -v ${RPM64}:/apacheds.rpm \
-      -v ${project.build.directory}/docker/rpm.test:/rpm.test \
-      centos:7 bash /rpm.test
+# tar.gz archive
+TGZ="${project.build.directory}/installers/apacheds-${project.version}.tar.gz"
+if [ -f ${TGZ} ]
+then
+    echo
+    echo
+    echo "Testing tar.gz archive with official Java image (Debian 8, OpenJDK 8, 64bit)"
+    docker run -it --rm \
+      -v ${TGZ}:/apacheds.tar.gz \
+      -v ${project.build.directory}/docker/archive.test:/archive.test \
+      java:8 bash /archive.test
 fi
 
+
+# zip archive
+ZIP="${project.build.directory}/installers/apacheds-${project.version}.zip"
+if [ -f ${ZIP} ]
+then
+    echo
+    echo
+    echo "Testing zip archive with 'dockerfile' Java image (Ubuntu 14.04, Oracle Java 7,
64bit)"
+    docker run -it --rm \
+      -v ${ZIP}:/apacheds.zip \
+      -v ${project.build.directory}/docker/archive.test:/archive.test \
+      dockerfile/java:oracle-java7 bash /archive.test
+fi



Mime
View raw message