blob: f12ee5989bd2cc10a71472b6472b4c7e3c399ed0 [file] [log] [blame]
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07001#!/usr/bin/env bash
2set -x
3set -e
4
Alexander Afanasyevf22ebaf2015-12-17 21:23:05 -08005JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
6source "$JDIR"/util.sh
7
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07008# Prepare environment
9rm -Rf ~/.ndnx ~/.ndn
10
Alexander Afanasyevf22ebaf2015-12-17 21:23:05 -080011if has OSX $NODE_LABELS; then
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070012 security unlock-keychain -p "named-data"
13 sudo chgrp admin /dev/bpf*
14 sudo chmod g+rw /dev/bpf*
15fi
Alexander Afanasyevf22ebaf2015-12-17 21:23:05 -080016
17if has Linux $NODE_LABELS; then
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070018 sudo setcap cap_net_raw,cap_net_admin=eip `pwd`/build/unit-tests-core || true
19 sudo setcap cap_net_raw,cap_net_admin=eip `pwd`/build/unit-tests-daemon || true
20 sudo setcap cap_net_raw,cap_net_admin=eip `pwd`/build/unit-tests-rib || true
21fi
22
23ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert -
24
25# Run unit tests
26# Core
Alexander Afanasyevf22ebaf2015-12-17 21:23:05 -080027if [[ -n $XUNIT ]]; then
Alexander Afanasyev3152aba2016-01-18 22:44:38 +010028 ./build/unit-tests-core -l all -- --log_format2=XML --log_sink2=build/xunit-core-report.xml
29 sudo ./build/unit-tests-core -t TestPrivilegeHelper -l all -- --log_format2=XML --log_sink2=build/xunit-core-sudo-report.xml
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070030
Alexander Afanasyev3152aba2016-01-18 22:44:38 +010031 ./build/unit-tests-daemon -l all -- --log_format2=XML --log_sink2=build/xunit-daemon-report.xml
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070032
Alexander Afanasyev3152aba2016-01-18 22:44:38 +010033 ./build/unit-tests-rib -l all -- --log_format2=XML --log_sink2=build/xunit-rib-report.xml
Alexander Afanasyevf22ebaf2015-12-17 21:23:05 -080034else
35 ./build/unit-tests-core -l test_suite
36 sudo ./build/unit-tests-core -t TestPrivilegeHelper -l test_suite
37
38 ./build/unit-tests-daemon -l test_suite
39
40 ./build/unit-tests-rib -l test_suite
41fi