]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Add Travis job which runs slapd in a container to allow testing
authorJoe Orton <jorton@apache.org>
Tue, 9 Jun 2020 14:50:53 +0000 (14:50 +0000)
committerJoe Orton <jorton@apache.org>
Tue, 9 Jun 2020 14:50:53 +0000 (14:50 +0000)
mod_authnz_ldap, per new test case added in r1878655.

* test/travis_Dockerfile_slapd: New dockerfile for running slapd.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1878663 13f79535-47bb-0310-9956-ffa450edef68

.travis.yml
test/README.travis
test/travis_Dockerfile_slapd [new file with mode: 0644]
test/travis_before_linux.sh
test/travis_run_linux.sh

index 0dd11aa66eb8cbfbfd79e83a6239e2410b78b92c..156db958a726e8e36a105d1c0aaf1fb186c648a6 100644 (file)
@@ -27,6 +27,7 @@ addons:
       - libjansson-dev
       - libpcre2-dev
       - libldap2-dev
+      - ldap-utils
 env:
   global:
     - MFLAGS=-j2
@@ -217,9 +218,16 @@ jobs:
            CONFIG="--enable-mods-shared=reallyall"
            TEST_MALLOC=1
     # -------------------------------------------------------------------------
+    - name: Linux Ubuntu, APR 1.7.0, APR-util 1.6.1, pool-debug, LDAP
+      env: APR_VERSION=1.7.0 APR_CONFIG="--enable-pool-debug"
+           APU_VERSION=1.6.1 APU_CONFIG="--with-crypto --with-ldap"
+           CONFIG="--enable-mods-shared=reallyall"
+           TEST_MALLOC=1 TEST_LDAP=1 TEST_ARGS="-defines LDAP"
+           TESTS="t/modules/"
+    # -------------------------------------------------------------------------
     - name: Linux Ubuntu, litmus WebDAV tests
       env: CONFIG="--enable-dav --enable-dav-fs"
-           LITMUS=1 TEST_ARGS="t/modules/dav.t"
+           LITMUS=1 TESTS="t/modules/dav.t"
       addons:
         apt:
           update: false
index 0fb6c723f296d508cb86fe6474a5f9750d647b84..d174cccd086e8dff0f42e8213bd2d7c67b6c3702 100644 (file)
@@ -34,6 +34,12 @@ The Travis scripts use the following environment variables:
 
 * TEST_INSTALL - set for builds testing "make install"
 
+* TEST_LDAP - set for builds with slapd running
+
+* TESTS - a list of Perl framework tests to run
+
+* TEST_ARGS - arguments to pass to ./t/TEST in the Perl test framework
+
 Caching
 -------
 
diff --git a/test/travis_Dockerfile_slapd b/test/travis_Dockerfile_slapd
new file mode 100644 (file)
index 0000000..8da818e
--- /dev/null
@@ -0,0 +1,9 @@
+FROM ubuntu:bionic
+RUN echo slapd slapd/password1 password travis | debconf-set-selections
+RUN echo slapd slapd/password2 password travis | debconf-set-selections
+RUN echo slapd slapd/internal/adminpw password travis | debconf-set-selections
+RUN echo slapd slapd/internal/generated_adminpw password travis | debconf-set-selections
+RUN echo slapd slapd/domain string example.com | debconf-set-selections
+RUN apt-get update && apt-get -y install slapd
+# With -d passed, slapd stays in the foreground
+CMD /usr/sbin/slapd -d1
index 41c500f32d48af9b41ab9660601f264e0f69c42c..4c8c991c6809ea2fe42f50dc986643ddd62112c0 100755 (executable)
@@ -81,6 +81,16 @@ if ! test -v SKIP_TESTING; then
     git clone --depth=1 https://github.com/apache/httpd-tests.git test/perl-framework
 fi
 
+# For LDAP testing, run slapd listening on port 8389 and populate the
+# directory as described in t/modules/ldap.t in the test framework:
+LDIF=test/perl-framework/scripts/httpd.ldif
+if test -v TEST_LDAP -a -r $LDIF ; then
+    docker build -t httpd_slapd -f test/travis_Dockerfile_slapd test/
+    docker run -d -p 8389:389 httpd_slapd | tee .slapd.cid
+    sleep 5
+    ldapadd -H ldap://localhost:8389 -D cn=admin,dc=example,dc=com -w travis < $LDIF
+fi
+
 if test -v APR_VERSION; then
     install_apx apr ${APR_VERSION} "${APR_CONFIG}"
     APU_CONFIG="$APU_CONFIG --with-apr=$HOME/root/apr-${APR_VERSION}"
index 83f9869cf15a7cbeac06b49433d9345db9581c25..818e39a504caa7083cac30a2829b486e506ea862 100755 (executable)
@@ -52,13 +52,13 @@ if ! test -v SKIP_TESTING; then
     fi
 
     if test -v WITH_TEST_SUITE; then
-        make check TESTS="${TEST_ARGS}"
+        make check TESTS="${TESTS}" TEST_CONFIG="${TEST_ARGS}"
         RV=$?
     else
         test -v TEST_INSTALL || make install
         pushd test/perl-framework
             perl Makefile.PL -apxs $PREFIX/bin/apxs
-            make test APACHE_TEST_EXTRA_ARGS="${TEST_ARGS}"
+            make test APACHE_TEST_EXTRA_ARGS="${TEST_ARGS} ${TESTS}"
             RV=$?
         popd
     fi
@@ -66,6 +66,8 @@ if ! test -v SKIP_TESTING; then
         pushd test/perl-framework
            mkdir -p t/htdocs/modules/dav
            ./t/TEST -start
+           # litmus uses $TESTS, so unset it.
+           unset TESTS
            litmus http://localhost:8529/modules/dav/
            RV=$?
            ./t/TEST -stop