aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/playbooks/netperf.yaml
diff options
context:
space:
mode:
authorMofassir Arif <mofassir@gmail.com>2015-12-09 04:50:55 -0800
committerMofassir Arif <Mofassir_arif@dellteam.com>2015-12-16 01:45:38 -0800
commite51df601fe4a1bd22274e3da62659b1ed7b2c49b (patch)
tree66abbe6ea11fec7e027fab4481ae1cd9e44f054f /benchmarks/playbooks/netperf.yaml
parentae9f53f8f00342627f6d0124e53a285438c1ca4e (diff)
Networking Testcase: Iperf Implemented
The ansible playbooks as well as the config files for the iperf throughput testing have been implemented. Some changes have been made to the driver function for the benchmarks. ansible now gets passed a json file. Change-Id: Ibf4c0210ab9f6cbf9896ca69bf2fb6bda8a9925d Signed-off-by: Mofassir Arif <mofassir@gmail.com>
Diffstat (limited to 'benchmarks/playbooks/netperf.yaml')
-rw-r--r--benchmarks/playbooks/netperf.yaml74
1 files changed, 74 insertions, 0 deletions
diff --git a/benchmarks/playbooks/netperf.yaml b/benchmarks/playbooks/netperf.yaml
new file mode 100644
index 00000000..fb6fd18a
--- /dev/null
+++ b/benchmarks/playbooks/netperf.yaml
@@ -0,0 +1,74 @@
+ - hosts: 127.0.0.1
+ connection: local
+ tasks:
+
+ - name: getting directory
+ shell: echo $PWD
+ register: qtip_dir
+ - name: making Netperf directory
+ file: path=../../{{Dest_dir}}/netperf state=directory
+ - name: making temporary netperf directory
+ file: path=../../{{Dest_dir}}/netperf/netperf_temp state=directory
+
+
+ - hosts: "{{role}}"
+ tasks:
+ - name: Rolename
+ set_fact:
+ rolename: "{{role}}"
+ when: role is defined
+
+ - name: Get Hostname
+ shell: echo $HOSTNAME
+ register: hostID
+ - name: checking_home directory
+ shell: echo $HOME
+ register: home_dir
+ - name: cleaning
+ shell: rm -rf $HOME/netperf
+ - name: cleaning previous results
+ shell: rm -rf $HOME/qtip_result
+ - name: making netperf temporary directory
+ shell: mkdir $HOME/netperf
+ - name: making results temporary directory
+ shell: mkdir $HOME/qtip_result
+
+ - name: Fetching netperf
+ shell: wget ftp://ftp.netperf.org/netperf/netperf-2.7.0.tar.gz
+ when: ansible_os_family == "RedHat"
+ - name: Extracting Netperf
+ shell: tar -xvf netperf-2.7.0.tar.gz
+ - name: configuring netperf
+ shell: cd $HOME/netperf-2.7.0 && ./configure
+ - name: Making Netperf
+ shell: cd $HOME/netperf-2.7.0 && make
+ - name: Installing Netperf
+ shell: cd $HOME/netperf-2.7.0 && make install
+
+ - name: Running netperf on server
+ shell: /usr/local/bin/netserver -p 4000
+ when: rolename == "1-server"
+
+ - name: Running netperf on Host
+ shell: /usr/local/bin/netperf -H {{privateip1}} -p 4000 -l {{duration}} -t {{teststream}} -fG >> ./qtip_result/server{{hostID.stdout}}-{{item}}.json
+ ignore_errors: yes
+ with_items:
+ - "{{ip1}}"
+ when: rolename == "2-host" and "{{ip2}}" == ''
+
+ - name: Files to Copy
+ shell: (cd $HOME/qtip_result/; find . -maxdepth 1 -name "*.json") | cut -d'/' -f2
+ register: files_to_copy
+ - name: copy results
+ fetch: src={{home_dir.stdout}}/qtip_result/{{item}} dest=../../{{Dest_dir}}/netperf/netperf_temp
+ with_items: files_to_copy.stdout_lines
+ - hosts: 127.0.0.1
+ connection: local
+ tasks:
+ - name: Rolename
+ set_fact:
+ rolename: "{{role}}"
+ when: role is defined
+ - name: extracting_json
+ shell: ( find ../../{{Dest_dir}}/netperf/netperf_temp/ -name "*.json" | xargs cp -t ../../{{Dest_dir}}/netperf/)
+ when: rolename == "2-host" \ No newline at end of file