-
Notifications
You must be signed in to change notification settings - Fork 0
/
iperf_test.yml
40 lines (35 loc) · 1.15 KB
/
iperf_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
- name: Run the bandwidth tests
hosts: test_host
gather_facts: no
roles:
- ansible-nfvis
vars:
time: 60
tags:
- perf
tasks:
- name: Run bandwidth test to control host
command: iperf3 -c {{ hostvars['control'].interfaces.ens4.ip.primary | ipaddr('address') }} -t {{ time }} -J
register: iperf_command
- set_fact:
iperf_data: "{{ iperf_command.stdout | from_json }}"
- debug:
msg: "Sent: {{ iperf_data.end.sum_sent.bits_per_second|int }}bps, Received: {{ iperf_data.end.sum_received.bits_per_second|int }}bps"
- name: Get NFVIS facts
nfvis_facts:
host: "{{ hostvars['dut'].ansible_host }}"
user: "{{ nfvis_user }}"
password: "{{ nfvis_password }}"
register: nfvis_facts
delegate_to: localhost
- name: Create report
set_fact:
test_report:
nfvis_facts: "{{ nfvis_facts }}"
iperf_data: "{{ iperf_data }}"
- name: Write out report
copy:
dest: "{{ nfvis_facts['platform-detail']['hardware_info']['PID'] }}_snake_results.json"
content: "{{ test_report | to_nice_json }}"
delegate_to: localhost