Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | set -x |
| 3 | set -e |
| 4 | |
Alexander Afanasyev | f22ebaf | 2015-12-17 21:23:05 -0800 | [diff] [blame^] | 5 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 6 | source "$JDIR"/util.sh |
| 7 | |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 8 | # Prepare environment |
| 9 | rm -Rf ~/.ndnx ~/.ndn |
| 10 | |
Alexander Afanasyev | f22ebaf | 2015-12-17 21:23:05 -0800 | [diff] [blame^] | 11 | if has OSX $NODE_LABELS; then |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 12 | security unlock-keychain -p "named-data" |
| 13 | sudo chgrp admin /dev/bpf* |
| 14 | sudo chmod g+rw /dev/bpf* |
| 15 | fi |
Alexander Afanasyev | f22ebaf | 2015-12-17 21:23:05 -0800 | [diff] [blame^] | 16 | |
| 17 | if has Linux $NODE_LABELS; then |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 18 | 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 |
| 21 | fi |
| 22 | |
| 23 | ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert - |
| 24 | |
| 25 | # Run unit tests |
| 26 | # Core |
Alexander Afanasyev | f22ebaf | 2015-12-17 21:23:05 -0800 | [diff] [blame^] | 27 | if [[ -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 Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 30 | |
Alexander Afanasyev | f22ebaf | 2015-12-17 21:23:05 -0800 | [diff] [blame^] | 31 | ./build/unit-tests-daemon -l all --log_format2=XML --log_sink2=build/xunit-daemon-report.xml |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 32 | |
Alexander Afanasyev | f22ebaf | 2015-12-17 21:23:05 -0800 | [diff] [blame^] | 33 | ./build/unit-tests-rib -l all --log_format2=XML --log_sink2=build/xunit-rib-report.xml |
| 34 | else |
| 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 |
| 41 | fi |