-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Travis stopped working on 3.X as the deb packages are no longer at the link specified. Rather then having to wget a ton of dependencies, that tend to cause intermittent build failures, use the docker container approach on the master branch. Signed-off-by: William Roberts <william.c.roberts@intel.com>
- Loading branch information
William Roberts
committed
Apr 4, 2018
1 parent
9c9501e
commit 988e1e9
Showing
4 changed files
with
252 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CC | ||
COVERITY_SCAN_TOKEN | ||
COVERALLS_REPO_TOKEN | ||
|
||
TRAVIS_BUILD_DIR=/workspace/tpm2-tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
#!/usr/bin/env bash | ||
#;**********************************************************************; | ||
# | ||
# Copyright (c) 2017, Intel Corporation | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are met: | ||
# | ||
# 1. Redistributions of source code must retain the above copyright notice, | ||
# this list of conditions and the following disclaimer. | ||
# | ||
# 2. Redistributions in binary form must reproduce the above copyright notice, | ||
# this list of conditions and the following disclaimer in the documentation | ||
# and/or other materials provided with the distribution. | ||
# | ||
# 3. Neither the name of Intel Corporation nor the names of its contributors | ||
# may be used to endorse or promote products derived from this software without | ||
# specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
# THE POSSIBILITY OF SUCH DAMAGE. | ||
#;**********************************************************************; | ||
|
||
# all command failures are fatal | ||
set -e | ||
|
||
WORKSPACE=`dirname $TRAVIS_BUILD_DIR` | ||
|
||
echo "Workspace: $WORKSPACE" | ||
|
||
source $TRAVIS_BUILD_DIR/.ci/download-deps.sh | ||
|
||
get_deps "$WORKSPACE" | ||
|
||
export LD_LIBRARY_PATH=/usr/local/lib/ | ||
export PATH=$PATH:/root/.local/bin/ | ||
|
||
echo "echo changing to $TRAVIS_BUILD_DIR" | ||
# Change to the the travis build dir | ||
cd $TRAVIS_BUILD_DIR | ||
|
||
echo "starting dbus" | ||
mkdir -p /var/run/dbus | ||
if [ -e /var/run/dbus/pid ]; then | ||
rm /var/run/dbus/pid | ||
fi | ||
|
||
# start dbus | ||
dbus-daemon --fork --system | ||
echo "dbus started" | ||
|
||
# let dbus have time to start up | ||
sleep 5 | ||
|
||
echo "starting tpm server" | ||
# start the tpm server | ||
/ibmtpm974/src/tpm_server & | ||
echo "tpm server started" | ||
|
||
# start tpm2-abrmd | ||
|
||
# let the tpm simulator have time to start up before abrmd | ||
# tries to connect. | ||
sleep 5 | ||
|
||
echo "starting abrmd server" | ||
tpm2-abrmd --tcti=socket & | ||
echo "started abrmd server" | ||
|
||
if [ -d build ]; then | ||
rm -rf build | ||
fi | ||
|
||
# Do not run tests when building on coverity_scan branch | ||
if [ "${COVERITY_SCAN_BRANCH}" == 1 ]; then | ||
echo "Coverity scan branch detected, not running build nor tests...exiting!" | ||
exit 0 | ||
fi | ||
|
||
# If it's clang, enable asan | ||
if [[ "$CC" == clang* ]]; then | ||
echo "Detecting clang, enable asan" | ||
export CFLAGS="-O1 -g -fsanitize=address -fno-omit-frame-pointer" | ||
echo "Exported CFLAGS=$CFLAGS" | ||
config_flags="--disable-hardening" | ||
echo "Disabled configure option hardening" | ||
export ASAN_ENABLED=true | ||
echo "Exported ASAN_ENABLED=$ASAN_ENABLED" | ||
# To get line numbers set up the asan symbolizer | ||
clang_version=`$CC --version | head -n 1 | cut -d\ -f 3-3 | cut -d\. -f 1-2` | ||
# Sometimes the version string has an Ubuntu on the front of it and the field | ||
# location changes | ||
if [ $clang_version == "version" ]; then | ||
clang_version=`$CC --version | head -n 1 | cut -d\ -f 4-4 | cut -d\. -f 1-2` | ||
fi | ||
echo "Detected clang version: $clang_version" | ||
ASAN_SYMBOLIZER_PATH="/usr/lib/llvm-$clang_version/bin/llvm-symbolizer" | ||
if [ -e "$ASAN_SYMBOLIZER_PATH" ]; then | ||
export ASAN_SYMBOLIZER_PATH | ||
echo "Exported ASAN_SYMBOLIZER_PATH=$ASAN_SYMBOLIZER_PATH" | ||
else | ||
echo "No llvm symbolizer found at: $ASAN_SYMBOLIZER_PATH" | ||
unset ASAN_SYMBOLIZER_PATH | ||
fi | ||
else #GCC | ||
export ENABLE_COVERAGE=true | ||
echo "Exported ENABLE_COVERAGE=true" | ||
config_flags="--disable-hardening --enable-code-coverage" | ||
fi | ||
|
||
# Bootstrap in the tpm2.0-tss tools directory | ||
./bootstrap | ||
|
||
# clang has asan enabled with options exported that fail | ||
# make distcheck, so only do this with gcc. | ||
# Do a make distcheck in the root, clear it and than | ||
# cd to the variant directory. | ||
if [ "$CC" == "gcc" ]; then | ||
./configure | ||
make distcheck | ||
make distclean | ||
fi | ||
|
||
# Make a build variant directory and change to it | ||
mkdir ./build | ||
pushd ./build | ||
|
||
../configure --enable-unit $config_flags | ||
make -j$(nproc) | ||
make -j$(nproc) check | ||
|
||
popd | ||
|
||
# Switch over to the test directory | ||
pushd ./test/system | ||
|
||
# Run the tests on ALL device TCTIs configuration | ||
|
||
TOOLS="$(pwd)/../../build/tools" | ||
PATH=$TOOLS:$TOOLS/aux:$PATH ./test.sh -p | ||
|
||
# done go back to tpm2-tools directory | ||
popd | ||
|
||
# upload coveralls results | ||
./.ci/coveralls-upload.sh | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/usr/bin/env bash | ||
#;**********************************************************************; | ||
# | ||
# Copyright (c) 2017, Intel Corporation | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are met: | ||
# | ||
# 1. Redistributions of source code must retain the above copyright notice, | ||
# this list of conditions and the following disclaimer. | ||
# | ||
# 2. Redistributions in binary form must reproduce the above copyright notice, | ||
# this list of conditions and the following disclaimer in the documentation | ||
# and/or other materials provided with the distribution. | ||
# | ||
# 3. Neither the name of Intel Corporation nor the names of its contributors | ||
# may be used to endorse or promote products derived from this software without | ||
# specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
# THE POSSIBILITY OF SUCH DAMAGE. | ||
#;**********************************************************************; | ||
|
||
function get_deps() { | ||
|
||
echo "pwd starting: `pwd`" | ||
pushd "$1" | ||
echo "pwd clone tss: `pwd`" | ||
git clone -b 1.x https://github.com/tpm2-software/tpm2-tss.git | ||
pushd tpm2-tss | ||
echo "pwd build tss: `pwd`" | ||
./bootstrap | ||
./configure | ||
make -j4 | ||
make install | ||
popd | ||
echo "pwd done tss: `pwd`" | ||
|
||
echo "pwd clone abrmd: `pwd`" | ||
git clone -b 1.x https://github.com/tpm2-software/tpm2-abrmd.git | ||
pushd tpm2-abrmd | ||
echo "pwd build abrmd: `pwd`" | ||
./bootstrap | ||
./configure | ||
make -j4 | ||
make install | ||
popd | ||
echo "pwd done abrmd: `pwd`" | ||
popd | ||
echo "pwd done: `pwd`" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters