Merge "BUG-2625: activate JDK8 verification for gbp"
[releng/builder.git] / vagrant / ubuntu-mininet / bootstrap.sh
1 #!/bin/bash
2
3 # vim: sw=4 ts=4 sts=4 et tw=72 :
4
5 echo "---> Updating operating system"
6 apt-get update -qq
7 apt-get upgrade -y --force-yes -qq
8
9 # To handle the prompt style that is expected all over the environment
10 # with how use use robotframework we need to make sure that it is
11 # consistent for any of the users that are created during dynamic spin
12 # ups
13 echo 'PS1="[\u@\h \W]> "' >> /etc/skel/.bashrc
14
15 # Install mininet
16 # apt-get install -y --force-yes -qq mininet
17
18 # Install mininet with OF13 patch
19 cd /tmp
20 cat > newOptions.patch <<EOF
21 --- mininet/node.py     2014-09-12 13:48:03.165628683 +0100
22 +++ mininet/node.py     2014-09-12 13:50:39.021630236 +0100
23 @@ -952,6 +952,10 @@
24             datapath: userspace or kernel mode (kernel|user)"""
25          Switch.__init__( self, name, **params )
26          self.failMode = failMode
27 +        protKey = 'protocols'
28 +        if self.params and protKey in self.params:
29 +               print 'have protcol params!'
30 +               self.opts += protKey + '=' + self.params[protKey]
31          self.datapath = datapath
32
33      @classmethod
34 @@ -1027,8 +1031,9 @@
35          if self.datapath == 'user':
36              self.cmd( 'ovs-vsctl set bridge', self,'datapath_type=netdev' )
37          int( self.dpid, 16 ) # DPID must be a hex string
38 +        print 'OVSswitch opts: ',self.opts
39          self.cmd( 'ovs-vsctl -- set Bridge', self,
40 -                  'other_config:datapath-id=' + self.dpid )
41 +                  self.opts+' other_config:datapath-id=' + self.dpid )
42          self.cmd( 'ovs-vsctl set-fail-mode', self, self.failMode )
43          for intf in self.intfList():
44              if not intf.IP():
45 EOF
46
47 git clone git://github.com/mininet/mininet
48 cd mininet/
49 git checkout -b 2.1.0 2.1.0
50 git apply -p0 < ../newOptions.patch
51 cd ./util
52 ./install.sh -nfv
53
54 # Install CPqD
55 apt-get install -y --force-yes -qq build-essential cmake flex
56 apt-get install -y --force-yes -qq libpcre++-dev libxerces-c-dev libpcap-dev libboost-all-dev
57
58 cd /tmp
59 wget -nc http://de.archive.ubuntu.com/ubuntu/pool/main/b/bison/bison_2.5.dfsg-2.1_amd64.deb \
60          http://de.archive.ubuntu.com/ubuntu/pool/main/b/bison/libbison-dev_2.5.dfsg-2.1_amd64.deb
61
62 dpkg -i bison_2.5.dfsg-2.1_amd64.deb libbison-dev_2.5.dfsg-2.1_amd64.deb
63 rm bison_2.5.dfsg-2.1_amd64.deb libbison-dev_2.5.dfsg-2.1_amd64.deb
64
65 wget -nc http://www.nbee.org/download/nbeesrc-jan-10-2013.zip
66 unzip nbeesrc-jan-10-2013.zip
67 cd nbeesrc-jan-10-2013/src
68 cmake .
69 make
70 cp ../bin/libn*.so /usr/local/lib
71 ldconfig
72 cp -R ../include/* /usr/include/
73 cd ../..
74
75 git clone https://github.com/CPqD/ofsoftswitch13.git
76 cd ofsoftswitch13
77 ./boot.sh
78 ./configure
79 make
80 make install
81 cd ..
82
83 # cbench installation for running openflow performance tests
84
85 OF_DIR=$HOME/openflow  # Directory that contains OpenFlow code
86 OFLOPS_DIR=$HOME/oflops  # Directory that contains oflops repo
87
88 apt-get install -y --force-yes -qq libsnmp-dev libpcap-dev libconfig-dev
89
90 git clone git://gitosis.stanford.edu/openflow.git $OF_DIR
91 git clone https://github.com/andi-bigswitch/oflops.git $OFLOPS_DIR
92
93 cd $OFLOPS_DIR
94 ./boot.sh
95 ./configure --with-openflow-src-dir=$OF_DIR
96 make
97 make install