bugfix on perftest 51/23651/3
authorwu.zhihui <wu.zhihui1@zte.com.cn>
Tue, 25 Oct 2016 06:27:09 +0000 (14:27 +0800)
committerwu.zhihui <wu.zhihui1@zte.com.cn>
Tue, 25 Oct 2016 09:15:27 +0000 (17:15 +0800)
1. Correct path of common directory
2. cleanup the directories qtip creates on host
3. typo
4. use module file instead of shell command to create/cleanup
directory

Change-Id: I85960998c15d2a1934e8ae5047b71fc91c936a46
Signed-off-by: wu.zhihui <wu.zhihui1@zte.com.cn>
benchmarks/perftest/dhrystone.yaml
benchmarks/perftest/dpi.yaml
benchmarks/perftest/fio.yaml
benchmarks/perftest/iperf.yaml
benchmarks/perftest/ramspeed.yaml
benchmarks/perftest/ssl.yaml
benchmarks/perftest/whetstone.yaml

index 5f83bbb..7899bbd 100644 (file)
       register: home_dir
 
     - name: cleaning tempT
-      shell: sudo rm -rf $HOME/tempT
+      file: path=$HOME/tempT state=absent
 
     - name: cleaning qtip_result
-      shell: sudo rm -rf $HOME/qtip_result
+      file: path=$HOME/qtip_result state=absent
 
     - name: make directory
-      shell: sudo mkdir $HOME/qtip_result
+      file: path=$HOME/qtip_result state=directory
 
-    - include: ../common/sys_proxy_pbook.yaml
+    - include: ./common/sys_proxy_pbook.yaml
 
-    - include: ../common/sys_info_pbook.yaml
+    - include: ./common/sys_info_pbook.yaml
       vars:
           network: false
 
     - name: Installing UnixBench dependencies if CentOS
-      shell: sudo yum install git gcc  patch perl-Time-HiRes -y
+      shell: yum install git gcc  patch perl-Time-HiRes -y
       when: ansible_os_family == "RedHat"
 
     - name: Installing UnixBench dependencies if Ubuntu
-      shell: sudo apt-get install git gcc  patch perl -y
+      shell: apt-get install git gcc  patch perl -y
       when: ansible_os_family == "Debian"
 
-    - include: ../common/git_proxy_pbook.yaml
+    - include: ./common/git_proxy_pbook.yaml
 
     - name: Clone unixbench
       git: repo=https://github.com/kdlucas/byte-unixbench.git
       with_items: "{{copy_log_results.stdout_lines}}"
 
     - name: cleaning tempT
-      shell: sudo rm -rf $HOME/tempT
+      file: path=$HOME/tempT state=absent
 
     - name: cleaning_qtip_result
-      shell: sudo rm -rf $HOME/qtip_result
-
+      file: path=$HOME/qtip_result state=absent
 
  - hosts: localhost
    connection: local
       shell: ( find  {{workingdir}}/{{Dest_dir}}/dhrystone/dhrystone_temp/ -name "*.json" | xargs cp -t {{workingdir}}/{{Dest_dir}}/dhrystone/)
 
     - name: making_logs_folder
-      shell: mkdir -p {{workingdir}}/{{Dest_dir}}/dhrystone/logs
+      file: path={{workingdir}}/{{Dest_dir}}/dhrystone/logs state=directory
 
     - name: extracting_log
       shell: ( find {{workingdir}}/{{Dest_dir}}/dhrystone/dhrystone_temp/ -name "*.log"  | xargs cp -t {{workingdir}}/{{Dest_dir}}/dhrystone/logs)
 
     - name: removing dhrystone_temp
-      shell: rm -rf {{workingdir}}/{{Dest_dir}}/dhrystone/dhrystone_temp
+      file: path={{workingdir}}/{{Dest_dir}}/dhrystone/dhrystone_temp state=directory
index 59d01d5..5ce5d09 100644 (file)
       register: home_dir
 
     - name: cleaning
-      shell: sudo rm -rf $HOME/tempD
+      file: path=$HOME/tempD state=absent
 
     - name: cleaning previous results
-      shell: sudo rm -rf $HOME/qtip_result
+      file: path=$HOME/qtip_result state=absent
 
     - name: make qtip_result
-      shell: sudo mkdir $HOME/qtip_result
+      file: path=$HOME/qtip_result state=directory
 
