BugFix: fix storperf deployment location error
[yardstick.git] / vTC / build.sh
1 #!/bin/sh
2
3 # Jira No.137
4
5 # download and install required libraries
6 apt-get update
7 apt-get install -y git build-essential gcc libnuma-dev bison flex byacc libjson0-dev libcurl4-gnutls-dev jq dh-autoreconf libpcap-dev libpulse-dev libtool pkg-config
8
9 # Setup for PF_RING and bridge between interfaces
10
11 # Get the source code from the bitbucket repository with OAuth2 authentication
12 rm resp.json
13 curl -X POST -u "mPkgwvJPsTFS8hYmHk:SDczcrK4cvnkMRWSEchB3ANcWbqFXqPx" https://bitbucket.org/site/oauth2/access_token -d grant_type=refresh_token -d refresh_token=38uFQuhEdPvCTbhc7k >> resp.json
14 access_token=`jq -r '.access_token' resp.json`
15 git clone https://x-token-auth:${access_token}@bitbucket.org/akiskourtis/vtc.git
16 cd vtc
17 git checkout -b stable
18 #Build nDPI library
19 cd nDPI
20 NDPI_DIR=$(pwd)
21 echo $NDPI_DIR
22 NDPI_INCLUDE=$(pwd)/src/include
23 echo $NDPI_INCLUDE
24 ./autogen.sh
25 ./configure
26 make
27 make install
28
29 #Build PF_RING library
30 cd ..
31 cd PF_RING
32 make
33 #Build PF_RING examples, including the modified pfbridge, with nDPI integrated.
34 cd userland/examples/
35 sed -i 's#EXTRA_LIBS =#EXTRA_LIBS='"${NDPI_DIR}"'/src/lib/.libs/libndpi.a -ljson-c#' ./Makefile
36 sed -i 's# -Ithird-party# -Ithird-party/ -I'"$NDPI_INCLUDE"' -I'"$NDPI_DIR"'#' ./Makefile
37 echo $NDPI_DIR
38 make
39 cd ../..
40 cd ..
41 cd ..
42 #sudo rmmod pf_ring
43 insmod ./vtc/PF_RING/kernel/pf_ring.ko min_num_slots=16384 enable_debug=1 quick_mode=1 enable_tx_capture=0
44 #./vtc/PF_RING/userland/examples/pfbridge -a eth1 -b eth2