Job for testing the ODL user configuration
[releng/builder.git] / packer / provision / mininet-ovs-2.6.sh
1 #!/bin/bash -x
2
3 # vim: sw=4 ts=4 sts=4 et tw=72 :
4
5 # force any errors to cause the script and job to end in failure
6 set -xeu -o pipefail
7
8 # Ensure that necessary variables are set to enable noninteractive mode in
9 # commands.
10 export DEBIAN_FRONTEND=noninteractive
11
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
15 # ups
16 echo 'PS1="[\u@\h \W]> "' >> /etc/skel/.bashrc
17
18 echo '---> Install OpenVSwitch 2.6.1'
19 apt-get update -m
20 apt-get install dh-autoreconf debhelper autoconf automake libssl-dev pkg-config bzip2 openssl python-all procps python-qt4 python-zopeinterface python-twisted-conch
21 mkdir /root/ovs
22 cd /root
23 pwd
24 wget http://openvswitch.org/releases/openvswitch-2.6.1.tar.gz
25 tar -xzvf openvswitch-2.6.1.tar.gz -C /root/ovs --strip-components=1
26 cd /root/ovs
27 DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary
28 cd /root
29 dpkg -i openvswitch-common_2.6.1-1_amd64.deb openvswitch-switch_2.6.1-1_amd64.deb python-openvswitch_2.6.1-1_all.deb openvswitch-vtep_2.6.1-1_amd64.deb
30 systemctl unmask openvswitch-switch
31 service openvswitch-switch start
32 service openvswitch-vtep start
33 echo '---> Waiting 15 secs for services to start'
34 sleep 15
35 ovs-vsctl --version
36 ovs-vsctl show
37 # We want to see the entire ps output not just the pid
38 # shellcheck disable=SC2009
39 ps -elf | grep ovs
40 # shellcheck disable=SC2009
41 ps -elf | grep vtep
42 echo '---> Finished installing OpenVSwitch 2.6.1'
43
44 echo '---> Installing mininet'
45 apt-get install mininet
46
47 echo '---> Installing build pre-requisites'
48 apt-get install build-essential snmp libsnmp-dev snmpd libpcap-dev \
49 autoconf make automake libtool libconfig-dev libssl-dev libffi-dev libssl-doc pkg-config
50
51 git clone https://github.com/intracom-telecom-sdn/mtcbench.git
52 mtcbench/deploy/docker/provision.sh
53 # TODO: remove workaround for build issue with mtcbench
54 # when mtcbench dependency build correctly
55 # https://github.com/intracom-telecom-sdn/mtcbench/issues/10
56 mtcbench/build_mtcbench.sh || true
57 cd mtcbench/oflops/cbench
58 make
59 cp cbench /usr/local/bin/
60
61 echo '---> Installing exabgp'
62 apt-get install exabgp
63
64 # Install vlan for vlan based tests in VTN suites
65 apt-get install vlan
66
67 # Install netaddr package which is needed by some custom mininet topologies
68 apt-get install python-netaddr
69
70 # Check out quagga , compile and install for router functionalities
71 echo "Installing the Quagga..."
72 mkdir -p /tmp/build_quagga
73 cd /tmp/build_quagga
74 git clone https://github.com/6WIND/zrpcd.git
75 cd zrpcd
76 git checkout 20170731
77 chmod a+x /tmp/build_quagga/zrpcd/pkgsrc/dev_compile_script.sh
78 /tmp/build_quagga/zrpcd/pkgsrc/dev_compile_script.sh -d -b -t
79
80 # Removing the build_quagga folder
81 rm -rf /tmp/build_quagga/