-    - include: ../common/sys_proxy_pbook.yaml
+    - include: ./common/sys_proxy_pbook.yaml
 
-    - include: ../common/sys_info_pbook.yaml
+    - include: ./common/sys_info_pbook.yaml
       vars:
           network: false
 
@@ -45,9 +45,9 @@
       when: ansible_os_family == "Debian"
 
     - name: making  nDPI temporary directory
-      shell: sudo mkdir $HOME/tempD
+      file: path=$HOME/tempD state=directory
 
-    - include: ../common/git_proxy_pbook.yaml
+    - include: ./common/git_proxy_pbook.yaml
 
     - name: Clone nDPI
       git: repo=https://github.com/ntop/nDPI.git
@@ -66,7 +66,7 @@
       shell: cd $HOME/tempD/nDPI/example  &&  wget http://build.opnfv.org/artifacts.opnfv.org/qtip/utilities/test.pcap
 
     - name: fetch Averaging script
-      copy: src=../etc/dpi_average.sh dest={{home_dir.stdout}}/tempD/nDPI/example mode=777
+      copy: src=./etc/dpi_average.sh dest={{home_dir.stdout}}/tempD/nDPI/example mode=777
 
     - name: Run nDPI benchmark
       shell: cd $HOME/tempD/nDPI/example && sudo ./dpi_average.sh
       fetch:  src={{home_dir.stdout}}/qtip_result/{{item}} dest={{workingdir}}/{{Dest_dir}}/dpi/dpi_temp
       with_items: "{{copy_log_results.stdout_lines}}"
 
+    - name: cleaning tempD
+      file: path=$HOME/tempD state=absent
+
+    - name: cleaning_qtip_result
+      file: path=$HOME/qtip_result state=absent
+
  - hosts: localhost
    connection: local
    gather_facts: no
       shell: ( find  {{workingdir}}/{{Dest_dir}}/dpi/dpi_temp/ -name "*.json" | xargs cp -t {{workingdir}}/{{Dest_dir}}/dpi/)
 
     - name: making_logs_folder
-      shell: mkdir -p {{workingdir}}/{{Dest_dir}}/dpi/logs
+      file: path={{workingdir}}/{{Dest_dir}}/dpi/logs state=directory
 
     - name: extracting_log
       shell: ( find {{workingdir}}/{{Dest_dir}}/dpi/dpi_temp/ -name "*.log"  | xargs cp -t {{workingdir}}/{{Dest_dir}}/dpi/logs)
 
     - name: removing dpi_temp
-      shell: rm -rf {{workingdir}}/{{Dest_dir}}/dpi/dpi_temp
+      file: path={{workingdir}}/{{Dest_dir}}/dpi/dpi_temp state=absent
index bd29c12..94a4c80 100644 (file)
       shell: echo $HOME
       register: home_dir
 
-    - name: cleaning
-      shell: sudo rm -rf $HOME/fio
+    - name: cleaning fio directory
+      file: path=$HOME/fio state=absent
 
     - name: cleaning previous results
-      shell: sudo rm -rf $HOME/qtip_result
+      file: path=$HOME/qtip_result state=absent
 
     - name: making fio temporary directory
-      shell: sudo mkdir $HOME/fio
+      file: path=$HOME/fio state=directory
 
     - name: making  results temporary directory
-      shell: sudo mkdir $HOME/qtip_result
+      file: path=$HOME/qtip_result state=directory
 
-    - include: ../common/sys_proxy_pbook.yaml
+    - include: ./common/sys_proxy_pbook.yaml
 
-    - include: ../common/sys_info_pbook.yaml
+    - include: ./common/sys_info_pbook.yaml
       vars:
           network: false
 
 
     - name: Fetching fio
       shell: cd $HOME/fio/ && wget http://freecode.com/urls/3aa21b8c106cab742bf1f20d60629e3f -O fio.tar.gz
+
     - name: Untar fio
       shell: cd $HOME/fio/ && sudo tar -zxvf fio.tar.gz
+
     - name: configure
       shell: cd $HOME/fio/fio-2.1.10  && sudo ./configure && sudo make
 
     - name: Fetching fio job
