Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | set -x |
| 3 | set -e |
| 4 | |
| 5 | # Prepare environment |
| 6 | rm -Rf ~/.ndnx ~/.ndn |
| 7 | |
| 8 | echo $NODE_LABELS |
| 9 | IS_OSX=$( python -c "print 'yes' if 'OSX' in '$NODE_LABELS'.strip().split(' ') else 'no'" ) |
| 10 | IS_LINUX=$( python -c "print 'yes' if 'Linux' in '$NODE_LABELS'.strip().split(' ') else 'no'" ) |
| 11 | |
| 12 | if [[ $IS_OSX == "yes" ]]; then |
| 13 | security unlock-keychain -p "named-data" |
| 14 | sudo chgrp admin /dev/bpf* |
| 15 | sudo chmod g+rw /dev/bpf* |
| 16 | fi |
| 17 | if [[ $IS_LINUX = "yes" ]]; then |
| 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 |
| 27 | ./build/unit-tests-core -l test_suite |
| 28 | |
| 29 | # Daemon |
| 30 | ./build/unit-tests-daemon -l test_suite |
| 31 | |
| 32 | # RIB |
| 33 | ./build/unit-tests-rib -l test_suite |