blob: 6385fc91988c4cf9fe10e245646445cd859410c5 [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
28
29# Daemon
30./build/unit-tests-daemon -l test_suite
31
32# RIB
33./build/unit-tests-rib -l test_suite