aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-08-20 06:55:35 -0400
committerJack Lloyd <[email protected]>2019-08-30 14:57:22 -0400
commit55becd8a67f3b98f93b569e7bdc263dac552f527 (patch)
tree6e4410224f5a79d5b82d67933af7ab474284510c
parentbaac1a8497533c1f2f0e699cc6ddc5f8b263adfc (diff)
Use SoftHSM from Ubuntu package repository
-rwxr-xr-xsrc/scripts/ci/setup_travis.sh17
-rw-r--r--src/scripts/ci/travis.yml2
-rwxr-xr-xsrc/scripts/ci_build.py20
3 files changed, 25 insertions, 14 deletions
diff --git a/src/scripts/ci/setup_travis.sh b/src/scripts/ci/setup_travis.sh
index 6fac17602..ddad66c87 100755
--- a/src/scripts/ci/setup_travis.sh
+++ b/src/scripts/ci/setup_travis.sh
@@ -56,19 +56,18 @@ if [ "$TRAVIS_OS_NAME" = "linux" ]; then
sudo apt-get install pylint
elif [ "$BUILD_MODE" = "coverage" ]; then
+ # need updated softhsm to avoid https://github.com/opendnssec/SoftHSMv2/issues/239
+ sudo add-apt-repository -y ppa:pkg-opendnssec/ppa
sudo apt-get -qq update
- sudo apt-get install trousers libtspi-dev lcov python-coverage libboost-all-dev golang-1.10
-
- git clone --depth 1 https://github.com/randombit/botan-ci-tools
+ sudo apt-get install softhsm2 trousers libtspi-dev lcov python-coverage libboost-all-dev golang-1.10 gdb
+ pip install --user codecov==2.0.10
git clone --depth 1 --branch runner-changes https://github.com/randombit/boringssl.git
- # FIXME use distro softhsm2 package instead
- # need to figure out ownership problem
- # Installs prebuilt SoftHSMv2 binaries into /tmp
- tar -C / -xvjf botan-ci-tools/softhsm2-trusty-bin.tar.bz2
- /tmp/softhsm/bin/softhsm2-util --init-token --free --label test --pin 123456 --so-pin 12345678
+ sudo chgrp -R "$(id -g)" /var/lib/softhsm/ /etc/softhsm
+ sudo mkdir /var/lib/softhsm/tokens
+ sudo chmod g+w /var/lib/softhsm/tokens
- pip install --user codecov==2.0.10
+ softhsm2-util --init-token --free --label test --pin 123456 --so-pin 12345678
elif [ "$BUILD_MODE" = "docs" ]; then
sudo apt-get -qq update
diff --git a/src/scripts/ci/travis.yml b/src/scripts/ci/travis.yml
index b14ef34a3..d8e81f55f 100644
--- a/src/scripts/ci/travis.yml
+++ b/src/scripts/ci/travis.yml
@@ -109,7 +109,7 @@ install:
- ./src/scripts/ci/setup_travis.sh
script:
- - ./src/scripts/ci_build.py --os=$TRAVIS_OS_NAME --cc=$CC --cc-bin=$CXX --without-pylint3 --pkcs11-lib=/tmp/softhsm/lib/softhsm/libsofthsm2.so $BUILD_MODE
+ - ./src/scripts/ci_build.py --os=$TRAVIS_OS_NAME --cc=$CC --cc-bin=$CXX --without-pylint3 --pkcs11-lib=/usr/lib/x86_64-linux-gnu/softhsm/libsofthsm2.so $BUILD_MODE
# whitelist branches to avoid testing feature branches twice (as branch and as pull request)
branches:
diff --git a/src/scripts/ci_build.py b/src/scripts/ci_build.py
index 6f746edf3..970ffbcbf 100755
--- a/src/scripts/ci_build.py
+++ b/src/scripts/ci_build.py
@@ -26,7 +26,7 @@ def get_concurrency():
except ImportError:
return def_concurrency
-def determine_flags(target, target_os, target_cpu, target_cc, cc_bin, ccache, root_dir, pkcs11_lib):
+def determine_flags(target, target_os, target_cpu, target_cc, cc_bin, ccache, root_dir, pkcs11_lib, use_gdb):
# pylint: disable=too-many-branches,too-many-statements,too-many-arguments,too-many-locals
"""
@@ -97,7 +97,7 @@ def determine_flags(target, target_os, target_cpu, target_cc, cc_bin, ccache, ro
test_cmd = None
if target == 'coverage':
- flags += ['--with-coverage-info', '--test-mode', '--build-bogo-shim']
+ flags += ['--with-coverage-info', '--with-debug-info', '--test-mode', '--build-bogo-shim']
if target == 'valgrind':
# valgrind in 16.04 has a bug with rdrand handling
flags += ['--with-valgrind', '--disable-rdrand']
@@ -262,7 +262,16 @@ def determine_flags(target, target_os, target_cpu, target_cc, cc_bin, ccache, ro
if test_cmd is None:
run_test_command = None
else:
- run_test_command = test_prefix + test_cmd
+ if use_gdb:
+ (cmd, args) = test_cmd[0], test_cmd[1:]
+ args += ['--skip-tests=os_utils']
+ run_test_command = test_prefix + ['gdb', cmd,
+ '-ex', 'run %s' % (' '.join(args)),
+ '-ex', 'bt',
+ '-ex', 'quit']
+ else:
+ run_test_command = test_prefix + test_cmd
+
return flags, run_test_command, make_prefix
@@ -362,6 +371,9 @@ def parse_args(args):
parser.add_option('--without-pylint3', dest='use_pylint3', action='store_false',
help='Disable using python3 pylint')
+ parser.add_option('--run-under-gdb', dest='use_gdb', action='store_true', default=False,
+ help='Run test suite under gdb and capture backtrace')
+
return parser.parse_args(args)
def have_prog(prog):
@@ -483,7 +495,7 @@ def main(args=None):
config_flags, run_test_command, make_prefix = determine_flags(
target, options.os, options.cpu, options.cc,
options.cc_bin, options.compiler_cache, root_dir,
- options.pkcs11_lib)
+ options.pkcs11_lib, options.use_gdb)
cmds.append([py_interp, os.path.join(root_dir, 'configure.py')] + config_flags)