blob: 30b5a6b39ebb446c52f9bdc1dcd8bf06a9597e9a [file] [log] [blame]
Chetan Gaonkercc19ac42016-05-04 17:21:50 -07001#!/usr/bin/env bash
2apt-get update
A R Karthickd49ca4b2016-07-27 11:52:50 -07003on_cord=0
A R Karthickbd82f362016-11-10 15:08:52 -08004release=$(lsb_release -cs)
A R Karthickd49ca4b2016-07-27 11:52:50 -07005if [ "$1" = "--cord" ]; then
6 echo "Skipping installation of Docker and ONOS"
7 on_cord=1
Chetan Gaonkercc19ac42016-05-04 17:21:50 -07008fi
A R Karthickd49ca4b2016-07-27 11:52:50 -07009if [ $on_cord -eq 0 ]; then
10 apt-get -y install apt-transport-https ca-certificates
11 apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
12 if [ ! -f /etc/apt/sources.list.d/docker.list ]; then
A R Karthickbd82f362016-11-10 15:08:52 -080013 echo deb https://apt.dockerproject.org/repo ubuntu-$release main | tee /etc/apt/sources.list.d/docker.list
A R Karthickd49ca4b2016-07-27 11:52:50 -070014 fi
15 apt-get update
16 apt-get purge lxc-docker || true
17 apt-get -y install linux-image-extra-$(uname -r)
18 apt-get -y install apparmor
19 echo "Installing Docker"
20 apt-get -y install docker-engine
21 service docker start
22 echo "Verifying Docker installation"
23 docker run --rm hello-world || exit 127
24 docker rmi hello-world
A R Karthickb05acab2016-11-10 15:12:43 -080025 echo "Pulling ONOS latest"
A R Karthickd49ca4b2016-07-27 11:52:50 -070026 docker pull onosproject/onos:latest || exit 127
A R Karthickd49ca4b2016-07-27 11:52:50 -070027 apt-get -y install openvswitch-common openvswitch-switch
28fi
A R Karthickc1dc1d72016-10-27 15:35:19 -070029apt-get -y install wget git python python-dev python-pip python-setuptools python-scapy python-pexpect python-maas-client tcpdump arping libssl-dev
Chetan Gaonkercc19ac42016-05-04 17:21:50 -070030easy_install nose
A R Karthickc1dc1d72016-10-27 15:35:19 -070031pip install scapy==2.3.2
Chetan Gaonkercc19ac42016-05-04 17:21:50 -070032pip install monotonic
33pip install configObj
A.R Karthicke4631062016-11-03 14:28:19 -070034pip install docker-py==1.9.0
Chetan Gaonkercc19ac42016-05-04 17:21:50 -070035pip install -U pyyaml
36pip install -U nsenter
37pip install -U pyroute2
38pip install -U netaddr
A R Karthickea9abc82016-06-17 14:55:19 -070039pip install -U python-daemon
A R Karthickc1dc1d72016-10-27 15:35:19 -070040pip install scapy-ssl_tls==1.2.2
A R Karthick5f4f3be2016-10-21 09:21:51 -070041pip install -U robotframework
42pip install -U robotframework-requests
43pip install -U robotframework-sshlibrary
A R Karthick19aaf5c2016-11-09 17:47:57 -080044pip install paramiko==1.10.1
Chetan Gaonker66bff932016-05-09 10:06:37 -070045( cd /tmp && git clone https://github.com/jpetazzo/pipework.git && cp -v pipework/pipework /usr/bin && rm -rf pipework )
Chetan Gaonkercc19ac42016-05-04 17:21:50 -070046## Special mode to pull cord-tester repo in case prereqs was installed by hand instead of repo
A R Karthickd49ca4b2016-07-27 11:52:50 -070047if [ "$1" = "--test" ]; then
Chetan Gaonkercc19ac42016-05-04 17:21:50 -070048 rm -rf cord-tester
A R Karthickd49ca4b2016-07-27 11:52:50 -070049 git clone https://github.com/opencord/cord-tester.git
Chetan Gaonker66bff932016-05-09 10:06:37 -070050fi