blob: 89ff5da48b3dbaa7a33d99a7d32386d8b54cdb7f [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
Junxiao Shi38f4ce92016-08-04 10:01:52 +000021 # unit-tests-tools does not need capabilities
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070022fi
23
24ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert -
25
26# Run unit tests
27# Core
Alexander Afanasyevf22ebaf2015-12-17 21:23:05 -080028if [[ -n $XUNIT ]]; then
Alexander Afanasyev3152aba2016-01-18 22:44:38 +010029 ./build/unit-tests-core -l all -- --log_format2=XML --log_sink2=build/xunit-core-report.xml
30 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 -070031
Alexander Afanasyev3152aba2016-01-18 22:44:38 +010032 ./build/unit-tests-daemon -l all -- --log_format2=XML --log_sink2=build/xunit-daemon-report.xml
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070033
Alexander Afanasyev3152aba2016-01-18 22:44:38 +010034 ./build/unit-tests-rib -l all -- --log_format2=XML --log_sink2=build/xunit-rib-report.xml
Junxiao Shi38f4ce92016-08-04 10:01:52 +000035
36 ./build/unit-tests-tools -l all -- --log_format2=XML --log_sink2=build/xunit-tools-report.xml
Alexander Afanasyevf22ebaf2015-12-17 21:23:05 -080037else
38 ./build/unit-tests-core -l test_suite
39 sudo ./build/unit-tests-core -t TestPrivilegeHelper -l test_suite
40
41 ./build/unit-tests-daemon -l test_suite
42
43 ./build/unit-tests-rib -l test_suite
Junxiao Shi38f4ce92016-08-04 10:01:52 +000044
45 ./build/unit-tests-tools -l test_suite
Alexander Afanasyevf22ebaf2015-12-17 21:23:05 -080046fi