blob: a02a94c313185a2315f1c5ec5ac86d17e09d9c6f [file] [log] [blame]
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07001#!/usr/bin/env bash
2set -x
3set -e
4
5# Prepare environment
6rm -Rf ~/.ndnx ~/.ndn
7
8echo $NODE_LABELS
9IS_OSX=$( python -c "print 'yes' if 'OSX' in '$NODE_LABELS'.strip().split(' ') else 'no'" )
10IS_LINUX=$( python -c "print 'yes' if 'Linux' in '$NODE_LABELS'.strip().split(' ') else 'no'" )
11
12if [[ $IS_OSX == "yes" ]]; then
13 security unlock-keychain -p "named-data"
14 sudo chgrp admin /dev/bpf*
15 sudo chmod g+rw /dev/bpf*
16fi
17if [[ $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
21fi
22
23ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert -
24
25# Run unit tests
26# Core
27./build/unit-tests-core -l test_suite
Alexander Afanasyev49343f62015-01-26 21:58:07 -080028sudo ./build/unit-tests-core -t CorePrivilegeHelper -l test_suite
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070029
30# Daemon
31./build/unit-tests-daemon -l test_suite
32
33# RIB
34./build/unit-tests-rib -l test_suite