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 |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame^] | 21 | # unit-tests-tools does not need capabilities |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 22 | fi |
| 23 | |
| 24 | ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert - |
| 25 | |
| 26 | # Run unit tests |
| 27 | # Core |
Alexander Afanasyev | f22ebaf | 2015-12-17 21:23:05 -0800 | [diff] [blame] | 28 | if [[ -n $XUNIT ]]; then |
Alexander Afanasyev | 3152aba | 2016-01-18 22:44:38 +0100 | [diff] [blame] | 29 | ./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 Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 31 | |
Alexander Afanasyev | 3152aba | 2016-01-18 22:44:38 +0100 | [diff] [blame] | 32 | ./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] | 33 | |
Alexander Afanasyev | 3152aba | 2016-01-18 22:44:38 +0100 | [diff] [blame] | 34 | ./build/unit-tests-rib -l all -- --log_format2=XML --log_sink2=build/xunit-rib-report.xml |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame^] | 35 | |
| 36 | ./build/unit-tests-tools -l all -- --log_format2=XML --log_sink2=build/xunit-tools-report.xml |
Alexander Afanasyev | f22ebaf | 2015-12-17 21:23:05 -0800 | [diff] [blame] | 37 | else |
| 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 Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame^] | 44 | |
| 45 | ./build/unit-tests-tools -l test_suite |
Alexander Afanasyev | f22ebaf | 2015-12-17 21:23:05 -0800 | [diff] [blame] | 46 | fi |