travis: Add Botan build
authorTobias Brunner <tobias@strongswan.org>
Wed, 8 Aug 2018 09:35:46 +0000 (11:35 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 12 Sep 2018 14:25:00 +0000 (16:25 +0200)
We build Botan directly from the master branch until 2.8.0 is released.

.travis.yml
scripts/test.sh

index 8e36f4e..d220950 100644 (file)
@@ -38,6 +38,8 @@ env:
     - TEST=default
     - TEST=default MONOLITHIC=yes
     - TEST=default LEAK_DETECTIVE=yes
+    - TEST=botan
+    - TEST=botan LEAK_DETECTIVE=yes
     - TEST=openssl
     - TEST=openssl LEAK_DETECTIVE=yes
     - TEST=gcrypt
index 58dc730..a2ec74a 100755 (executable)
@@ -26,6 +26,32 @@ gcrypt)
        CONFIG="--disable-defaults --enable-pki --enable-gcrypt --enable-pkcs1"
        DEPS="libgcrypt11-dev"
        ;;
+botan)
+       CONFIG="--disable-defaults --enable-pki --enable-botan"
+       # we can't use the old package that comes with Ubuntu so we build from
+       # the current master until 2.8.0 is released and then probably switch to
+       # that unless we need newer features (at least 2.7.0 plus PKCS#1 patch is
+       # currently required)
+       DEPS=""
+       if test "$1" = "deps"; then
+               # if the leak detective is enabled we have to disable threading support
+               # (used for std::async) as that causes invalid frees somehow, the
+               # locking allocator causes a static leak via the first function that
+               # references it (e.g. crypter or hasher), so we disable that too
+               if test "$LEAK_DETECTIVE" = "yes"; then
+                       BOTAN_CONFIG="--without-os-features=threads
+                                                 --disable-modules=locking_allocator"
+               fi
+               # disable some larger modules we don't need for the tests
+               BOTAN_CONFIG="$BOTAN_CONFIG --disable-modules=pkcs11,tls,x509,xmss"
+               git clone --depth 1 https://github.com/randombit/botan.git botan &&
+               cd botan &&
+               python ./configure.py $BOTAN_CONFIG &&
+               make -j4 libs >/dev/null &&
+               sudo make install >/dev/null &&
+               sudo ldconfig || exit $?
+       fi
+       ;;
 printf-builtin)
        CONFIG="--with-printf-hooks=builtin"
        ;;
@@ -43,6 +69,8 @@ all|coverage|sonarcloud)
        CONFIG="$CONFIG --disable-nm"
        # not enabled on the build server
        CONFIG="$CONFIG --disable-af-alg"
+       # separate test case with external dependency
+       CONFIG="$CONFIG --disable-botan"
        if test "$TEST" != "coverage"; then
                CONFIG="$CONFIG --disable-coverage"
        else