-      copy: src=../etc/fio_test_job  dest={{home_dir.stdout}}/fio/fio-2.1.10/
+      copy: src=./etc/fio_test_job  dest={{home_dir.stdout}}/fio/fio-2.1.10/
 
     - name: Benchmarking block storage through fio
       shell: cd $HOME/fio/fio-2.1.10  &&  sudo ./fio --output-format=json --output=$HOME/qtip_result/fio_result.json fio_test_job
       fetch:  src={{home_dir.stdout}}/qtip_result/{{item}} dest={{workingdir}}/{{Dest_dir}}/fio/fio_temp
       with_items: "{{copy_log_results.stdout_lines}}"
 
+    - name: cleaning fio
+      file: path=$HOME/fio state=absent
+
+    - name: cleaning_qtip_result
+      file: path=$HOME/qtip_result
+
  - hosts: localhost
    connection: local
    gather_facts: no
       shell: ( find  {{workingdir}}/{{Dest_dir}}/fio/fio_temp/ -name "*.json" | xargs cp -t {{workingdir}}/{{Dest_dir}}/fio/)
 
     - name: making_logs_folder
-      shell: mkdir -p {{workingdir}}/{{Dest_dir}}/fio/logs
+      file: path={{workingdir}}/{{Dest_dir}}/fio/logs state=directory
 
     - name: extracting_log
       shell: ( find {{workingdir}}/{{Dest_dir}}/fio/fio_temp/ -name "*.log"  | xargs cp -t {{workingdir}}/{{Dest_dir}}/fio/logs)
 
     - name: removing fio_log
-      shell: rm -rf {{workingdir}}/{{Dest_dir}}/fio/fio_temp
-
+      file: {{workingdir}}/{{Dest_dir}}/fio/fio_temp state=absent
index af5b836..481a2e3 100644 (file)
       shell: echo $HOME
       register: home_dir
 
-    - name: cleaning
-      shell: sudo rm -rf $HOME/iperf
+    - name: cleaning iperf directory
+      file: path=$HOME/iperf state=absent
 
     - name: cleaning previous results
-      shell: sudo rm -rf $HOME/qtip_result
+      file: path=$HOME/qtip_result state=absent
 
     - name: making Iperf temporary directory
-      shell: sudo mkdir $HOME/iperf
+      file: path=$HOME/iperf state=directory
 
     - name: making results temporary directory
-      shell: sudo mkdir $HOME/qtip_result
+      file: path=$HOME/qtip_result state=directory
 
-    - include: ../common/sys_proxy_pbook.yaml
+    - include: ./common/sys_proxy_pbook.yaml
 
-    - include: ../common/sys_info_pbook.yaml
+    - include: ./common/sys_info_pbook.yaml
       vars:
         network: true
 
       with_items: "{{copy_log_results.stdout_lines}}"
       when: rolename =="2-host" and "{{ip2}}" == ''
 
+    - name: cleaning iperf directory
+      file: path=$HOME/iperf state=absent
+
+    - name: cleaning previous results
+      file: path=$HOME/qtip_result state=absent
 
  - hosts: localhost
    connection: local
       when: rolename == "2-host"
 
     - name: making_logs_folder
-      shell: mkdir -p {{workingdir}}/{{Dest_dir}}/iperf/logs
+      file: path={{workingdir}}/{{Dest_dir}}/iperf/logs state=directory
 
     - name: extracting_log
       shell: ( find {{workingdir}}/{{Dest_dir}}/iperf/iperf_temp/ -name "*.log"  | xargs cp -t {{workingdir}}/{{Dest_dir}}/iperf/logs)
       when: rolename == "2-host"
 
     - name: removing iperf_raw file
-      shell: rm -rf {{workingdir}}/{{Dest_dir}}/iperf/iperf_raw.json
+      file: path={{workingdir}}/{{Dest_dir}}/iperf/iperf_raw.json state=absent
       when: rolename == "2-host"
 
     - name: removing iperf_temp
-      shell: rm -rf {{workingdir}}/{{Dest_dir}}/iperf/iperf_temp
+      file: path={{workingdir}}/{{Dest_dir}}/iperf/iperf_temp state=absent
index f62c605..fb624c8 100644 (file)
       shell: echo $HOME
       register: home_dir
 
-    - name: cleaning
-      shell: sudo rm -rf $HOME/ramspeed
+    - name: cleaning ramspeed directory
+      file: path=$HOME/ramspeed state=absent
 
     - name: cleaning previous results
