aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/tg
diff options
context:
space:
mode:
Diffstat (limited to 'resources/tools/testbed-setup/ansible/roles/tg')
-rw-r--r--resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml5
-rw-r--r--resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml40
-rw-r--r--resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml1
-rw-r--r--resources/tools/testbed-setup/ansible/roles/tg/tasks/wrk.yaml12
4 files changed, 56 insertions, 2 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml
index 24f433f9b9..0b32002545 100644
--- a/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml
@@ -3,7 +3,12 @@
- name: Install distribution - release - machine prerequisites
include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml'
+ tags: install-csit-dependencies
- name: Install WRK
include_tasks: 'wrk.yaml'
tags: install-wrk
+
+- name: Install TRex
+ include_tasks: 'trex.yaml'
+ tags: install-trex
diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml
new file mode 100644
index 0000000000..3cfcbea825
--- /dev/null
+++ b/resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml
@@ -0,0 +1,40 @@
+---
+# file: roles/tg/tasks/trex.yaml
+
+- name: Download TRex release archive
+ get_url:
+ url: '{{ trex.url }}/v{{ trex.version }}.tar.gz'
+ dest: '{{ trex.target_dir }}/trex-core-{{ trex.version }}.tar.gz'
+ mode: 0644
+ register: 'linux__trex_downloaded'
+ tags: install-trex
+
+- name: Ensure TRex directory exists
+ file:
+ path: '{{ trex.target_dir }}/trex-core-{{ trex.version }}'
+ state: 'directory'
+ register: 'linux__trex_dir_created'
+ tags: install-trex
+
+- name: Extract TRex release archive
+ become: yes
+ unarchive:
+ src: '{{ trex.target_dir }}/trex-core-{{ trex.version }}.tar.gz'
+ dest: '{{ trex.target_dir }}/'
+ creates: '{{ trex.target_dir }}/trex-core-{{ trex.version }}/linux_dpdk'
+ remote_src: yes
+ when: 'linux__trex_dir_created'
+ register: 'linux__trex_extracted'
+ tags: install-trex
+
+- name: Compile TRex release I
+ become: yes
+ shell: 'cd {{ trex.target_dir }}/trex-core-{{ trex.version }}/linux_dpdk/; ./b configure; ./b build'
+ when: 'linux__trex_extracted'
+ tags: install-trex
+
+- name: Compile TRex release II
+ become: yes
+ shell: 'cd {{ trex.target_dir }}/trex-core-{{ trex.version }}/scripts/ko/src; make; make install'
+ when: 'linux__trex_extracted'
+ tags: install-trex
diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml
index 95a47b0917..d56c843158 100644
--- a/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml
@@ -5,6 +5,7 @@
apt:
name:
- 'unzip'
+ - 'zlib1g-dev'
- 'libssl-dev'
state: 'present'
install_recommends: False
diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/wrk.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/wrk.yaml
index 1da45fb4b4..e7d22e1aa1 100644
--- a/resources/tools/testbed-setup/ansible/roles/tg/tasks/wrk.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/tg/tasks/wrk.yaml
@@ -9,13 +9,21 @@
register: 'linux__wrk_downloaded'
tags: install-wrk
+- name: Ensure WRK directory exists
+ file:
+ path: '{{ wrk.target_dir }}/wrk-{{ wrk.version }}'
+ state: 'directory'
+ register: 'linux__wrk_dir_created'
+ tags: install-wrk
+
- name: Extract WRK release archive
become: yes
unarchive:
src: '{{ wrk.target_dir }}/{{ wrk.version }}.tar.gz'
- dest: '{{ wrk.target_dir }}/wrk-{{ wrk.version }}'
+ dest: '{{ wrk.target_dir }}/'
+ creates: '{{ wrk.target_dir }}/wrk-{{ wrk.version }}/src'
remote_src: yes
- when: 'linux__wrk_downloaded'
+ when: 'linux__wrk_dir_created'
register: 'linux__wrk_extracted'
tags: install-wrk