blob: dcd2b9d509d33394c2c1c402138385d0b027bd34 [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
28 ./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 Afanasyevf22ebaf2015-12-17 21:23:05 -080031 ./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 Afanasyevf22ebaf2015-12-17 21:23:05 -080033 ./build/unit-tests-rib -l all --log_format2=XML --log_sink2=build/xunit-rib-report.xml
34else
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