-      shell: sudo rm -rf $HOME/qtip_result
+      file: path=$HOME/qtip_result state=absent
 
     - name: making ramspeed temporary directory
-      shell: sudo mkdir $HOME/ramspeed
+      file: path=$HOME/ramspeed state=directory
 
     - name: making  results temporary directory
-      shell: sudo mkdir $HOME/qtip_result
+      file: path=$HOME/qtip_result state=directory
 
-    - include: ../common/sys_proxy_pbook.yaml
+    - include: ./common/sys_proxy_pbook.yaml
 
     - include: ./common/sys_info_pbook.yaml
       vars:
@@ -67,7 +67,7 @@
       copy: src={{workdingdir}}/utils/transform/ramspeed_transform.py dest={{home_dir.stdout}}/qtip_result
 
     - name: Transforming result
-      shell: cd $HOME/qtip_result  &&  sudo python ramspd_transform.py
+      shell: cd $HOME/qtip_result  &&  sudo python ramspeed_transform.py
 
     - name: copy report formation script
       copy: src={{workingdir}}/utils/transform/final_report.py dest={{home_dir.stdout}}/qtip_result
       fetch:  src={{home_dir.stdout}}/qtip_result/{{item}} dest={{workingdir}}/{{Dest_dir}}/ramspeed/ramspeed_temp
       with_items: "{{copy_log_results.stdout_lines}}"
 
+    - name: cleaning ramspeed directory
+      file: path=$HOME/ramspeed state=absent
+
+    - name: cleaning previous results
+      file: path=$HOME/qtip_result state=absent
+
  - hosts: localhost
    connection: local
    gather_facts: no
       shell: ( find  {{workingdir}}/{{Dest_dir}}/ramspeed/ramspeed_temp/ -name "*.json" | xargs cp -t {{workingdir}}/{{Dest_dir}}/ramspeed/)
 
     - name: making_logs_folder
-      shell: mkdir -p {{workingdir}}/{{Dest_dir}}/ramspeed/logs
+      file: path={{workingdir}}/{{Dest_dir}}/ramspeed/logs state=directory
 
     - name: extracting_log
       shell: ( find {{workingdir}}/{{Dest_dir}}/ramspeed/ramspeed_temp/ -name "*.log"  | xargs cp -t {{workingdir}}/{{Dest_dir}}/ramspeed/logs)
 
     - name: removing ramspeed_log
-      shell: rm -rf {{workingdir}}/{{Dest_dir}}/ramspeed/ramspeed_temp
+      file: path={{workingdir}}/{{Dest_dir}}/ramspeed/ramspeed_temp state=absent
index 4b5f036..ef36265 100644 (file)
       shell: sudo echo $HOME
       register: home_dir
 
-    - name: cleaning
-      shell: sudo rm -rf $HOME/Open_SSL
+    - name: cleaning Open_SSL directory
+      file: path=$HOME/Open_SSL state=absent
 
-    - name: cleaning previous results
-      shell: sudo rm -rf $HOME/qtip_result
+    - name: cleaning_qtip_result
+      file: path=$HOME/qtip_result state=absent
 
     - name: making OpenSSL temporary directory
-      shell: sudo mkdir $HOME/Open_SSL
+      file: path=$HOME/Open_SSL state=directory
 
     - name: making  results temporary directory
-      shell: sudo mkdir $HOME/qtip_result
+      file: path=$HOME/qtip_result state=directory
 
-    - include: ../common/sys_proxy_pbook.yaml
+    - include: ./common/sys_proxy_pbook.yaml
 
-    - include: ../common/sys_info_pbook.yaml
+    - include: ./common/sys_info_pbook.yaml
       vars:
           network: false
 
       shell: cd $HOME/Open_SSL/openssl-1.0.2f  && sudo ./config
 
     - name: make
-      shell: cd  $HOME/Open_SSL/openssl-1.0.2f && sudo make
+      shell: cd $HOME/Open_SSL/openssl-1.0.2f && sudo make
 
     - name: make install
-      shell: cd  $HOME/Open_SSL/openssl-1.0.2f  && sudo make install
+      shell: cd $HOME/Open_SSL/openssl-1.0.2f  && sudo make install
 
     - name: Benchmarking RSA signatures
       shell: cd $HOME/Open_SSL/openssl-1.0.2f/apps  &&  sudo ./openssl speed rsa >> $HOME/qtip_result/RSA_dump
       fetch:  src={{home_dir.stdout}}/qtip_result/{{item}} dest={{workingdir}}/{{Dest_dir}}/ssl/ssl_temp
       with_items: "{{copy_log_results.stdout_lines}}"
 
