aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-09-14 13:21:26 -0400
committerJack Lloyd <[email protected]>2016-10-24 21:07:01 -0400
commitd78a540dd0145665805e9804d8f20a71c39b0bf8 (patch)
tree4536cf911e8744a61756312a62f9ad51cb4041f1 /src/scripts
parent36e0ea1e407027ac48e82b56016a6813ff6a1082 (diff)
Add TPM and PKCS #11 to coverage build
SoftHSMv1 included in 14.04 is too old and many tests fail, so grabs prebuilt SoftHSMv2 binaries from www.randombit.net. This can change to use the packaged SoftHSM in 16.04, whenever Travis makes that available.
Diffstat (limited to 'src/scripts')
-rwxr-xr-xsrc/scripts/ci/travis/build.sh10
-rwxr-xr-xsrc/scripts/ci/travis/install.sh11
2 files changed, 18 insertions, 3 deletions
diff --git a/src/scripts/ci/travis/build.sh b/src/scripts/ci/travis/build.sh
index 3b34f7320..da5734932 100755
--- a/src/scripts/ci/travis/build.sh
+++ b/src/scripts/ci/travis/build.sh
@@ -5,6 +5,7 @@ which shellcheck > /dev/null && shellcheck "$0" # Run shellcheck on this if avai
MAKE_PREFIX=""
TEST_PREFIX=""
TEST_EXE=./botan-test
+TEST_FLAGS=""
CFG_FLAGS=(--prefix=/tmp/botan-installation --cc=$CC --os=$TRAVIS_OS_NAME)
# PKCS11 is optional but doesn't pull in new dependencies
@@ -51,6 +52,11 @@ elif [ "${BUILD_MODE:0:5}" != "cross" ]; then
# Only use external libraries when compiling natively
CFG_FLAGS+=(--with-bzip2 --with-lzma --with-sqlite --with-zlib)
+ if [ "$BUILD_MODE" = "coverage" ]; then
+ CFG_FLAGS+=(--with-tpm)
+ TEST_FLAGS="--pkcs11-lib=/tmp/softhsm/lib/softhsm/libsofthsm2.so"
+ fi
+
# Avoid OpenSSL when using dynamic checkers...
if [ "$BUILD_MODE" != "sanitizer" ] && [ "$BUILD_MODE" != "valgrind" ]; then
CFG_FLAGS+=(--with-openssl)
@@ -161,8 +167,8 @@ if [ "$BUILD_MODE" = "sonarqube" ] || [ "$BUILD_MODE" = "docs" ] || \
( [ "${BUILD_MODE:0:5}" = "cross" ] && [ "$TRAVIS_OS_NAME" = "osx" ] ); then
echo "Running tests disabled on this build type"
else
- echo Running $TEST_PREFIX $TEST_EXE
- time $TEST_PREFIX $TEST_EXE
+ echo Running $TEST_PREFIX $TEST_EXE $TEST_FLAGS
+ time $TEST_PREFIX $TEST_EXE $TEST_FLAGS
fi
# Run Python tests (need shared libs)
diff --git a/src/scripts/ci/travis/install.sh b/src/scripts/ci/travis/install.sh
index 30c54fdbe..c3e4ee834 100755
--- a/src/scripts/ci/travis/install.sh
+++ b/src/scripts/ci/travis/install.sh
@@ -28,8 +28,17 @@ if [ "$TRAVIS_OS_NAME" = "linux" ]; then
sudo pip install sphinx
fi
- if [ "$BUILD_MODE" = "valgrind" ] || [ "${BUILD_MODE:0:5}" = "cross" ]; then
+ if [ "$BUILD_MODE" = "coverage" ]; then
+ sudo apt-get install trousers libtspi-dev
+
+ # SoftHSMv1 in 14.04 does not work
+ # Installs prebuilt SoftHSMv2 binaries into /tmp
+ wget https://www.randombit.net/softhsm2-trusty-bin.tar.bz2
+ tar -C / -xvjf softhsm2-trusty-bin.tar.bz2
+ /tmp/softhsm/bin/softhsm2-util --init-token --free --label test --pin 123456 --so-pin 12345678
+ fi
+ if [ "$BUILD_MODE" = "valgrind" ] || [ "${BUILD_MODE:0:5}" = "cross" ]; then
if [ "$BUILD_MODE" = "valgrind" ]; then
sudo apt-get install valgrind
elif [ "$BUILD_MODE" = "cross-win32" ]; then