Chetan Gaonker | cc19ac4 | 2016-05-04 17:21:50 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | apt-get update |
A R Karthick | d49ca4b | 2016-07-27 11:52:50 -0700 | [diff] [blame] | 3 | on_cord=0 |
| 4 | if [ "$1" = "--cord" ]; then |
| 5 | echo "Skipping installation of Docker and ONOS" |
| 6 | on_cord=1 |
Chetan Gaonker | cc19ac4 | 2016-05-04 17:21:50 -0700 | [diff] [blame] | 7 | fi |
A R Karthick | d49ca4b | 2016-07-27 11:52:50 -0700 | [diff] [blame] | 8 | if [ $on_cord -eq 0 ]; then |
| 9 | apt-get -y install apt-transport-https ca-certificates |
| 10 | apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D |
| 11 | if [ ! -f /etc/apt/sources.list.d/docker.list ]; then |
| 12 | echo deb https://apt.dockerproject.org/repo ubuntu-trusty main | tee /etc/apt/sources.list.d/docker.list |
| 13 | fi |
| 14 | apt-get update |
| 15 | apt-get purge lxc-docker || true |
| 16 | apt-get -y install linux-image-extra-$(uname -r) |
| 17 | apt-get -y install apparmor |
| 18 | echo "Installing Docker" |
| 19 | apt-get -y install docker-engine |
| 20 | service docker start |
| 21 | echo "Verifying Docker installation" |
| 22 | docker run --rm hello-world || exit 127 |
| 23 | docker rmi hello-world |
| 24 | echo "Pulling ONOS latest and 1.5" |
| 25 | docker pull onosproject/onos:latest || exit 127 |
| 26 | docker pull onosproject/onos:1.5 || exit 127 |
| 27 | apt-get -y install openvswitch-common openvswitch-switch |
| 28 | fi |
A R Karthick | c1dc1d7 | 2016-10-27 15:35:19 -0700 | [diff] [blame] | 29 | apt-get -y install wget git python python-dev python-pip python-setuptools python-scapy python-pexpect python-maas-client tcpdump arping libssl-dev |
Chetan Gaonker | cc19ac4 | 2016-05-04 17:21:50 -0700 | [diff] [blame] | 30 | easy_install nose |
A R Karthick | c1dc1d7 | 2016-10-27 15:35:19 -0700 | [diff] [blame] | 31 | pip install scapy==2.3.2 |
Chetan Gaonker | cc19ac4 | 2016-05-04 17:21:50 -0700 | [diff] [blame] | 32 | pip install monotonic |
| 33 | pip install configObj |
A.R Karthick | e463106 | 2016-11-03 14:28:19 -0700 | [diff] [blame] | 34 | pip install docker-py==1.9.0 |
Chetan Gaonker | cc19ac4 | 2016-05-04 17:21:50 -0700 | [diff] [blame] | 35 | pip install -U pyyaml |
| 36 | pip install -U nsenter |
| 37 | pip install -U pyroute2 |
| 38 | pip install -U netaddr |
A R Karthick | ea9abc8 | 2016-06-17 14:55:19 -0700 | [diff] [blame] | 39 | pip install -U python-daemon |
A R Karthick | c1dc1d7 | 2016-10-27 15:35:19 -0700 | [diff] [blame] | 40 | pip install scapy-ssl_tls==1.2.2 |
A R Karthick | 5f4f3be | 2016-10-21 09:21:51 -0700 | [diff] [blame] | 41 | pip install -U robotframework |
| 42 | pip install -U robotframework-requests |
| 43 | pip install -U robotframework-sshlibrary |
A R Karthick | c1dc1d7 | 2016-10-27 15:35:19 -0700 | [diff] [blame] | 44 | pip install paramiko |
Chetan Gaonker | 66bff93 | 2016-05-09 10:06:37 -0700 | [diff] [blame] | 45 | ( cd /tmp && git clone https://github.com/jpetazzo/pipework.git && cp -v pipework/pipework /usr/bin && rm -rf pipework ) |
Chetan Gaonker | cc19ac4 | 2016-05-04 17:21:50 -0700 | [diff] [blame] | 46 | ## Special mode to pull cord-tester repo in case prereqs was installed by hand instead of repo |
A R Karthick | d49ca4b | 2016-07-27 11:52:50 -0700 | [diff] [blame] | 47 | if [ "$1" = "--test" ]; then |
Chetan Gaonker | cc19ac4 | 2016-05-04 17:21:50 -0700 | [diff] [blame] | 48 | rm -rf cord-tester |
A R Karthick | d49ca4b | 2016-07-27 11:52:50 -0700 | [diff] [blame] | 49 | git clone https://github.com/opencord/cord-tester.git |
Chetan Gaonker | 66bff93 | 2016-05-09 10:06:37 -0700 | [diff] [blame] | 50 | fi |