+    - name: cleaning Open_SSL directory
+      file: path=$HOME/Open_SSL state=absent
+
+    - name: cleaning_qtip_result
+      file: path=$HOME/qtip_result state=absent
+
  - hosts: localhost
    connection: local
    gather_facts: no
       shell: ( find {{workingdir}}/{{Dest_dir}}/ssl/ssl_temp/ -name "*.json" | xargs cp -t {{workingdir}}/{{Dest_dir}}/ssl/)
 
     - name: making_logs_folder
-      shell: mkdir -p {{workingdir}}/{{Dest_dir}}/ssl/logs
+      file: path={{workingdir}}/{{Dest_dir}}/ssl/logs state=directory
 
     - name: extracting_log
       shell: ( find {{workingdir}}/{{Dest_dir}}/ssl/ssl_temp/ -name "*.log"  | xargs cp -t {{workingdir}}/{{Dest_dir}}/ssl/logs)
 
     - name: removing ssl_temp
-      shell: rm -rf {{workingdir}}/{{Dest_dir}}/ssl/ssl_temp
+      file: path={{workingdir}}/{{Dest_dir}}/ssl/ssl_temp state=absent
index 32a22fe..4dcddb9 100644 (file)
       shell: echo $HOME
       register: home_dir
 
-    - name: cleaning tempT
-      shell: sudo rm -rf $HOME/tempT
+    - name: cleaning tempT directory
+      file: path=$HOME/tempT state=absent
 
-    - name: cleaning_qtip_result
-      shell: sudo rm -rf $HOME/qtip_result
+    - name: cleaning qtip result directory
+      file: path=$HOME/qtip_result state=absent
 
-    - name: make directory
-      shell: sudo mkdir $HOME/qtip_result
+    - name: making qtip_result directory
+      file: path=$HOME/qtip_result state=directory
 
-    - include: ../common/sys_proxy_pbook.yaml
+    - include: ./common/sys_proxy_pbook.yaml
 
-    - include: ../common/sys_info_pbook.yaml
+    - include: ./common/sys_info_pbook.yaml
       vars:
           network: false
 
@@ -41,7 +41,7 @@
       shell: sudo apt-get install git gcc  patch perl -y
       when: ansible_os_family == "Debian"
 
-    - include: ./git_proxy_pbook.yaml
+    - include: ./common/git_proxy_pbook.yaml
 
     - name: Clone unixbench
       git: repo=https://github.com/kdlucas/byte-unixbench.git
       fetch:  src={{home_dir.stdout}}/qtip_result/log/{{item}} dest={{workingdir}}/{{Dest_dir}}/whetstone/whetstone_temp
       with_items: "{{copy_log_results.stdout_lines}}"
 
-    - name: cleaning tempT
-      shell: sudo rm -rf $HOME/tempT
+    - name: cleaning tempT directory
+      file: path=$HOME/tempT state=absent
 
-    - name: cleaning_qtip_result
-      shell: sudo rm -rf $HOME/qtip_result
+    - name: cleaning qtip result directory
+      file: path=$HOME/qtip_result state=absent
 
  - hosts: localhost
    connection: local
       shell: ( find  {{workingdir}}/{{Dest_dir}}/whetstone/whetstone_temp/ -name "*.json" | xargs cp -t {{workingdir}}/{{Dest_dir}}/whetstone/)
 
     - name: making_logs_folder
-      shell: mkdir -p {{workingdir}}/{{Dest_dir}}/whetstone/logs
+      file: path={{workingdir}}/{{Dest_dir}}/whetstone/logs state=directory
 
     - name: extracting_log
       shell: ( find {{workingdir}}/{{Dest_dir}}/whetstone/whetstone_temp/ -name "*.log"  | xargs cp -t {{workingdir}}/{{Dest_dir}}/whetstone/logs)
 
     - name: removing whetstone_temp
-      shell: rm -rf {{workingdir}}/{{Dest_dir}}/whetstone/whetstone_temp
+      file: {{workingdir}}/{{Dest_dir}}/whetstone/whetstone_temp state=absent