3 # vim: sw=4 ts=4 sts=4 et tw=72 :
5 # force any errors to cause the script and job to end in failure
8 # Ensure that necessary variables are set to enable noninteractive mode in
10 export DEBIAN_FRONTEND=noninteractive
12 # To handle the prompt style that is expected all over the environment
13 # with how use use robotframework we need to make sure that it is
14 # consistent for any of the users that are created during dynamic spin
16 echo 'PS1="[\u@\h \W]> "' >> /etc/skel/.bashrc
18 echo '---> Install mininet with OF13 patch'
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
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
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():
47 git clone git://github.com/mininet/mininet
49 git checkout -b 2.1.0 2.1.0
50 git apply -p0 < ../newOptions.patch
54 echo '---> Installing cbench installation for running openflow performance tests'
55 OF_DIR="$HOME/openflow" # Directory that contains OpenFlow code
56 OFLOPS_DIR="$HOME/oflops" # Directory that contains oflops repo
58 apt-get install -y --force-yes libsnmp-dev libpcap-dev libconfig-dev
60 git clone git://gitosis.stanford.edu/openflow.git "$OF_DIR"
61 git clone https://github.com/andi-bigswitch/oflops.git "$OFLOPS_DIR"
65 ./configure --with-openflow-src-dir="$OF_DIR"
69 echo '---> Installing vlan for vlan based tests in VTN suites'
70 apt-get install -y --force-yes vlan
72 # Install netaddr package which is needed by some custom mininet topologies
73 apt-get install -y --force-yes -qq python-netaddr