This repository has been archived by the owner on May 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
/
.travis.yml
86 lines (80 loc) · 3.2 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
language: c
compiler:
- gcc
- clang-3.8
env:
- TSS_BRANCH=master TPM2_TOOLS_BRANCH=master TSS_CONFIGURATIONS=--disable-esapi TCTI=mssim
matrix:
include:
env: TSS_BRANCH=1.x TPM2_TOOLS_BRANCH=3.0.X TSS_CONFIGURATIONS= TCTI=socket
sudo: required
dist: trusty
addons:
apt:
packages:
- cmake
- libp11-kit-dev
- liburiparser-dev
- clang-3.8
- libdbus-1-dev
- libglib2.0-dev
- pandoc
- libcurl4-gnutls-dev
install:
# build tpm2 simulator - needed for testing
- wget https://downloads.sourceforge.net/project/ibmswtpm2/ibmtpm1119.tar.gz
- sha256sum ibmtpm1119.tar.gz | grep -q b9eef79904e276aeaed2a6b9e4021442ef4d7dfae4adde2473bef1a6a4cd10fb
- mkdir ibmtpm1119 && pushd ibmtpm1119 && tar axf ../ibmtpm1119.tar.gz && pushd ./src && make
- ./tpm_server &
- popd && popd
# build tpm2-tss
- wget http://ftpmirror.gnu.org/autoconf-archive/autoconf-archive-2017.09.28.tar.xz
- sha256sum autoconf-archive-2017.09.28.tar.xz | grep -q 5c9fb5845b38b28982a3ef12836f76b35f46799ef4a2e46b48e2bd3c6182fa01
- tar xJf autoconf-archive-2017.09.28.tar.xz && pushd autoconf-archive-2017.09.28
- ./configure --prefix=/usr && make -j$(nproc) && sudo make install
- popd
- git clone https://github.com/tpm2-software/tpm2-tss.git --branch $TSS_BRANCH
- pushd tpm2-tss
- ./bootstrap && ./configure ${TSS_CONFIGURATIONS} && make -j$(nproc)
- sudo make install
- popd
- sudo ldconfig /usr/local/lib
# build user space resource manager & attach to simulator
- git clone https://github.com/tpm2-software/tpm2-abrmd.git --branch $TSS_BRANCH
- pushd tpm2-abrmd
- ./bootstrap && ./configure --disable-dlclose --with-dbuspolicydir=/etc/dbus-1/system.d && make -j$(nproc) && sudo make install && popd
- sudo mkdir -p /var/lib/tpm
- sudo groupadd tss && sudo useradd -M -d /var/lib/tpm -s /bin/false -g tss tss
- sudo pkill -HUP dbus-daemon
- sudo -u tss tpm2-abrmd --tcti=$TCTI &
# openssl 1.0.2g - needed for tpm2-tools
- wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.2g-1ubuntu4.13_amd64.deb
- wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl-dev_1.0.2g-1ubuntu4.13_amd64.deb
- sha256sum libssl1.0.0_*_amd64.deb | grep -q 22218427bf75a27e4e384d98bcb5286144ff824cc86bf21a82632304ac099195
- sha256sum libssl-dev_*_amd64.deb | grep -q c6aadbb7b58700a108ef9d51edbdf9dd7534f70d02943a2e540f2021619602b5
- sudo dpkg -i libssl1.0.0_*_amd64.deb
- sudo dpkg -i libssl-dev_*_amd64.deb
# build tpm2-tools - needed for testing
- git clone https://github.com/tpm2-software/tpm2-tools.git --branch $TPM2_TOOLS_BRANCH
- pushd tpm2-tools
- ./bootstrap && TSS2_SYS_CFLAGS='-Wno-missing-field-initializers' ./configure --disable-dlclose && make -j$(nproc) && sudo make install
- popd
# setup travis environment for testing.
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- git clone https://github.com/sstephenson/bats.git
- pushd bats
- sudo ./install.sh /usr/local
- popd
- mkdir -p ~/.tpm2
- pushd ~/.tpm2
- echo "type tabrmd" >> config
- echo "hostname localhost" >> config
- echo "sign-using-encrypt true" >> config
- popd
script:
- mkdir build
- pushd build
- cmake .. && make
- popd
- ./test/travis_run_bat.sh