Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 1 | --- |
Matteo Scandolo | 48d3d2d | 2017-08-08 13:05:27 -0700 | [diff] [blame] | 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
A R Karthick | 6d98a59 | 2016-08-24 15:16:46 -0700 | [diff] [blame] | 16 | - name: Install Cord tester prerequisites |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 17 | become: true |
| 18 | apt: name={{ item }} state=latest force=true |
A R Karthick | 6d98a59 | 2016-08-24 15:16:46 -0700 | [diff] [blame] | 19 | with_items: |
| 20 | - wget |
| 21 | - python |
| 22 | - python-dev |
| 23 | - python-pip |
| 24 | - python-setuptools |
| 25 | - python-scapy |
| 26 | - python-pexpect |
| 27 | - openvswitch-switch |
A R Karthick | c1dde15 | 2016-12-14 11:30:44 -0800 | [diff] [blame] | 28 | - libssl-dev |
| 29 | - libffi-dev |
A R Karthick | 6d98a59 | 2016-08-24 15:16:46 -0700 | [diff] [blame] | 30 | |
| 31 | - name: Install Python Prerequisites for cord tester |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 32 | become: true |
A R Karthick | 6d98a59 | 2016-08-24 15:16:46 -0700 | [diff] [blame] | 33 | pip: name={{ item }} state=latest |
| 34 | with_items: |
| 35 | - nose |
A R Karthick | 6d98a59 | 2016-08-24 15:16:46 -0700 | [diff] [blame] | 36 | - monotonic |
| 37 | - configObj |
A R Karthick | 6d98a59 | 2016-08-24 15:16:46 -0700 | [diff] [blame] | 38 | - pyyaml |
| 39 | - nsenter |
| 40 | - pyroute2 |
| 41 | - netaddr |
| 42 | - python-daemon |
A R Karthick | c1dde15 | 2016-12-14 11:30:44 -0800 | [diff] [blame] | 43 | - robotframework |
| 44 | - robotframework-requests |
| 45 | - robotframework-sshlibrary |
| 46 | |
| 47 | - name: Install scapy |
| 48 | pip: name=scapy version=2.3.2 state=present |
| 49 | |
| 50 | - name: Install scapy-ssl_tls |
| 51 | pip: name=scapy-ssl_tls version=1.2.2 state=present |
| 52 | |
| 53 | - name: Install docker-py |
| 54 | pip: name=docker-py version=1.9.0 state=present |
| 55 | |
| 56 | - name: Install paramiko |
| 57 | pip: name=paramiko version=1.10.1 state=present |
| 58 | |
| 59 | - name: Download Openvswitch {{ openvswitch_version }} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 60 | become: true |
A R Karthick | c1dde15 | 2016-12-14 11:30:44 -0800 | [diff] [blame] | 61 | get_url: |
| 62 | url: "{{ openvswitch_url }}/openvswitch-{{ openvswitch_version }}.tar.gz" |
| 63 | dest: "/home/{{ ansible_user }}/openvswitch-{{ openvswitch_version }}.tar.gz" |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 64 | force: true |
A R Karthick | c1dde15 | 2016-12-14 11:30:44 -0800 | [diff] [blame] | 65 | |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 66 | - name: Untar Openvswitch {{ openvswitch_version }} |
| 67 | become: true |
A R Karthick | c1dde15 | 2016-12-14 11:30:44 -0800 | [diff] [blame] | 68 | unarchive: |
| 69 | src=openvswitch-{{ openvswitch_version }}.tar.gz |
| 70 | dest=/home/{{ ansible_user }} |
| 71 | |
| 72 | - name: Build Openvswitch {{ openvswitch_version }} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 73 | become: true |
A R Karthick | c1dde15 | 2016-12-14 11:30:44 -0800 | [diff] [blame] | 74 | shell: "{{ item }}" |
| 75 | args: |
| 76 | chdir: "/home/{{ ansible_user }}/openvswitch-{{ openvswitch_version }}" |
| 77 | with_items: |
| 78 | - ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-ssl |
| 79 | - make |
| 80 | - make install |
| 81 | |
| 82 | - name: Remove build files for Openvswitch {{ openvswitch_version }} |
| 83 | file: |
| 84 | path=/home/{{ ansible_user }}/{{ item }} |
| 85 | state=absent |
| 86 | with_items: |
| 87 | - "openvswitch-{{ openvswitch_version }}.tar.gz" |
| 88 | - "openvswitch-{{ openvswitch_version }}" |
A R Karthick | 6d98a59 | 2016-08-24 15:16:46 -0700 | [diff] [blame] | 89 | |
| 90 | - name: install Pipework |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 91 | sudo: true |
A R Karthick | 6d98a59 | 2016-08-24 15:16:46 -0700 | [diff] [blame] | 92 | get_url: |
| 93 | url: "{{ docker_tools_pipework_exe_url }}" |
| 94 | dest: "{{ docker_tools_path }}/pipework" |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 95 | force: true |
A R Karthick | 6d98a59 | 2016-08-24 15:16:46 -0700 | [diff] [blame] | 96 | mode: "a+x" |
| 97 | |
| 98 | - name: Pull cord test container |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 99 | become: true |
A R Karthick | 6d98a59 | 2016-08-24 15:16:46 -0700 | [diff] [blame] | 100 | docker: |
| 101 | name: cord-test |
A R Karthick | f7a613b | 2017-02-24 09:36:44 -0800 | [diff] [blame] | 102 | image: "{{ docker.registry }}/cordtest/nose:{{ docker.image_version }}" |
A R Karthick | 6d98a59 | 2016-08-24 15:16:46 -0700 | [diff] [blame] | 103 | pull: always |
| 104 | state: absent |
| 105 | |
| 106 | - name: Pull test radius container |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 107 | become: true |
A R Karthick | 6d98a59 | 2016-08-24 15:16:46 -0700 | [diff] [blame] | 108 | docker: |
| 109 | name: cord-radius |
A R Karthick | f7a613b | 2017-02-24 09:36:44 -0800 | [diff] [blame] | 110 | image: "{{ docker.registry }}/cordtest/radius:{{ docker.image_version }}" |
A R Karthick | 6d98a59 | 2016-08-24 15:16:46 -0700 | [diff] [blame] | 111 | pull: always |
| 112 | state: absent |
| 113 | |
| 114 | - name: Pull test quagga container |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 115 | become: true |
A R Karthick | 6d98a59 | 2016-08-24 15:16:46 -0700 | [diff] [blame] | 116 | docker: |
| 117 | name: cord-quagga |
A R Karthick | f7a613b | 2017-02-24 09:36:44 -0800 | [diff] [blame] | 118 | image: "{{ docker.registry }}/cordtest/quagga:{{ docker.image_version }}" |
A R Karthick | 6d98a59 | 2016-08-24 15:16:46 -0700 | [diff] [blame] | 119 | pull: always |
| 120 | state: absent |
A R Karthick | c1dde15 | 2016-12-14 11:30:44 -0800 | [diff] [blame] | 121 | |
| 122 | - name: Pull onosproject |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 123 | become: true |
A R Karthick | c1dde15 | 2016-12-14 11:30:44 -0800 | [diff] [blame] | 124 | docker: |
| 125 | name: cord-test-onos |
| 126 | image: "{{ docker.registry }}/onosproject/onos:{{ docker.image_version }}" |
| 127 | pull: always |
| 128 | state: absent |