aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--legacy/assets/perftest/dhrystone.yaml119
-rw-r--r--legacy/assets/perftest/dpi.yaml134
-rw-r--r--legacy/assets/perftest/ramspeed.yaml123
-rw-r--r--legacy/assets/perftest/ssl.yaml127
-rw-r--r--legacy/assets/perftest/whetstone.yaml119
-rw-r--r--legacy/assets/suite/compute16
-rw-r--r--legacy/assets/suite/compute.yaml54
-rw-r--r--legacy/assets/suite/network9
-rw-r--r--legacy/assets/suite/storage8
-rw-r--r--legacy/assets/testplan/default/compute/dhrystone_bm.yaml41
-rw-r--r--legacy/assets/testplan/default/compute/dhrystone_vm.yaml53
-rw-r--r--legacy/assets/testplan/default/compute/dpi_bm.yaml42
-rw-r--r--legacy/assets/testplan/default/compute/dpi_vm.yaml43
-rw-r--r--legacy/assets/testplan/default/compute/ramspeed_bm.yaml42
-rw-r--r--legacy/assets/testplan/default/compute/ramspeed_vm.yaml53
-rw-r--r--legacy/assets/testplan/default/compute/ssl_bm.yaml39
-rw-r--r--legacy/assets/testplan/default/compute/ssl_vm.yaml44
-rw-r--r--legacy/assets/testplan/default/compute/whetstone_bm.yaml41
-rw-r--r--legacy/assets/testplan/default/compute/whetstone_vm.yaml52
-rw-r--r--legacy/data/hosts2
-rw-r--r--legacy/data/my_key.pem27
-rw-r--r--legacy/data/output/hosts3
-rw-r--r--legacy/data/schema/test_bm_schema.yaml84
-rw-r--r--legacy/data/schema/test_vm_schema.yaml88
-rw-r--r--legacy/data/test.retry1
-rw-r--r--legacy/data/test.yml12
-rw-r--r--legacy/data/testplan/bm_ping.yaml37
-rw-r--r--legacy/data/testplan/bm_with_proxy.yaml47
-rw-r--r--legacy/data/testplan/bm_without_proxy.yaml41
-rw-r--r--legacy/data/testplan/vm.yaml56
-rw-r--r--legacy/data/testplan/vm_error.yaml50
-rw-r--r--legacy/run.py18
-rwxr-xr-xlegacy/scripts/cleanup_creds.sh11
-rwxr-xr-xlegacy/scripts/get_env_info.sh37
-rw-r--r--legacy/scripts/ssh_exch.exp9
-rw-r--r--legacy/tests/ansible_api_test.py22
-rw-r--r--legacy/tests/args_handler_test.py36
-rw-r--r--legacy/tests/cli_test.py52
-rw-r--r--legacy/tests/driver_test.py103
-rw-r--r--legacy/tests/env_setup_test.py120
-rw-r--r--legacy/utils/ansible_api.py65
-rw-r--r--legacy/utils/args_handler.py73
-rw-r--r--legacy/utils/cli.py76
-rw-r--r--legacy/utils/driver.py92
-rw-r--r--legacy/utils/env_setup.py214
-rw-r--r--legacy/utils/transform/dpi_transform.py55
-rw-r--r--legacy/utils/transform/final_report.py32
-rw-r--r--legacy/utils/transform/ramspeed_transform.py49
-rw-r--r--legacy/utils/transform/ssl_transform.py62
-rw-r--r--legacy/utils/transform/ubench_transform.py40
50 files changed, 0 insertions, 2773 deletions
diff --git a/legacy/assets/perftest/dhrystone.yaml b/legacy/assets/perftest/dhrystone.yaml
deleted file mode 100644
index dd098c5e..00000000
--- a/legacy/assets/perftest/dhrystone.yaml
+++ /dev/null
@@ -1,119 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
- - hosts: localhost
- connection: local
- gather_facts: no
-
- tasks:
- - name: making dhrystone directory
- file: path={{Dest_dir}}/dhrystone state=directory
-
- - name: making temporary dhrystone directory
- file: path={{Dest_dir}}/dhrystone/dhrystone_temp state=directory
-
- - hosts: "{{role}}"
- become: yes
- remote_user: "{{username}}"
-
- tasks:
- - name: checking home directory
- shell: echo $HOME
- register: home_dir
-
- - name: cleaning tempT
- file: path={{home_dir.stdout}}/tempT state=absent
-
- - name: cleaning qtip_result
- file: path={{home_dir.stdout}}/qtip_result state=absent
-
- - name: make directory
- file: path={{home_dir.stdout}}/qtip_result state=directory
-
- - include: ./common/sys_proxy_pbook.yaml
-
- - include: ./common/sys_info_pbook.yaml
- vars:
- network: false
-
- - name: Installing UnixBench dependencies if CentOS
- shell: yum install git gcc patch perl-Time-HiRes -y
- when: ansible_os_family == "RedHat"
-
- - name: Installing UnixBench dependencies if Ubuntu
- shell: apt-get install git gcc patch perl -y
- when: ansible_os_family == "Debian"
-
- - include: ./common/git_proxy_pbook.yaml
-
- - name: Clone unixbench
- git: repo=https://github.com/kdlucas/byte-unixbench.git
- dest=$HOME/tempT
-
- - name: make
- shell: sudo make --directory $HOME/tempT/UnixBench/
-
- - name: Run dhrystone
- shell: cd $HOME/tempT/UnixBench/&& sudo ./Run -v dhrystone
-
- - name: collecting and transforming result script copy
- copy: src={{workingdir}}/qtip/utils/transform/ubench_transform.py dest={{home_dir.stdout}}/qtip_result/
-
- - name: transforming result
- shell: cd $HOME/qtip_result/ && sudo python ubench_transform.py
-
- - name: copying consolidated report script
- copy: src={{workingdir}}/utils/transform/final_report.py dest={{home_dir.stdout}}/qtip_result/
-
- - name: making consolidated report
- shell: cd $HOME/qtip_result && sudo python final_report.py Dhrystone {{fname}}
-
- - name: making directory
- file: path={{home_dir.stdout}}/qtip_result/log state=directory
-
- - name: copying result to temp directory
- shell: sudo cp -r $HOME/tempT/UnixBench/results/* $HOME/qtip_result/log/
-
- - name: registering files
- 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}}/dhrystone/dhrystone_temp
- with_items: "{{files_to_copy.stdout_lines}}"
-
- - name: registering log files
- shell: (cd $HOME/qtip_result/log/; find . -maxdepth 1 -name "*.log") | cut -d'/' -f2
- register: copy_log_results
-
- - name: copying log results
- fetch: src={{home_dir.stdout}}/qtip_result/log/{{item}} dest={{Dest_dir}}/dhrystone/dhrystone_temp
- with_items: "{{copy_log_results.stdout_lines}}"
-
- - name: cleaning tempT
- file: path={{home_dir.stdout}}/tempT state=absent
-
- - name: cleaning_qtip_result
- file: path={{home_dir.stdout}}/qtip_result state=absent
-
- - hosts: localhost
- connection: local
- gather_facts: no
-
- tasks:
- - name: extracting_json
- shell: (find {{Dest_dir}}/dhrystone/dhrystone_temp/ -name "*.json" | xargs cp -t {{Dest_dir}}/dhrystone/)
-
- - name: making_logs_folder
- file: path={{Dest_dir}}/dhrystone/logs state=directory
-
- - name: extracting_log
- shell: (find {{Dest_dir}}/dhrystone/dhrystone_temp/ -name "*.log" | xargs cp -t {{Dest_dir}}/dhrystone/logs)
-
- - name: removing dhrystone_temp
- file: path={{Dest_dir}}/dhrystone/dhrystone_temp state=directory
diff --git a/legacy/assets/perftest/dpi.yaml b/legacy/assets/perftest/dpi.yaml
deleted file mode 100644
index 55a5dcb5..00000000
--- a/legacy/assets/perftest/dpi.yaml
+++ /dev/null
@@ -1,134 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
- - hosts: localhost
- connection: local
- gather_facts: no
-
- tasks:
- - name: making dpi directory
- file: path={{Dest_dir}}/dpi state=directory
-
- - name: making temporary whetstone directory
- file: path={{Dest_dir}}/dpi/dpi_temp state=directory
-
- - hosts: "{{role}}"
- become: yes
- remote_user: "{{username}}"
-
- tasks:
- - name: echo
- shell: echo $USER
-
- - name: checking home directory
- shell: echo $HOME
- register: home_dir
-
- - name: cleaning
- file: path={{home_dir.stdout}}/tempD state=absent
-
- - name: cleaning previous results
- file: path={{home_dir.stdout}}/qtip_result state=absent
-
- - name: make qtip_result
- file: path={{home_dir.stdout}}/qtip_result state=directory
-
- - include: ./common/sys_proxy_pbook.yaml
-
- - include: ./common/sys_info_pbook.yaml
- vars:
- network: false
-
- - name: Installing nDPI dependencies if CentOS
- shell: sudo yum install git gcc patch perl-Time-HiRes autofconf automake libpcap-devel libtool -y
- when: ansible_os_family == "RedHat"
-
- - name: Installing nDPI dependcies if Ubuntu
- shell: sudo apt-get install git gcc patch autoconf automake libpcap-dev libtool -y
- when: ansible_os_family == "Debian"
-
- - name: making nDPI temporary directory
- file: path=$HOME/tempD state=directory
-
- - include: ./common/git_proxy_pbook.yaml
-
- - name: Clone nDPI
- git: repo=https://github.com/ntop/nDPI.git
- dest=$HOME/tempD/nDPI
-
- - name: autogen
- shell: cd $HOME/tempD/nDPI && sudo ./autogen.sh
-
- - name: configure
- shell: cd $HOME/tempD/nDPI && sudo ./configure
-
- - name: make
- shell: cd $HOME/tempD/nDPI && sudo make
-
- - name: Fetching Test_pcap file
- 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
-
- - name: Run nDPI benchmark
- shell: cd $HOME/tempD/nDPI/example && sudo ./dpi_average.sh
-
- - name: copy result to temp_direc
- shell: sudo cp $HOME/tempD/nDPI/example/dpi_dump.txt $HOME/qtip_result
-
- - name: fetch dpi result transform script
- copy: src={{workingdir}}/qtip/utils/transform/dpi_transform.py dest={{home_dir.stdout}}/qtip_result
-
- - name: Transforming results
- shell: cd $HOME/qtip_result && sudo python dpi_transform.py
-
- - name: copy report formation script
- copy: src={{workingdir}}/qtip/utils/transform/final_report.py dest={{home_dir.stdout}}/qtip_result
-
- - name: consolidating report
- shell: cd $HOME/qtip_result && sudo python final_report.py DPI {{fname}}
-
- - name: registering files
- 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}}/dpi/dpi_temp
- with_items: "{{files_to_copy.stdout_lines}}"
-
- - name: registering log files
- shell: (cd $HOME/qtip_result/; find . -maxdepth 1 -name "*.log") | cut -d'/' -f2
- register: copy_log_results
-
- - name: copying log results
- fetch: src={{home_dir.stdout}}/qtip_result/{{item}} dest={{Dest_dir}}/dpi/dpi_temp
- with_items: "{{copy_log_results.stdout_lines}}"
-
- - name: cleaning tempD
- file: path={{home_dir.stdout}}/tempD state=absent
-
- - name: cleaning_qtip_result
- file: path={{home_dir.stdout}}/qtip_result state=absent
-
- - hosts: localhost
- connection: local
- gather_facts: no
-
- tasks:
- - name: extracting_json
- shell: (find {{Dest_dir}}/dpi/dpi_temp/ -name "*.json" | xargs cp -t {{Dest_dir}}/dpi/)
-
- - name: making_logs_folder
- file: path={{Dest_dir}}/dpi/logs state=directory
-
- - name: extracting_log
- shell: (find {{Dest_dir}}/dpi/dpi_temp/ -name "*.log" | xargs cp -t {{Dest_dir}}/dpi/logs)
-
- - name: removing dpi_temp
- file: path={{Dest_dir}}/dpi/dpi_temp state=absent
diff --git a/legacy/assets/perftest/ramspeed.yaml b/legacy/assets/perftest/ramspeed.yaml
deleted file mode 100644
index 835d517a..00000000
--- a/legacy/assets/perftest/ramspeed.yaml
+++ /dev/null
@@ -1,123 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
- - hosts: localhost
- connection: local
- gather_facts: no
-
- tasks:
- - name: making ramspeed directory
- file: path={{Dest_dir}}/ramspeed state=directory
-
- - name: making temporary ramspeed directory
- file: path={{Dest_dir}}/ramspeed/ramspeed_temp state=directory
-
-
- - hosts: "{{role}}"
- become: yes
- remote_user: "{{username}}"
-
- tasks:
- - name: checking home directory
- shell: echo $HOME
- register: home_dir
-
- - name: cleaning ramspeed directory
- file: path={{home_dir.stdout}}/ramspeed state=absent
-
- - name: cleaning previous results
- file: path={{home_dir.stdout}}/qtip_result state=absent
-
- - name: making ramspeed temporary directory
- file: path={{home_dir.stdout}}/ramspeed state=directory
-
- - name: making results temporary directory
- file: path={{home_dir.stdout}}/qtip_result state=directory
-
- - include: ./common/sys_proxy_pbook.yaml
-
- - include: ./common/sys_info_pbook.yaml
- vars:
- network: false
-
- - name: Installing RAM_Speed dependencies when CentOS
- shell: sudo yum install wget gcc -y
- when: ansible_os_family == "RedHat"
-
- - name: Installing RAM_Speed dependencies when Ubuntu
- shell: sudo apt-get install wget gcc -y
- when: ansible_os_family == "Debian"
-
- - name: make dummy file
- shell: sudo touch $HOME/ramspeed/ramspeed.tar.gz
-
- - name: Fetching RAM_Speed
- shell: cd $HOME/ramspeed/ && sudo wget -O ramspeed.tar.gz https://docs.google.com/uc?id=0B92Bp5LZTM7gRFctalZLMktTNDQ
-
- - name: Untar RAM_SPeed
- shell: cd $HOME/ramspeed/ && sudo tar -zxvf ramspeed.tar.gz
-
- - name: configure
- shell: cd $HOME/ramspeed/ramsmp-3.5.0 && ./build.sh
-
- - name: Benchmarking IntMem Bandwidth
- shell: cd $HOME/ramspeed/ramsmp-3.5.0 && ./ramsmp -b 3 -l 5 -p 1 >> $HOME/qtip_result/Intmem
-
- - name: Benchmarking FloatMem Bandwidth
- shell: cd $HOME/ramspeed/ramsmp-3.5.0 && ./ramsmp -b 6 -l 5 -p 1 >> $HOME/qtip_result/Floatmem
-
- - name: Fetching result transformation script
- copy: src={{workingdir}}/qtip/utils/transform/ramspeed_transform.py dest={{home_dir.stdout}}/qtip_result
-
- - name: Transforming result
- shell: cd $HOME/qtip_result && sudo python ramspeed_transform.py
-
- - name: copy report formation script
- copy: src={{workingdir}}/qtip/utils/transform/final_report.py dest={{home_dir.stdout}}/qtip_result
-
- - name: consolidating report
- shell: cd $HOME/qtip_result && sudo python final_report.py RamSpeed {{fname}}
-
- - name: registering files
- 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}}/ramspeed/ramspeed_temp
- with_items: "{{files_to_copy.stdout_lines}}"
-
- - name: registering log files
- shell: (cd $HOME/qtip_result/; find . -maxdepth 1 -name "*.log") | cut -d'/' -f2
- register: copy_log_results
-
- - name: copying log results
- fetch: src={{home_dir.stdout}}/qtip_result/{{item}} dest={{Dest_dir}}/ramspeed/ramspeed_temp
- with_items: "{{copy_log_results.stdout_lines}}"
-
- - name: cleaning ramspeed directory
- file: path={{home_dir.stdout}}/ramspeed state=absent
-
- - name: cleaning previous results
- file: path={{home_dir.stdout}}/qtip_result state=absent
-
- - hosts: localhost
- connection: local
- gather_facts: no
-
- tasks:
- - name: extracting_json
- shell: (find /{{Dest_dir}}/ramspeed/ramspeed_temp/ -name "*.json" | xargs cp -t {{Dest_dir}}/ramspeed/)
-
- - name: making_logs_folder
- file: path={{Dest_dir}}/ramspeed/logs state=directory
-
- - name: extracting_log
- shell: ( find {{Dest_dir}}/ramspeed/ramspeed_temp/ -name "*.log" | xargs cp -t {{Dest_dir}}/ramspeed/logs)
-
- - name: removing ramspeed_log
- file: path={{Dest_dir}}/ramspeed/ramspeed_temp state=absent
diff --git a/legacy/assets/perftest/ssl.yaml b/legacy/assets/perftest/ssl.yaml
deleted file mode 100644
index db77a724..00000000
--- a/legacy/assets/perftest/ssl.yaml
+++ /dev/null
@@ -1,127 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
- - hosts: localhost
- connection: local
- gather_facts: no
-
- tasks:
- - name: making ssl directory
- file: path={{Dest_dir}}/ssl state=directory
-
- - name: making temporary ssl directory
- file: path={{Dest_dir}}/ssl/ssl_temp state=directory
-
- - hosts: "{{role}}"
- become: yes
- remote_user: "{{username}}"
-
- tasks:
- - name: checking home directory
- shell: sudo echo $HOME
- register: home_dir
-
- - name: cleaning Open_SSL directory
- file: path={{home_dir.stdout}}/Open_SSL state=absent
-
- - name: cleaning_qtip_result
- file: path={{home_dir.stdout}}/qtip_result state=absent
-
- - name: making OpenSSL temporary directory
- file: path={{home_dir.stdout}}/Open_SSL state=directory
-
- - name: making results temporary directory
- file: path={{home_dir.stdout}}/qtip_result state=directory
-
- - include: ./common/sys_proxy_pbook.yaml
-
- - include: ./common/sys_info_pbook.yaml
- vars:
- network: false
-
- - name: Installing OpenSSL dependencies when CentOS
- shell: sudo yum install git wget gcc patch perl-Time-HiRes autofconf automake libpcap-devel libtool -y
- when: ansible_os_family == "RedHat"
-
- - name: Installing OpenSSL dependencies when Ubuntu
- shell: sudo apt-get install git gcc wget perl autoconf automake libpcap-dev libtool -y
- when: ansible_os_family == "Debian"
-
- - name: Fetching OpenSSL
- shell: cd $HOME/Open_SSL/ && sudo wget http://artifacts.opnfv.org/qtip/utilities/openssl-1.0.2f.tar.gz
-
- - name: Untar OpenSSL
- shell: cd $HOME/Open_SSL/ && sudo tar -zxvf openssl-1.0.2f.tar.gz
- - name: configure
- shell: cd $HOME/Open_SSL/openssl-1.0.2f && sudo ./config
-
- - name: 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
-
- - name: Benchmarking RSA signatures
- shell: cd $HOME/Open_SSL/openssl-1.0.2f/apps && sudo ./openssl speed rsa >> $HOME/qtip_result/RSA_dump
-
- - name: Benchmaring AES-128-cbc cipher encryption throughput
- shell: cd $HOME/Open_SSL/openssl-1.0.2f/apps && sudo ./openssl speed -evp aes-128-cbc >> $HOME/qtip_result/AES-128-CBC_dump
-
- - name: Fetching result transformation script
- copy: src={{workingdir}}/qtip/utils/transform/ssl_transform.py dest={{home_dir.stdout}}/qtip_result
-
- - name: Transforming result
- shell: cd $HOME/qtip_result && python ssl_transform.py
-
- - name: copy report formation script
- copy: src={{workingdir}}/qtip/utils/transform/final_report.py dest={{home_dir.stdout}}/qtip_result
-
- - name: consolidating report
- shell: cd $HOME/qtip_result && python final_report.py SSL {{fname}}
-
- - name: registering files
- 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}}/ssl/ssl_temp
- with_items: "{{files_to_copy.stdout_lines}}"
-
- - name: registering log files
- shell: (cd $HOME/qtip_result/; find . -maxdepth 1 -name "*.log") | cut -d'/' -f2
- register: copy_log_results
-
- - name: copying log results
- fetch: src={{home_dir.stdout}}/qtip_result/{{item}} dest={{Dest_dir}}/ssl/ssl_temp
- with_items: "{{copy_log_results.stdout_lines}}"
-
- - name: cleaning Open_SSL directory
- file: path={{home_dir.stdout}}/Open_SSL state=absent
-
- - name: cleaning_qtip_result
- file: path={{home_dir.stdout}}/qtip_result state=absent
-
- - hosts: localhost
- connection: local
- gather_facts: no
-
- tasks:
- - name: echo
- shell: echo $PWD
-
- - name: extracting_json
- shell: (find {{Dest_dir}}/ssl/ssl_temp/ -name "*.json" | xargs cp -t {{Dest_dir}}/ssl/)
-
- - name: making_logs_folder
- file: path={{Dest_dir}}/ssl/logs state=directory
-
- - name: extracting_log
- shell: (find {{Dest_dir}}/ssl/ssl_temp/ -name "*.log" | xargs cp -t {{Dest_dir}}/ssl/logs)
-
- - name: removing ssl_temp
- file: path={{Dest_dir}}/ssl/ssl_temp state=absent
diff --git a/legacy/assets/perftest/whetstone.yaml b/legacy/assets/perftest/whetstone.yaml
deleted file mode 100644
index 0037ded3..00000000
--- a/legacy/assets/perftest/whetstone.yaml
+++ /dev/null
@@ -1,119 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
- - hosts: localhost
- connection: local
- gather_facts: no
-
- tasks:
- - name: making whetstone directory
- file: path={{Dest_dir}}/whetstone state=directory
-
- - name: making temporary whetstone directory
- file: path={{Dest_dir}}/whetstone/whetstone_temp state=directory
-
- - hosts: "{{role}}"
- become: yes
- remote_user: "{{username}}"
-
- tasks:
- - name: storing_home
- shell: echo $HOME
- register: home_dir
-
- - name: cleaning tempT directory
- file: path={{home_dir.stdout}}/tempT state=absent
-
- - name: cleaning qtip result directory
- file: path={{home_dir.stdout}}/qtip_result state=absent
-
- - name: making qtip_result directory
- file: path={{home_dir.stdout}}/qtip_result state=directory
-
- - include: ./common/sys_proxy_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
- when: ansible_os_family == "RedHat"
-
- - name: Installing UnixBench dependencies if Ubuntu
- shell: sudo apt-get install git gcc patch perl -y
- when: ansible_os_family == "Debian"
-
- - include: ./common/git_proxy_pbook.yaml
-
- - name: Clone unixbench
- git: repo=https://github.com/kdlucas/byte-unixbench.git
- dest=$HOME/tempT
-
- - name: make
- shell: sudo make --directory $HOME/tempT/UnixBench/
-
- - name: Run Whetstone
- shell: cd $HOME/tempT/UnixBench/&&./Run -v whetstone
-
- - name: collecting and transforming result script copy
- copy: src={{workingdir}}/qtip/utils/transform/ubench_transform.py dest={{home_dir.stdout}}/qtip_result/
-
- - name: transforming result
- shell: cd $HOME/qtip_result && sudo python ubench_transform.py
-
- - name: copying consolidated report script
- copy: src={{workingdir}}/qtip/utils/transform/final_report.py dest={{home_dir.stdout}}/qtip_result/
-
- - name: making consolidated report
- shell: cd $HOME/qtip_result && sudo python final_report.py Whetstone {{fname}}
-
- - name: making directory
- file: path={{home_dir.stdout}}/qtip_result/log state=directory
-
- - name: copying result to temp directory
- shell: sudo cp -r $HOME/tempT/UnixBench/results/* $HOME/qtip_result/log
-
- - name: registering files
- 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}}/whetstone/whetstone_temp
- with_items: "{{files_to_copy.stdout_lines}}"
-
- - name: registering log files
- shell: (cd $HOME/qtip_result/log/; find . -maxdepth 1 -name "*.log") | cut -d'/' -f2
- register: copy_log_results
-
- - name: copying log results
- fetch: src={{home_dir.stdout}}/qtip_result/log/{{item}} dest={{Dest_dir}}/whetstone/whetstone_temp
- with_items: "{{copy_log_results.stdout_lines}}"
-
- - name: cleaning tempT directory
- file: path={{home_dir.stdout}}/tempT state=absent
-
- - name: cleaning qtip result directory
- file: path={{home_dir.stdout}}/qtip_result state=absent
-
- - hosts: localhost
- connection: local
- gather_facts: no
-
- tasks:
- - name: extracting_json
- shell: (find {{Dest_dir}}/whetstone/whetstone_temp/ -name "*.json" | xargs cp -t {{Dest_dir}}/whetstone/)
-
- - name: making_logs_folder
- file: path={{Dest_dir}}/whetstone/logs state=directory
-
- - name: extracting_log
- shell: (find {{Dest_dir}}/whetstone/whetstone_temp/ -name "*.log" | xargs cp -t {{Dest_dir}}/whetstone/logs)
-
- - name: removing whetstone_temp
- file: path={{Dest_dir}}/whetstone/whetstone_temp state=absent
diff --git a/legacy/assets/suite/compute b/legacy/assets/suite/compute
deleted file mode 100644
index 3bf1b184..00000000
--- a/legacy/assets/suite/compute
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "bm": [
- "dhrystone_bm.yaml",
- "whetstone_bm.yaml",
- "ramspeed_bm.yaml",
- "dpi_bm.yaml",
- "ssl_bm.yaml"
- ],
- "vm": [
- "dhrystone_vm.yaml",
- "whetstone_vm.yaml",
- "ramspeed_vm.yaml",
- "dpi_vm.yaml",
- "ssl_vm.yaml"
- ]
-}
diff --git a/legacy/assets/suite/compute.yaml b/legacy/assets/suite/compute.yaml
deleted file mode 100644
index ead194a4..00000000
--- a/legacy/assets/suite/compute.yaml
+++ /dev/null
@@ -1,54 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-QPI: compute
-description: sample performance index of computing
-
-formula: weighted arithmetic mean
-
-section:
-- name: Integer
- weight: 0.3
- formula: geometric mean
- perftests:
- - name: dhrystone
- workloads:
- - single_cpu
- - multi_cpu
-- name: Floating
- weight: 0.3
- formula: geometric mean
- perftests:
- - name: whetstone
- workloads:
- - single_cpu
- - multi_cpu
-- name: Memory
- weight: 0.2
- formula: geometric mean
- perftests:
- - name: ramspeed
- workloads:
- - int: [add, average, copy, scale, triad]
- - float: [add, average, copy, scale, triad]
-- name: DPI
- weight: 0.1
- formula: geometric mean
- perftests:
- - name: dpi
- workloads:
- - bps
- - pps
-- name: SSL
- weight: 0.1
- formula: geometric mean
- perftests:
- - name: ssl
- workloads:
- - aes_128_cbc: [512, 1024, 2048, 4096]
- - rsa_sig: [16, 64, 256, 1024, 8192]
diff --git a/legacy/assets/suite/network b/legacy/assets/suite/network
deleted file mode 100644
index 58ce5cb9..00000000
--- a/legacy/assets/suite/network
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "bm": [
- "iperf_bm.yaml"
- ],
- "vm": [
- "iperf_vm.yaml",
- "iperf_vm_2.yaml"
- ]
-}
diff --git a/legacy/assets/suite/storage b/legacy/assets/suite/storage
deleted file mode 100644
index f3068dd5..00000000
--- a/legacy/assets/suite/storage
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "bm": [
- "fio_bm.yaml"
- ],
- "vm": [
- "fio_vm.yaml"
- ]
-}
diff --git a/legacy/assets/testplan/default/compute/dhrystone_bm.yaml b/legacy/assets/testplan/default/compute/dhrystone_bm.yaml
deleted file mode 100644
index 54f27fb6..00000000
--- a/legacy/assets/testplan/default/compute/dhrystone_bm.yaml
+++ /dev/null
@@ -1,41 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-Scenario:
- benchmark: dhrystone
- host: machine_1, machine_2
- server:
-
-Context:
- Host_Machines:
- machine_1:
- ip:
- pw:
- role: host
- machine_2:
- ip:
- pw:
- role: host
-
- Virtual_Machines:
-
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "dhrystone"
- Overview: >
- ''' This test will run the dhrystone benchmark in parallel on machine_1 and machine_2.\n
- if you wish to add a virtual machine add the following information under the Virtual_Machine tag
-
- virtualmachine_1:
- availability_zone:
- public_network:
- OS_image:
- flavor:
- role: '''
diff --git a/legacy/assets/testplan/default/compute/dhrystone_vm.yaml b/legacy/assets/testplan/default/compute/dhrystone_vm.yaml
deleted file mode 100644
index 06377bea..00000000
--- a/legacy/assets/testplan/default/compute/dhrystone_vm.yaml
+++ /dev/null
@@ -1,53 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-Scenario:
- benchmark: dhrystone
- host: virtualmachine_1, virtualmachine_2
- server: blakc
-
-Context:
- Host_Machines:
-
- Virtual_Machines:
- virtualmachine_1:
- availability_zone: compute1
- public_network: 'net04_ext'
- OS_image: QTIP_CentOS
- flavor: m1.large
- role: host
- virtualmachine_2:
- availability_zone: compute2
- public_network: 'net04_ext'
- OS_image: QTIP_CentOS
- flavor: m1.large
- role: host
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "dhrystone"
- Overview: >
- '''This test will run the dhrystone benchmark in parallel on machine_1 and machine_2.\n
- if you wish to add a virtual machine add the following information under the Virtual_Machine tag
- machine_1:
- ip: 172.18.0.16
- pw: Op3nStack
- role: host
- machine_2:
- ip: 172.18.0.15
- pw: Op3nStack
- role: host
-
- virtualmachine_1:
- availability_zone:
- public_network:
- OS_image:
- flavor:
- role:
- '''
-
diff --git a/legacy/assets/testplan/default/compute/dpi_bm.yaml b/legacy/assets/testplan/default/compute/dpi_bm.yaml
deleted file mode 100644
index deb6a874..00000000
--- a/legacy/assets/testplan/default/compute/dpi_bm.yaml
+++ /dev/null
@@ -1,42 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-Scenario:
- benchmark: dpi
- host: machine_1,machine_2
-
-Context:
- Host_Machines:
- machine_1:
- ip:
- pw:
- role: host
- machine_2:
- ip:
- pw:
- role: host
- Virtual_Machines:
-Test_Description:
- Test_category: "Compute"
- Benchmark: "dpi"
- Overview: >
- '''This test will run the DPI benchmark in serial on virutalmachine_1 and virtualmachine_2.\n
- if you wish to add a host machine add the following information under the Host_Machine tag
- virtualmachine_2:
- availability_zone: compute1
- OS_image: QTIP_CentOS
- public_network: 'provider_network'
-
- role: 1host
- flavor: m1.large
- machine_1:
- ip:
- pw:
- role:
- '''
-
diff --git a/legacy/assets/testplan/default/compute/dpi_vm.yaml b/legacy/assets/testplan/default/compute/dpi_vm.yaml
deleted file mode 100644
index 4fb16842..00000000
--- a/legacy/assets/testplan/default/compute/dpi_vm.yaml
+++ /dev/null
@@ -1,43 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-Scenario:
- benchmark: dpi
- 1Run : virtualmachine_1, virtualmachine_2
-
-Context:
- Host_Machines:
-
-
- Virtual_Machines:
- virtualmachine_1:
- availability_zone: compute1
- OS_image: QTIP_CentOS
- public_network: 'net04_ext'
- role: 1Run
- flavor: m1.large
- virtualmachine_2:
- availability_zone: compute2
- OS_image: QTIP_CentOS
- public_network: 'net04_ext'
- role: 1Run
- flavor: m1.large
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "dpi"
- Overview: >
- '''This test will run the DPI benchmark in parallel on virutalmachine_1 and virtualmachine_2.\n
- if you wish to add a host machine add the following information under the Host_Machine tag
-
- machine_1:
- ip:
- pw:
- role:
- '''
-
diff --git a/legacy/assets/testplan/default/compute/ramspeed_bm.yaml b/legacy/assets/testplan/default/compute/ramspeed_bm.yaml
deleted file mode 100644
index c758c18d..00000000
--- a/legacy/assets/testplan/default/compute/ramspeed_bm.yaml
+++ /dev/null
@@ -1,42 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-Scenario:
- benchmark: ramspeed
- host: machine_1, machine_2
- server:
-
-Context:
- Host_Machines:
- machine_1:
- ip:
- pw:
- role: host
- machine_2:
- ip:
- pw:
- role: host
-
- Virtual_Machines:
-
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "dhrystone"
- Overview: >
- ''' This test will run the dhrystone benchmark in parallel on machine_1 and machine_2.\n
- if you wish to add a virtual machine add the following information under the Virtual_Machine tag
-
- virtualmachine_1:
- availability_zone:
- public_network:
- OS_image:
- flavor:
- role: '''
-
-
diff --git a/legacy/assets/testplan/default/compute/ramspeed_vm.yaml b/legacy/assets/testplan/default/compute/ramspeed_vm.yaml
deleted file mode 100644
index 5f7ab831..00000000
--- a/legacy/assets/testplan/default/compute/ramspeed_vm.yaml
+++ /dev/null
@@ -1,53 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-Scenario:
- benchmark: ramspeed
- host: virtualmachine_1, virtualmachine_2
- server: blakc
-
-Context:
- Host_Machines:
-
- Virtual_Machines:
- virtualmachine_1:
- availability_zone: compute1
- public_network: 'net04_ext'
- OS_image: QTIP_CentOS
- flavor: m1.large
- role: host
- virtualmachine_2:
- availability_zone: compute2
- public_network: 'net04_ext'
- OS_image: QTIP_CentOS
- flavor: m1.large
- role: host
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "dhrystone"
- Overview: >
- '''This test will run the dhrystone benchmark in parallel on machine_1 and machine_2.\n
- if you wish to add a virtual machine add the following information under the Virtual_Machine tag
- machine_1:
- ip: 172.18.0.16
- pw: Op3nStack
- role: host
- machine_2:
- ip: 172.18.0.15
- pw: Op3nStack
- role: host
-
- virtualmachine_1:
- availability_zone:
- public_network:
- OS_image:
- flavor:
- role:
- '''
-
diff --git a/legacy/assets/testplan/default/compute/ssl_bm.yaml b/legacy/assets/testplan/default/compute/ssl_bm.yaml
deleted file mode 100644
index bb2ee64a..00000000
--- a/legacy/assets/testplan/default/compute/ssl_bm.yaml
+++ /dev/null
@@ -1,39 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-Scenario:
- benchmark: ssl
- host: machine_1,machine_2
-
-Context:
- Host_Machines:
- machine_1:
- ip:
- pw:
- role: host
- machine_2:
- ip:
- pw:
- role: host
- Virtual_Machines:
-
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "ssl"
- Overview: >
- '''This test will run the SSL benchmark in parallel on machine_1 and machine_1.
- If you wish to add a virtual machine add the following information under the Virtual_Machine tag
-
- virtualmachine_1:
- availability_zone:
- public_network:
- OS_image:
- flavor:
- role:
- '''
diff --git a/legacy/assets/testplan/default/compute/ssl_vm.yaml b/legacy/assets/testplan/default/compute/ssl_vm.yaml
deleted file mode 100644
index ca18393b..00000000
--- a/legacy/assets/testplan/default/compute/ssl_vm.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-Scenario:
- benchmark: ssl
- host: virtualmachine_1, virtualmachine_2
-
-Context:
- Host_Machines:
-
- Virtual_Machines:
- virtualmachine_1:
- availability_zone: compute1
- public_network: 'net04_ext'
- OS_image: 'QTIP_CentOS'
- flavor: 'm1.large'
- role: host
- virtualmachine_2:
- availability_zone: compute2
- public_network: 'net04_ext'
- OS_image: 'QTIP_CentOS'
- flavor: 'm1.large'
- role: host
-
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "ssl"
- Overview: >
- '''This test will run the SSL benchmark in parallel on virtualmachine_1 and machine_1.\n
- if you wish to add a virtual machine add the following information under the Virtual_Machine tag
-
- virtualmachine_1:
- availability_zone:
- public_network:
- OS_image:
- flavor:
- role:
- '''
diff --git a/legacy/assets/testplan/default/compute/whetstone_bm.yaml b/legacy/assets/testplan/default/compute/whetstone_bm.yaml
deleted file mode 100644
index 1d3add50..00000000
--- a/legacy/assets/testplan/default/compute/whetstone_bm.yaml
+++ /dev/null
@@ -1,41 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-Scenario:
- benchmark: whetstone
- host: machine_1, machine_2
-
-
-Context:
- Host_Machines:
- machine_1:
- ip:
- pw:
- role: host
- machine_2:
- ip:
- pw:
- role: host
- Virtual_Machines:
-
-
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "whetstone"
- Overview: >
- ''' This test will run the whetstone benchmark in parallel on machine_1 and machine_2.\n
- if you wish to add a baremetal machine add the following information under the Virtual_Machine tag
-
- machine_3:
- ip:
- pw:
- role:
- '''
-
-
diff --git a/legacy/assets/testplan/default/compute/whetstone_vm.yaml b/legacy/assets/testplan/default/compute/whetstone_vm.yaml
deleted file mode 100644
index 4e0e1d80..00000000
--- a/legacy/assets/testplan/default/compute/whetstone_vm.yaml
+++ /dev/null
@@ -1,52 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-Scenario:
- benchmark: whetstone
- host: virtualmachine_1, virtualmachine_1
- server:
-
-Context:
- Host_Machines:
-
- Virtual_Machines:
- virtualmachine_1:
- availability_zone: compute1
- public_network: 'net04_ext'
- OS_image: QTIP_CentOS
- flavor: m1.large
- role: host
- virtualmachine_2:
- availability_zone: compute2
- public_network: 'net04_ext'
- OS_image: QTIP_CentOS
- flavor: m1.large
- role: host
-
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "dhrystone"
- Overview: >
- '''This test will run the whetstone benchmark in parallel on machine_1 and machine_2.\n
- if you wish to add a virtual machine add the following information under the Virtual_Machine tag
- virtualmachine_1:
- availability_zone: nova
- public_network: 'net04_ext'
- OS_image: QTIP_CentOS
- flavor: m1.large
- role: host
-
- virtualmachine_1:
- availability_zone:
- public_network:
- OS_image:
- flavor:
- role:
- '''
-
diff --git a/legacy/data/hosts b/legacy/data/hosts
deleted file mode 100644
index 0a0ac539..00000000
--- a/legacy/data/hosts
+++ /dev/null
@@ -1,2 +0,0 @@
-[sample_group_name]
-127.0.0.1
diff --git a/legacy/data/my_key.pem b/legacy/data/my_key.pem
deleted file mode 100644
index d7c96f24..00000000
--- a/legacy/data/my_key.pem
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEowIBAAKCAQEAntmA9ybqcxQKr9R3iTbNr+89ZJwlt5+gLbT8VR9sUAYCEEJn
-xX7DX5djpSdQ1OoxJun/HE0ByKPXCIqGq3sHnxQ/3Wh80UGlyiSXgS8/p8NlfgPr
-DIDuVNhKJlsobsfTVXL789i512rqf2zFBWfoesFgZee6ACrSYN3hdNICFOwtbmHA
-g+xEs00yGmbcFDuBQnDeR2yPpV6G4AtrU5zwliVj7fMzrB5w9De20ydbFqxjPdOD
-gbfwrhQQs82pv7vfJCFByjsSlwP4mcznKgOt/aO2y/B1ZvL+dOsCi8D3H6Ggrg7R
-wmiIRaCijYX4SycYxdn+RkZpp9g0AyR/potcKwIDAQABAoIBADncgF2Gj1/brQjf
-G6ufiszLGFHNju+T9YSwqDlZeNqtVZMWnTYTNpdbTbCa4Zast7q1AXgNlNjA1VMH
-IobUCbKobZr4tH6Eqx82tPkZfNZfFlkQlE25qRa+skPGcLPpldFKUPxBtXACQeio
-dhvB/ay5Q6PbBKWK85bVO4qR9LApxHCDQgovGtasUF1/wu5z4vOCP3KLtlE268m+
-XJ/4IZX2erBOfxOGPqp+qDK8FTP1NcuGFEkhUa8Tr406CIXptTDyPc+bMZANIGDM
-hhww6VR5aHxsHWgu1UITVZuDh5fJ8U6n2utqTm/QLT25DUPKoTJSAjLet7fnm4Cw
-hee7GgECgYEAziiWq4peA9WrJYTlR8bNRLgsMjZx/AphyJQpFCQsgCMuB9wIluTT
-5Di4jvdvKclsFTh6foxnltltX6O8tL+vrzfbK9fBB3A2T1V1sDMOznhI47Mmoqk6
-9le6aMmpTIhNFJMu1DpsuoxRLIJaNkWLCwWaIE1ZggqCgbjIdMOJt20CgYEAxUDo
-DUf0zi/qYZVVTnziubcqu0kjUWhmeEiv08WFst8l2fAwHBILNms5ot4TY5MlFxta
-vLsWaXC7o6tqofSHF52cD8AbUWEnvK2NtCA7gW+0xBtQEPqrtItA0YjblFXw7qwb
-QUValSo535bFYJjp5foJxTZXg9rErF4iUgExqvcCgYBK5t5PNvePhxsmh5FSMb20
-oQGVwMhLHW6HlKUUJ0xvxdhcjKomQL9npOAROX8O/JqjXyDKR7L/UMH3RKM0PIzV
-KYMc+8erLy7cRh17RiG0DGnXKOj5omjExfz5Q4OaRc9TkWIrQ4rrgD2h4T5rh3rM
-J13nLJM/txfRj9Rs7/piRQKBgCm3RFwqr5c7gvIIRvZGaxyjpCHfodyBm8osdSLw
-Two5LyQcK9CD8GMd4h6ToL4aTGnKmzH2zxKViNlgUzjVIgzYhDzAgAaB6Yl5mtJR
-TsRc/3nJ3PD6Un3oRVkK/IUud7nCJDF1nWaWe47RsARx0mWUr6RJjdCQ368kaVW2
-cu6ZAoGBALD4Gw+AsH6/za7gmRIqlzBURHpHCgKutQKv3UbD1hVc5tDAoYwBjjod
-AVY8N8+AmX/nmJOVcch/dAnICkLrZn5Bm/q52/3xCAlnGkwNHyW4G99lZCfNEQrx
-sVAZ4FNrtMC9Xwtj0o73ojqKP4gxVkljbybnbuyNSXZo14EbXuJU
------END RSA PRIVATE KEY-----
diff --git a/legacy/data/output/hosts b/legacy/data/output/hosts
deleted file mode 100644
index 9b47df0e..00000000
--- a/legacy/data/output/hosts
+++ /dev/null
@@ -1,3 +0,0 @@
-[host]
-10.20.0.29
-10.20.0.28
diff --git a/legacy/data/schema/test_bm_schema.yaml b/legacy/data/schema/test_bm_schema.yaml
deleted file mode 100644
index af97da70..00000000
--- a/legacy/data/schema/test_bm_schema.yaml
+++ /dev/null
@@ -1,84 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-type: map
-mapping:
- Scenario:
- type: map
- mapping:
- benchmark:
- type: str
- required: True
- host:
- type: str
- server:
- type: str
- allowempty: True
- client:
- type: str
- allowempty: True
- topology:
- type: str
- allowempty: True
- benchmark_details:
- type: map
- mapping:
- duration:
- type: int
- protocol:
- type: str
- bandwidthGbps:
- type: int
- description:
- type: str
- 1Run:
- type: str
-
- Context:
- type: map
- mapping:
- Host_Machines:
- type: map
- required: True
- mapping:
- regex;(^machine):
- type: map
- mapping:
- role:
- type: str
- ip:
- type: str
- allowempty: True
- pw:
- type: str
- allowempty: True
- Virtual_Machines:
- type: map
- allowempty: True
- Proxy_Environment:
- type: map
- mapping:
- http_proxy:
- type: str
- https_proxy:
- type: str
- no_proxy:
- type: str
-
- Test_Description:
- type: map
- mapping:
- Test_category:
- type: str
- allowempty: True
- Benchmark:
- type: str
- allowempty: True
- Overview:
- type: str
- allowempty: True
diff --git a/legacy/data/schema/test_vm_schema.yaml b/legacy/data/schema/test_vm_schema.yaml
deleted file mode 100644
index ca632e50..00000000
--- a/legacy/data/schema/test_vm_schema.yaml
+++ /dev/null
@@ -1,88 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-type: map
-mapping:
- Scenario:
- type: map
- mapping:
- benchmark:
- type: str
- required: True
- host:
- type: str
- server:
- type: str
- allowempty: True
- 1Run:
- type: str
- client:
- type: str
- allowempty: True
- topology:
- type: str
- allowempty: True
- benchmark_details:
- type: map
- mapping:
- duration:
- type: int
- protocol:
- type: str
- bandwidthGbps:
- type: int
- teststream:
- type: str
- description:
- type: str
-
- Context:
- type: map
- mapping:
- Host_Machines:
- type: map
- allowempty: True
- Virtual_Machines:
- type: map
- required: True
- mapping:
- regex;(^virtualmachine):
- type: map
- mapping:
- availability_zone:
- type: str
- OS_image:
- type: str
- public_network:
- type: str
- role:
- type: str
- flavor:
- type: str
- Proxy_Environment:
- type: map
- mapping:
- http_proxy:
- type: str
- https_proxy:
- type: str
- no_proxy:
- type: str
-
- Test_Description:
- type: map
- mapping:
- Test_category:
- type: str
- allowempty: True
- Benchmark:
- type: str
- allowempty: True
- Overview:
- type: str
- allowempty: True
diff --git a/legacy/data/test.retry b/legacy/data/test.retry
deleted file mode 100644
index 7b9ad531..00000000
--- a/legacy/data/test.retry
+++ /dev/null
@@ -1 +0,0 @@
-127.0.0.1
diff --git a/legacy/data/test.yml b/legacy/data/test.yml
deleted file mode 100644
index d27bce3c..00000000
--- a/legacy/data/test.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-- hosts: sample_group_name
- tasks:
- - name: just an uname
- command: uname -a
diff --git a/legacy/data/testplan/bm_ping.yaml b/legacy/data/testplan/bm_ping.yaml
deleted file mode 100644
index 39c05aad..00000000
--- a/legacy/data/testplan/bm_ping.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-Scenario:
- benchmark: dhrystone
- host: machine_1
- server:
-
-Context:
- Host_Machines:
- machine_1:
- ip: 127.0.0.1
- pw:
- role: host
-
- Virtual_Machines:
-
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "dhrystone"
- Overview: >
- ''' This test will run the dhrystone benchmark in parallel on machine_1 and machine_2.\n
- if you wish to add a virtual machine add the following information under the Virtual_Machine tag
-
- virtualmachine_1:
- availability_zone:
- public_network:
- OS_image:
- flavor:
- role: '''
diff --git a/legacy/data/testplan/bm_with_proxy.yaml b/legacy/data/testplan/bm_with_proxy.yaml
deleted file mode 100644
index ef9e651e..00000000
--- a/legacy/data/testplan/bm_with_proxy.yaml
+++ /dev/null
@@ -1,47 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-Scenario:
- benchmark: dhrystone
- host: machine_1, machine_2
- server:
-
-Context:
- Host_Machines:
- machine_1:
- ip: 10.20.0.28
- pw:
- role: host
- machine_2:
- ip: 10.20.0.29
- pw:
- role: host
-
- Virtual_Machines:
-
- Proxy_Environment:
- http_proxy: http://10.20.0.1:8118
- https_proxy: http://10.20.0.1:8118
- no_proxy: localhost,127.0.0.1,10.20.*,192.168.*
-
-
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "dhrystone"
- Overview: >
- ''' This test will run the dhrystone benchmark in parallel on machine_1 and machine_2.\n
- if you wish to add a virtual machine add the following information under the Virtual_Machine tag
-
- virtualmachine_1:
- availability_zone:
- public_network:
- OS_image:
- flavor:
- role: '''
diff --git a/legacy/data/testplan/bm_without_proxy.yaml b/legacy/data/testplan/bm_without_proxy.yaml
deleted file mode 100644
index 8a1f3b05..00000000
--- a/legacy/data/testplan/bm_without_proxy.yaml
+++ /dev/null
@@ -1,41 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-Scenario:
- benchmark: dhrystone
- host: machine_1, machine_2
- server:
-
-Context:
- Host_Machines:
- machine_1:
- ip: 10.20.0.28
- pw:
- role: host
- machine_2:
- ip: 10.20.0.29
- pw:
- role: host
-
- Virtual_Machines:
-
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "dhrystone"
- Overview: >
- ''' This test will run the dhrystone benchmark in parallel on machine_1 and machine_2.\n
- if you wish to add a virtual machine add the following information under the Virtual_Machine tag
-
- virtualmachine_1:
- availability_zone:
- public_network:
- OS_image:
- flavor:
- role: '''
diff --git a/legacy/data/testplan/vm.yaml b/legacy/data/testplan/vm.yaml
deleted file mode 100644
index 9ba13b30..00000000
--- a/legacy/data/testplan/vm.yaml
+++ /dev/null
@@ -1,56 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-Scenario:
- benchmark: iperf
- topology: Client and Server on ONE compute
- server : virtualmachine_1
- client: virtualmachine_2
- description: 'Leave the bandwidth as 0 to throttle maximum traffic'
- benchmark_details:
- duration: 20
- protocol: tcp
- bandwidthGbps: 0
-
-Context:
- Host_Machines:
-
- Virtual_Machines:
- virtualmachine_1:
- availability_zone: compute1
- OS_image: QTIP_CentOS
- public_network: 'admin-floating_net'
- role: 1-server
- flavor: m1.large
-
- virtualmachine_2:
- availability_zone: compute1
- OS_image: QTIP_CentOS
- public_network: 'admin-floating_net'
- role: 2-host
- flavor: m1.large
-
- Proxy_Environment:
- http_proxy: http://10.20.0.1:8118
- https_proxy: http://10.20.0.1:8118
- no_proxy: localhost,127.0.0.1,10.20.*,192.168.*
-
-Test_Description:
- Test_category: "network"
- Benchmark: "iperf"
- Overview: >
- '''This test will run the IPERF benchmark on virutalmachine_1 and virtualmachine_2. On the\n
- same compute node
- if you wish to add a host machine add the following information under the Host_Machine tag
-
- machine_1:
- ip:
- pw:
- role:
- '''
-
diff --git a/legacy/data/testplan/vm_error.yaml b/legacy/data/testplan/vm_error.yaml
deleted file mode 100644
index d5cd6df6..00000000
--- a/legacy/data/testplan/vm_error.yaml
+++ /dev/null
@@ -1,50 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-Scenario:
- topology: Client and Server on ONE compute
- server : virtualmachine_1
- client: virtualmachine_2
- description: 'Leave the bandwidth as 0 to throttle maximum traffic'
- benchmark_details:
- duration: 20
- protocol: tcp
- bandwidthGbps: 0
-
-Context:
- Host_Machines:
-
- Virtual_Machines:
- virtualmachine_1:
- availability_zone: compute1
- OS_image: QTIP_CentOS
- public_network: 'admin-floating_net'
- role: 1-server
- flavor: m1.large
-
- virtualmachine_2:
- availability_zone: compute1
- OS_image: QTIP_CentOS
- public_network: 'admin-floating_net'
- role: 2-host
- flavor: m1.large
-
-Test_Description:
- Test_category: "network"
- Benchmark: "iperf"
- Overview: >
- '''This test will run the IPERF benchmark on virutalmachine_1 and virtualmachine_2. On the\n
- same compute node
- if you wish to add a host machine add the following information under the Host_Machine tag
-
- machine_1:
- ip:
- pw:
- role:
- '''
-
diff --git a/legacy/run.py b/legacy/run.py
deleted file mode 100644
index a2c26eda..00000000
--- a/legacy/run.py
+++ /dev/null
@@ -1,18 +0,0 @@
-##############################################################################
-# Copyright (c) 2015 Dell Inc and others.
-# Copyright (c) 2016 ZTE corp. and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-from utils.cli import Cli
-
-
-def main():
- Cli()
-
-
-if __name__ == "__main__":
- main()
diff --git a/legacy/scripts/cleanup_creds.sh b/legacy/scripts/cleanup_creds.sh
deleted file mode 100755
index b4eee924..00000000
--- a/legacy/scripts/cleanup_creds.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#! /bin/bash
-
-DEST_IP=$1
-HOSTNAME=$(hostname)
-sshoptions="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
-
-case "$INSTALLER_TYPE" in
- fuel)
- ssh $sshoptions -i ./config/QtipKey root@$DEST_IP "sed -i '/root@$HOSTNAME/d' /root/.ssh/authorized_keys"
- ;;
-esac
diff --git a/legacy/scripts/get_env_info.sh b/legacy/scripts/get_env_info.sh
deleted file mode 100755
index cd49ac87..00000000
--- a/legacy/scripts/get_env_info.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#! /bin/bash
-
-usage() {
- echo "usage $0 -n <installer_type> -i <installer_ip> -k <key incase of apex>"
-}
-
-
-
-while getopts ":n:i:k:" optchar; do
- case "${optchar}" in
- n)
- export INSTALLER_TYPE=${OPTARG};;
-
- i)
- export INSTALLER_IP=${OPTARG};;
-
- k)
- export APEX_KEY=${OPTARG};;
-
- *)
- echo "Incorrect usage"
- usage ;;
- esac
-done
-
-if [ $INSTALLER_TYPE == "apex" ]
- then
- if [ -z $APEX_KEY ]
- then
- echo "Please provide the the key to access the APEX Instack VM"
- usage
- exit 1
- fi
-fi
-
-
-${REPOS_DIR}/releng/utils/fetch_os_creds.sh -d ${QTIP_DIR}/opnfv-creds.sh
diff --git a/legacy/scripts/ssh_exch.exp b/legacy/scripts/ssh_exch.exp
deleted file mode 100644
index c52140b7..00000000
--- a/legacy/scripts/ssh_exch.exp
+++ /dev/null
@@ -1,9 +0,0 @@
-#1 /usr/bin/expect
-set timeout 4
-set ip [lindex $argv 0]
-set pswd [lindex $argv 1]
-spawn ssh-copy-id -i QtipKey $ip
-expect "Are you sure you want to continue connecting" {send "yes\r"}
-expect "password:" { send "$pswd\r"}
-
-interact
diff --git a/legacy/tests/ansible_api_test.py b/legacy/tests/ansible_api_test.py
deleted file mode 100644
index 6f286fc3..00000000
--- a/legacy/tests/ansible_api_test.py
+++ /dev/null
@@ -1,22 +0,0 @@
-##############################################################################
-# Copyright (c) 2016 ZTE Corp and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-from tests import BaseTest
-from qtip.utils.ansible_api import AnsibleApi
-
-
-class TestClass(BaseTest):
-
- def test_call_ansible_api_success(self):
- ansible_api = AnsibleApi()
- ret = ansible_api.execute_playbook(self.abspath('hosts'),
- self.abspath('test.yml'),
- self.abspath('QtipKey'),
- {'keys': 'test'})
- assert ret == 3
diff --git a/legacy/tests/args_handler_test.py b/legacy/tests/args_handler_test.py
deleted file mode 100644
index dceca1f5..00000000
--- a/legacy/tests/args_handler_test.py
+++ /dev/null
@@ -1,36 +0,0 @@
-##############################################################################
-# Copyright (c) 2016 ZTE Corp and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import pytest
-import mock
-import qtip.utils.args_handler
-
-
-@pytest.mark.xfail(reason="to be fixed")
-class TestClass:
- @pytest.mark.parametrize("test_input, expected", [
- (['fuel', '/home', 'benchmarks/testplan/default/network/iperf_bm.yaml'],
- ['fuel', '/home', "iperf",
- [('1-server', ['10.20.0.23']), ('2-host', ['10.20.0.24'])],
- "iperf_bm.yaml",
- [('duration', 20), ('protocol', 'tcp'), ('bandwidthGbps', 10)],
- [("10.20.0.24", [None]), ("10.20.0.23", [None])], {}])
- ])
- @mock.patch('qtip.utils.args_handler.Env_setup.call_ping_test')
- @mock.patch('qtip.utils.args_handler.Env_setup.call_ssh_test')
- @mock.patch('qtip.utils.args_handler.Env_setup.update_ansible')
- @mock.patch('qtip.utils.args_handler.SpawnVM')
- @mock.patch('qtip.utils.args_handler.Driver.drive_bench')
- def test_prepare_and_run_benchmark_successful(self, mock_driver, mock_sqawn_vm, mock_env_setup_ping,
- mock_env_setup_ssh, mock_update_ansible, test_input, expected):
- mock_ips = mock.Mock(return_value=["10.20.0.23", "10.20.0.24"])
- qtip.utils.args_handler.Env_setup.fetch_compute_ips = mock_ips
- qtip.utils.args_handler.prepare_and_run_benchmark(test_input[0], test_input[1], test_input[2])
- call = mock_driver.call_args
- call_args, call_kwargs = call
- assert sorted(map(sorted, call_args)) == sorted(map(sorted, expected))
diff --git a/legacy/tests/cli_test.py b/legacy/tests/cli_test.py
deleted file mode 100644
index 5b7eac65..00000000
--- a/legacy/tests/cli_test.py
+++ /dev/null
@@ -1,52 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import pytest
-import mock
-import os
-from qtip.utils.cli import Cli
-from os.path import expanduser
-
-
-@pytest.mark.skip("TODO(yujunz) recover test after refactoring")
-class TestClass:
- @pytest.mark.parametrize("test_input, expected", [
- (['-l',
- 'zte',
- '-f',
- 'compute'], "You have specified a lab that is not present under benchmarks/testplan"),
- (['-l',
- 'default',
- '-f',
- 'test'], "This suite file test doesn't exist under benchmarks/suite/")
- ])
- def test_cli_error(self, capfd, test_input, expected):
- k = mock.patch.dict(os.environ, {'INSTALLER_TYPE': 'fuel', 'PWD': '/home'})
- with pytest.raises(SystemExit):
- k.start()
- Cli(test_input)
- k.stop()
- with open(expanduser('~') + "/qtip/logs/cli.log", "r") as file:
- data = file.read()
- assert expected in data
-
- @pytest.mark.parametrize("test_input, expected", [
- (['-l',
- 'default',
- '-f',
- 'storage'], [('fuel', '/home', 'benchmarks/testplan/default/storage/fio_bm.yaml'),
- ('fuel', '/home', 'benchmarks/testplan/default/storage/fio_vm.yaml')])
- ])
- @mock.patch('qtip.utils.cli.args_handler.prepare_and_run_benchmark')
- def test_cli_successful(self, mock_args_handler, test_input, expected):
- k = mock.patch.dict(os.environ, {'INSTALLER_TYPE': 'fuel', 'PWD': '/home'})
- k.start()
- Cli(test_input)
- k.stop()
- call_list = map(lambda x: mock_args_handler.call_args_list[x][0], range(len(expected)))
- assert sorted(call_list) == sorted(expected)
diff --git a/legacy/tests/driver_test.py b/legacy/tests/driver_test.py
deleted file mode 100644
index abe8cfbb..00000000
--- a/legacy/tests/driver_test.py
+++ /dev/null
@@ -1,103 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import pytest
-import mock
-from qtip.utils.driver import Driver
-from os.path import expanduser
-
-HOME_DIR = expanduser('~')
-
-
-class TestClass:
- @pytest.mark.parametrize("test_input, expected", [
- (['fuel',
- '/home',
- "iperf",
- [('host', ['10.20.0.13', '10.20.0.15'])],
- "iperf_bm.yaml",
- [('duration', 20), ('protocol', 'tcp'), ('bandwidthGbps', 0)],
- [("10.20.0.13", [None]), ("10.20.0.15", [None])],
- {'http_proxy': 'http://10.20.0.1:8118',
- 'https_proxy': 'http://10.20.0.1:8118',
- 'no_proxy': 'localhost,127.0.0.1,10.20.*,192.168.*'}],
- [{'Dest_dir': HOME_DIR + '/qtip/results',
- 'ip1': '',
- 'ip2': '',
- 'installer': 'fuel',
- 'workingdir': '/home',
- 'fname': 'iperf_bm.yaml',
- 'username': 'root',
- 'http_proxy': 'http://10.20.0.1:8118',
- 'https_proxy': 'http://10.20.0.1:8118',
- 'no_proxy': 'localhost,127.0.0.1,10.20.*,192.168.*',
- 'duration': 20,
- 'protocol': 'tcp',
- 'bandwidthGbps': 0,
- "role": "host"}]),
- (['joid',
- '/home',
- "iperf",
- [('1-server', ['10.20.0.13']), ('2-host', ['10.20.0.15'])],
- "iperf_vm.yaml",
- [('duration', 20), ('protocol', 'tcp'), ('bandwidthGbps', 0)],
- [('1-server', '10.10.17.4'), ('2-host', '10.10.17.5')],
- {}],
- [{'Dest_dir': HOME_DIR + '/qtip/results',
- 'ip1': '10.20.0.13',
- 'ip2': '',
- 'installer': 'joid',
- 'privateip1': '10.10.17.4',
- 'workingdir': '/home',
- 'fname': 'iperf_vm.yaml',
- 'username': 'ubuntu',
- 'duration': 20,
- 'protocol': 'tcp',
- 'bandwidthGbps': 0,
- "role": "1-server"},
- {'Dest_dir': HOME_DIR + '/qtip/results',
- 'ip1': '10.20.0.13',
- 'ip2': '',
- 'installer': 'joid',
- 'privateip1': '10.10.17.4',
- 'workingdir': '/home',
- 'fname': 'iperf_vm.yaml',
- 'username': 'ubuntu',
- 'duration': 20,
- 'protocol': 'tcp',
- 'bandwidthGbps': 0,
- "role": "2-host"}])
- ])
- @mock.patch('qtip.utils.driver.AnsibleApi.execute_playbook')
- @mock.patch('qtip.utils.driver.AnsibleApi.get_detail_playbook_stats')
- def test_driver_success(self, mock_stats, mock_ansible, test_input, expected):
- mock_ansible.return_value = True
- mock_stats.return_value = [(u'10.20.6.14', {'unreachable': 0,
- 'skipped': 13,
- 'ok': 27,
- 'changed': 26,
- 'failures': 0}),
- ('localhost', {'unreachable': 0,
- 'skipped': 0,
- 'ok': 6,
- 'changed': 6,
- 'failures': 0}),
- (u'10.20.6.13', {'unreachable': 0,
- 'skipped': 13,
- 'ok': 27,
- 'changed': 26,
- 'failures': 0})]
- dri = Driver()
- result = dri.drive_bench(test_input[0], test_input[1], test_input[2], test_input[3],
- test_input[4], test_input[5], test_input[6], test_input[7])
- call_list = mock_ansible.call_args_list
- for call in call_list:
- call_args, call_kwargs = call
- real_call = call_args[3]
- assert real_call == expected[call_list.index(call)]
- assert result['result'] == 0
diff --git a/legacy/tests/env_setup_test.py b/legacy/tests/env_setup_test.py
deleted file mode 100644
index dea48190..00000000
--- a/legacy/tests/env_setup_test.py
+++ /dev/null
@@ -1,120 +0,0 @@
-##############################################################################
-# Copyright (c) 2016 ZTE and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-import os
-import pytest
-import filecmp
-from qtip.utils.env_setup import Env_setup
-import mock
-
-
-DATA_DIR = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, 'data')
-
-
-def get_test_plan(name):
- return os.path.join(DATA_DIR, 'testplan', name)
-
-
-def get_output(name):
- return os.path.join(DATA_DIR, 'output', name)
-
-
-class TestClass:
- @pytest.mark.parametrize("test_input, expected", [
- (get_test_plan("bm_with_proxy.yaml"),
- ["dhrystone",
- {},
- [],
- {'http_proxy': 'http://10.20.0.1:8118',
- 'https_proxy': 'http://10.20.0.1:8118',
- 'no_proxy': 'localhost,127.0.0.1,10.20.*,192.168.*'}]),
- (get_test_plan("bm_without_proxy.yaml"),
- ["dhrystone",
- {},
- [],
- {}]),
- (get_test_plan("vm.yaml"),
- ["iperf",
- {'availability_zone': ['compute1', 'compute1'],
- 'OS_image': ['QTIP_CentOS', 'QTIP_CentOS'],
- 'public_network': ['admin-floating_net', 'admin-floating_net'],
- 'flavor': ['m1.large', 'm1.large'],
- 'role': ['1-server', '2-host']},
- [('duration', 20), ('protocol', 'tcp'), ('bandwidthGbps', 0)],
- {'http_proxy': 'http://10.20.0.1:8118',
- 'https_proxy': 'http://10.20.0.1:8118',
- 'no_proxy': 'localhost,127.0.0.1,10.20.*,192.168.*'}])])
- def test_parse_success(self, test_input, expected):
- test_class = Env_setup()
- mock_ips = mock.Mock(return_value=["10.20.0.28", "10.20.0.29"])
- test_class.fetch_compute_ips = mock_ips
- benchmark, vm_para, details, proxy = \
- test_class.parse(test_input)
- assert benchmark == expected[0]
- assert vm_para == expected[1]
- assert sorted(details) == sorted(expected[2])
- assert proxy == expected[3]
-
- def test_parse_vm_error(self):
- test_class = Env_setup()
- mock_ips = mock.Mock(return_value=["10.20.0.28", "10.20.0.29"])
- test_class.fetch_compute_ips = mock_ips
- with pytest.raises(KeyError) as excinfo:
- test_class.parse(get_test_plan("vm_error.yaml"))
- assert "benchmark" in str(excinfo.value)
-
- def test_update_ansible(self):
- test_class = Env_setup()
- mock_ips = mock.Mock(return_value=["10.20.0.28", "10.20.0.29"])
- test_class.fetch_compute_ips = mock_ips
- test_class.parse(get_test_plan("bm_without_proxy.yaml"))
- test_class.update_ansible()
- result = filecmp.cmp(get_output("hosts"), "config/hosts")
- assert result
-
- @pytest.mark.skip("(yujunz) test hung")
- def test_ping(self, capfd):
- test_class = Env_setup()
- mock_ips = mock.Mock(return_value=["127.0.0.1", "10.20.0.29"])
- test_class.fetch_compute_ips = mock_ips
- test_class.parse(get_test_plan("bm_ping.yaml"))
- test_class.call_ping_test()
- resout, reserr = capfd.readouterr()
- assert '127.0.0.1 is UP' in resout
-
- def test_check_machine_ips_without_ip(self):
- test_class = Env_setup()
- mock_ips = mock.Mock(return_value=["10.20.0.28", "10.20.0.29"])
- test_class.fetch_compute_ips = mock_ips
- inputs = {"machine_1": {"ip": "", "pw": "", "role": "host"},
- "machine_2": {"ip": "", "pw": "", "role": "host"}}
- test_class.check_machine_ips(inputs)
- assert inputs["machine_1"]['ip'] in ["10.20.0.28", "10.20.0.29"]
- assert inputs["machine_2"]['ip'] in ["10.20.0.28", "10.20.0.29"]
- assert inputs["machine_1"]['ip'] != inputs["machine_2"]['ip']
-
- def test_check_machine_ips_with_ip(self):
- test_class = Env_setup()
- mock_ips = mock.Mock(return_value=["10.20.0.28", "10.20.0.29"])
- test_class.fetch_compute_ips = mock_ips
- inputs = {"machine_1": {"ip": "10.20.0.28", "pw": "", "role": "host"},
- "machine_2": {"ip": "10.20.0.29", "pw": "", "role": "host"}}
- test_class.check_machine_ips(inputs)
- assert inputs["machine_1"]['ip'] in ["10.20.0.28", "10.20.0.29"]
- assert inputs["machine_2"]['ip'] in ["10.20.0.28", "10.20.0.29"]
- assert inputs["machine_1"]['ip'] != inputs["machine_2"]['ip']
-
- def test_check_machine_ips_with_invalid_ip(self):
- test_class = Env_setup()
- mock_ips = mock.Mock(return_value=["10.20.0.28", "10.20.0.29"])
- test_class.fetch_compute_ips = mock_ips
- inputs = {"machine_1": {"ip": "10.20.0.3", "pw": "", "role": "host"},
- "machine_2": {"ip": "10.20.0.4", "pw": "", "role": "host"}}
- with pytest.raises(RuntimeError):
- test_class.check_machine_ips(inputs)
diff --git a/legacy/utils/ansible_api.py b/legacy/utils/ansible_api.py
deleted file mode 100644
index 9e1d249e..00000000
--- a/legacy/utils/ansible_api.py
+++ /dev/null
@@ -1,65 +0,0 @@
-##############################################################################
-# Copyright (c) 2016 ZTE Corp and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import os
-from collections import namedtuple
-from ansible.executor.playbook_executor import PlaybookExecutor
-from ansible.inventory import Inventory
-from ansible.parsing.dataloader import DataLoader
-from ansible.vars import VariableManager
-import logger_utils
-
-logger = logger_utils.QtipLogger('ansible_api').get
-
-
-class AnsibleApi:
-
- def __init__(self):
- self.variable_manager = VariableManager()
- self.loader = DataLoader()
- self.passwords = {}
- self.pbex = None
-
- def _check_path(self, file_path):
- if not os.path.exists(file_path):
- logger.error('The playbook %s does not exist' % file_path)
- return False
- else:
- return True
-
- def execute_playbook(self, hosts_file, playbook_path, pub_key_file, vars):
- if not self._check_path(hosts_file):
- return False
-
- inventory = Inventory(loader=self.loader, variable_manager=self.variable_manager,
- host_list=hosts_file)
- Options = namedtuple('Options', ['listtags', 'listtasks', 'listhosts', 'syntax',
- 'connection', 'module_path', 'forks', 'remote_user',
- 'private_key_file', 'ssh_common_args', 'ssh_extra_args',
- 'sftp_extra_args', 'scp_extra_args', 'become',
- 'become_method', 'become_user', 'verbosity', 'check'])
- options = Options(listtags=False, listtasks=False, listhosts=False, syntax=False,
- connection='ssh', module_path=None, forks=100, remote_user='root',
- private_key_file=pub_key_file, ssh_common_args=None,
- ssh_extra_args=None, sftp_extra_args=None, scp_extra_args=None,
- become=True, become_method=None, become_user='root', verbosity=None,
- check=False)
- self.variable_manager.extra_vars = vars
-
- self.pbex = PlaybookExecutor(playbooks=[playbook_path], inventory=inventory,
- variable_manager=self.variable_manager, loader=self.loader,
- options=options, passwords=self.passwords)
-
- return self.pbex.run()
-
- def get_detail_playbook_stats(self):
- if self.pbex:
- stats = self.pbex._tqm._stats
- return map(lambda x: (x, stats.summarize(x)), stats.processed.keys())
- else:
- return None
diff --git a/legacy/utils/args_handler.py b/legacy/utils/args_handler.py
deleted file mode 100644
index 993b1035..00000000
--- a/legacy/utils/args_handler.py
+++ /dev/null
@@ -1,73 +0,0 @@
-##############################################################################
-# Copyright (c) 2016 ZTE Corp and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import os
-from operator import add
-import simplejson as json
-from env_setup import Env_setup
-from spawn_vm import SpawnVM
-from driver import Driver
-
-
-def get_files_in_suite(suite_name, case_type='all'):
- benchmark_list = json.load(file('benchmarks/suite/{0}'.format(suite_name)))
- return reduce(add, benchmark_list.values()) \
- if case_type == 'all' else benchmark_list[case_type]
-
-
-def get_files_in_test_plan(lab, suite_name, case_type='all'):
- test_case_all = os.listdir('benchmarks/testplan/{0}/{1}'.format(lab, suite_name))
- return test_case_all if case_type == 'all' else \
- filter(lambda x: case_type in x, test_case_all)
-
-
-def get_benchmark_path(lab, suit, benchmark):
- return 'benchmarks/testplan/{0}/{1}/{2}'.format(lab, suit, benchmark)
-
-
-def check_suite(suite_name):
- return True if os.path.isfile('benchmarks/suite/' + suite_name) else False
-
-
-def check_lab_name(lab_name):
- return True if os.path.isdir('benchmarks/testplan/' + lab_name) else False
-
-
-def check_benchmark_name(lab, file, benchmark):
- return os.path.isfile('benchmarks/testplan/' + lab + '/' + file + '/' + benchmark)
-
-
-def _get_f_name(test_case_path):
- return test_case_path.split('/')[-1]
-
-
-def prepare_ansible_env(benchmark_test_case):
- env_setup = Env_setup()
- [benchmark, vm_info, benchmark_details, proxy_info] = env_setup.parse(benchmark_test_case)
- SpawnVM(vm_info) if len(vm_info) else None
- env_setup.call_ping_test()
- env_setup.call_ssh_test()
- env_setup.update_ansible()
- return benchmark, benchmark_details, proxy_info, env_setup
-
-
-def run_benchmark(installer_type, pwd, benchmark, benchmark_details,
- proxy_info, env_setup, benchmark_test_case):
- driver = Driver()
- result = driver.drive_bench(installer_type, pwd, benchmark,
- env_setup.roles_dict.items(),
- _get_f_name(benchmark_test_case),
- benchmark_details, env_setup.ip_pw_dict.items(), proxy_info)
- env_setup.cleanup_authorized_keys()
- return result
-
-
-def prepare_and_run_benchmark(installer_type, pwd, benchmark_test_case):
- benchmark, benchmark_details, proxy_info, env_setup = prepare_ansible_env(benchmark_test_case)
- return run_benchmark(installer_type, pwd, benchmark, benchmark_details,
- proxy_info, env_setup, benchmark_test_case)
diff --git a/legacy/utils/cli.py b/legacy/utils/cli.py
deleted file mode 100644
index 5e566f27..00000000
--- a/legacy/utils/cli.py
+++ /dev/null
@@ -1,76 +0,0 @@
-##############################################################################
-# Copyright (c) 2015 Dell Inc and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-import sys
-import os
-import args_handler
-import argparse
-import logger_utils
-
-logger = logger_utils.QtipLogger('cli').get
-
-
-class Cli:
-
- @staticmethod
- def _parse_args(args):
- parser = argparse.ArgumentParser()
- parser.add_argument('-l ', '--lab', required=True, help='Name of Lab '
- 'on which being tested, These can'
- 'be found in the benchmarks/testplan/ directory. Please '
- 'ensure that you have edited the respective files '
- 'before using them. For testing other than through Jenkins'
- ' The user should list default after -l . all the fields in'
- ' the files are necessary and should be filled')
- parser.add_argument('-f', '--file', required=True, help='File in '
- 'benchmarks/suite/ with the list of tests. there are three files'
- '\n compute '
- '\n storage '
- '\n network '
- 'They contain all the tests that will be run. They are listed by suite.'
- 'Please ensure there are no empty lines')
- parser.add_argument('-b', '--benchmark', help='Name of the benchmark.'
- 'Can be found in benchmarks/suite/file_name')
-
- return parser.parse_args(args)
-
- def __init__(self, args=sys.argv[1:]):
-
- args = self._parse_args(args)
- if not args_handler.check_suite(args.file):
- logger.error("ERROR: This suite file %s doesn't exist under benchmarks/suite/.\
- Please enter correct file." % str(args.file))
- sys.exit(1)
-
- if not args_handler.check_lab_name(args.lab):
- logger.error("You have specified a lab that is not present under benchmarks/testplan/.\
- Please enter correct file. If unsure how to proceed, use -l default.")
- sys.exit(1)
- suite = args.file
- benchmarks = args_handler.get_files_in_suite(suite)
- test_cases = args_handler.get_files_in_test_plan(args.lab, suite)
- benchmarks_list = filter(lambda x: x in test_cases, benchmarks)
-
- if args.benchmark:
- if not args_handler.check_benchmark_name(args.lab, args.file, args.benchmark):
- logger.error("You have specified an incorrect benchmark.\
- Please enter the correct one.")
- sys.exit(1)
- else:
- logger.info("Starting with " + args.benchmark)
- args_handler.prepare_and_run_benchmark(
- os.environ['INSTALLER_TYPE'], os.environ['PWD'],
- args_handler.get_benchmark_path(args.lab.lower(), args.file, args.benchmark))
- else:
- map(lambda x: args_handler.prepare_and_run_benchmark(
- os.environ['INSTALLER_TYPE'], os.environ['PWD'],
- args_handler.get_benchmark_path(args.lab.lower(), suite, x)), benchmarks_list)
-
- logger.info("{0} is not a Template in the Directory Enter a Valid file name.\
- or use qtip.py -h for list".format(filter(lambda x: x not in test_cases, benchmarks)))
diff --git a/legacy/utils/driver.py b/legacy/utils/driver.py
deleted file mode 100644
index 9894e0f5..00000000
--- a/legacy/utils/driver.py
+++ /dev/null
@@ -1,92 +0,0 @@
-##############################################################################
-# Copyright (c) 2015 Dell Inc, ZTE and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import logger_utils
-from operator import add
-from ansible_api import AnsibleApi
-from os.path import expanduser
-
-logger = logger_utils.QtipLogger('driver').get
-
-
-class Driver:
-
- def __init__(self):
-
- logger.info("Class driver initialized\n")
- self.installer_username = {'fuel': 'root',
- 'joid': 'ubuntu',
- 'apex': 'heat-admin'}
-
- @staticmethod
- def merge_two_dicts(x, y):
- '''
- It is from http://stackoverflow.com/questions/38987/
- how-can-i-merge-two-python-dictionaries-in-a-single-expression
- '''
- z = x.copy()
- z.update(y)
- return z
-
- def get_common_var_json(self, installer_type, pwd, benchmark_fname,
- benchmark_detail, pip_dict, proxy_info):
- common_json = {'Dest_dir': expanduser('~') + '/qtip/results',
- 'ip1': '',
- 'ip2': '',
- 'installer': str(installer_type),
- 'workingdir': str(pwd),
- 'fname': str(benchmark_fname),
- 'username': self.installer_username[str(installer_type)]}
- common_json.update(benchmark_detail) if benchmark_detail else None
- common_json.update(proxy_info) if proxy_info else None
- return common_json
-
- def get_special_var_json(self, role, roles, benchmark_detail, pip_dict):
- special_json = {}
- index = roles.index(role) + 1
- private_ip = pip_dict[0][1] if pip_dict[0][1][0] else 'NONE'
- map(lambda x: special_json.update({'ip' + str(index): x}), role[1])\
- if benchmark_detail and (role[0] == '1-server') else None
- map(lambda x: special_json.update({'privateip' + str(index): private_ip}), role[1])\
- if benchmark_detail and (role[0] == '1-server') else None
- special_json = self.get_special_var_json(filter(lambda x: x[0] == '1-server', roles)[0],
- roles,
- benchmark_detail,
- pip_dict) if role[0] == '2-host' else special_json
- special_json.update({'role': role[0]})
- return special_json
-
- def run_ansible_playbook(self, benchmark, extra_vars):
- logger.info(extra_vars)
- ansible_api = AnsibleApi()
- ansible_api.execute_playbook('./config/hosts',
- './benchmarks/perftest/{0}.yaml'.format(benchmark),
- './config/QtipKey', extra_vars)
- return self.get_ansible_result(extra_vars['role'], ansible_api.get_detail_playbook_stats())
-
- def drive_bench(self, installer_type, pwd, benchmark, roles, benchmark_fname,
- benchmark_detail=None, pip_dict=None, proxy_info=None):
- roles = sorted(roles)
- pip_dict = sorted(pip_dict)
- var_json = self.get_common_var_json(installer_type, pwd, benchmark_fname,
- benchmark_detail, pip_dict, proxy_info)
- result = map(lambda role: self.run_ansible_playbook
- (benchmark, self.merge_two_dicts(var_json,
- self.get_special_var_json(role, roles,
- benchmark_detail,
- pip_dict))), roles)
- return reduce(self._merge_ansible_result, result)
-
- def get_ansible_result(self, role, stats):
- result = reduce(add, map(lambda x: x[1]['failures'] + x[1]['unreachable'], stats))
- return {'result': result,
- 'detail': {role: stats}}
-
- def _merge_ansible_result(self, result_1, result_2):
- return {'result': result_1['result'] + result_2['result'],
- 'detail': self.merge_two_dicts(result_1['detail'], result_2['detail'])}
diff --git a/legacy/utils/env_setup.py b/legacy/utils/env_setup.py
deleted file mode 100644
index 7bbedfcf..00000000
--- a/legacy/utils/env_setup.py
+++ /dev/null
@@ -1,214 +0,0 @@
-##############################################################################
-# Copyright (c) 2016 Dell Inc, ZTE and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import os
-import random
-import socket
-import sys
-import time
-from collections import defaultdict
-from os.path import expanduser
-import paramiko
-import yaml
-import logger_utils
-
-logger = logger_utils.QtipLogger('env_setup').get
-
-
-class Env_setup:
-
- roles_ip_list = [] # ROLE and its corresponding IP address list
- ip_pw_list = [] # IP and password, this will be used to ssh
- roles_dict = defaultdict(list)
- ip_pw_dict = defaultdict(list)
- ip_pip_list = []
- vm_parameters = defaultdict(list)
- benchmark_details = defaultdict()
- benchmark = ''
-
- def __init__(self):
- print '\nParsing class initiated\n'
- self.roles_ip_list[:] = []
- self.ip_pw_list[:] = []
- self.roles_dict.clear()
- self.ip_pw_dict.clear()
- self.ip_pip_list[:] = []
- self.proxy_info = {}
- self.vm_parameters.clear()
- self.benchmark_details.clear()
- self.benchmark = ''
-
- @staticmethod
- def write_to_file(role):
- f_name_2 = open('./config/hosts', 'w')
- print role.items()
- for k in role:
- f_name_2.write('[' + k + ']\n')
- num = len(role[k])
- for x in range(num):
- f_name_2.write(role[k][x] + '\n')
- f_name_2.close()
-
- @staticmethod
- def ssh_test(hosts):
- for ip, pw in hosts:
- logger.info('Beginning SSH Test: %s \n' % ip)
- os.system('ssh-keyscan %s >> /root/.ssh/known_hosts' % ip)
- time.sleep(2)
-
- ssh_cmd = './scripts/qtip_creds.sh %s' % ip
- logger.info("run command: %s " % ssh_cmd)
- os.system(ssh_cmd)
-
- ssh = paramiko.SSHClient()
- ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- ssh.connect(ip, key_filename='./config/QtipKey')
-
- for attempts in range(100):
- try:
- stdin, stdout, stderr = ssh.exec_command('uname')
- if not stderr.readlines():
- logger.info('SSH successful')
- break
- except socket.error:
- logger.error('SSH is still unavailable, retry!')
- time.sleep(2)
- if attempts == 99:
- logger.error("Try 99 times, SSH failed: %s" % ip)
-
- @staticmethod
- def ping_test(lister, attempts=30):
- for k, v in lister.iteritems():
- time.sleep(10)
- for val in v:
- ipvar = val
- ping_cmd = 'ping -D -c1 {0}'.format(ipvar)
- for i in range(attempts):
- if os.system(ping_cmd) != 0:
- print '\nWaiting for machine\n'
- time.sleep(10)
- else:
- break
- print ('\n\n %s is UP \n\n ' % ipvar)
-
- @staticmethod
- def fetch_compute_ips():
- logger.info("Fetch compute ips through installer")
- ips = []
-
- installer_type = str(os.environ['INSTALLER_TYPE'].lower())
- installer_ip = str(os.environ['INSTALLER_IP'])
- if installer_type not in ["fuel", "compass"]:
- raise RuntimeError("%s is not supported" % installer_type)
- if not installer_ip:
- raise RuntimeError("undefine environment variable INSTALLER_IP")
-
- cmd = "bash ./scripts/fetch_compute_ips.sh -i %s -a %s" % \
- (installer_type, installer_ip)
- logger.info(cmd)
- os.system(cmd)
- with open(expanduser('~') + "/qtip/ips.log", "r") as file:
- data = file.read()
- if data:
- ips.extend(data.rstrip('\n').split('\n'))
- logger.info("All compute ips: %s" % ips)
- return ips
-
- def check_machine_ips(self, host_tag):
- logger.info("Check machine ips")
- ips = self.fetch_compute_ips()
- ips_num = len(ips)
- num = len(host_tag)
- if num > ips_num:
- err = "host num %s > compute ips num %s" % (num, ips_num)
- raise RuntimeError(err)
-
- for x in range(num):
- hostlabel = 'machine_' + str(x + 1)
- if host_tag[hostlabel]['ip']:
- if host_tag[hostlabel]['ip'] in ips:
- info = "%s's ip %s is defined by test case yaml file" % \
- (hostlabel, host_tag[hostlabel]['ip'])
- logger.info(info)
- else:
- err = "%s is not in %s" % (host_tag[hostlabel]['ip'], ips)
- raise RuntimeError(err)
- else:
- host_tag[hostlabel]['ip'] = random.choice(ips)
- info = "assign ip %s to %s" % (host_tag[hostlabel]['ip'], hostlabel)
- ips.remove(host_tag[hostlabel]['ip'])
-
- def get_host_machine_info(self, host_tag):
- num = len(host_tag)
- offset = len(self.roles_ip_list)
- self.check_machine_ips(host_tag)
- for x in range(num):
- hostlabel = 'machine_' + str(x + 1)
- self.roles_ip_list.insert(
- offset, (host_tag[hostlabel]['role'], host_tag[hostlabel]['ip']))
- self.ip_pw_list.insert(
- offset, (host_tag[hostlabel]['ip'], host_tag[hostlabel]['pw']))
-
- def get_virtual_machine_info(self, virtual_tag):
-
- num = len(virtual_tag)
- for x in range(num):
- host_label = 'virtualmachine_' + str(x + 1)
- for k, v in virtual_tag[host_label].iteritems():
- self.vm_parameters[k].append(v)
-
- def get_bench_mark_details(self, detail_dic):
-
- print detail_dic
- for k, v in detail_dic.items():
- self.benchmark_details[k] = v
-
- def parse(self, config_file_path):
- try:
- f_name = open(config_file_path, 'r+')
- doc = yaml.safe_load(f_name)
- f_name.close()
- if doc['Scenario']['benchmark']:
- self.benchmark = doc['Scenario']['benchmark']
- if doc['Context']['Virtual_Machines']:
- self.get_virtual_machine_info(doc['Context']['Virtual_Machines'])
- if doc['Context']['Host_Machines']:
- self.get_host_machine_info(doc['Context']['Host_Machines'])
- if doc.get('Scenario', {}).get('benchmark_details', {}):
- self.get_bench_mark_details(doc.get('Scenario', {}).get('benchmark_details', {}))
- if 'Proxy_Environment' in doc['Context'].keys():
- self.proxy_info['http_proxy'] = doc['Context']['Proxy_Environment']['http_proxy']
- self.proxy_info['https_proxy'] = doc['Context']['Proxy_Environment']['https_proxy']
- self.proxy_info['no_proxy'] = doc['Context']['Proxy_Environment']['no_proxy']
- for k, v in self.roles_ip_list:
- self.roles_dict[k].append(v)
- for k, v in self.ip_pw_list:
- self.ip_pw_dict[k].append(v)
- return (
- self.benchmark,
- self.vm_parameters,
- self.benchmark_details.items(),
- self.proxy_info)
- except KeyboardInterrupt:
- print 'ConfigFile Closed: exiting!'
- sys.exit(0)
-
- def update_ansible(self):
- self.write_to_file(self.roles_dict)
-
- def call_ping_test(self):
- self.ping_test(self.roles_dict)
-
- def call_ssh_test(self):
- self.ssh_test(self.ip_pw_list)
-
- def cleanup_authorized_keys(self):
- for ip, pw in self.ip_pw_list:
- cmd = './scripts/cleanup_creds.sh %s' % ip
- logger.info("cleanup authorized_keys: %s " % cmd)
- os.system(cmd)
diff --git a/legacy/utils/transform/dpi_transform.py b/legacy/utils/transform/dpi_transform.py
deleted file mode 100644
index bc837311..00000000
--- a/legacy/utils/transform/dpi_transform.py
+++ /dev/null
@@ -1,55 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import os
-import pickle
-import datetime
-
-sum_dpi_pps = float(0)
-sum_dpi_bps = float(0)
-
-for x in range(1, 11):
- dpi_result_pps = float(
- os.popen(
- "cat $HOME/qtip_result/dpi_dump.txt | grep 'nDPI throughput:' | awk 'NR=='" +
- str(x) +
- " | awk '{print $3}'").read().lstrip())
- dpi_result_bps = float(
- os.popen(
- "cat $HOME/qtip_result/dpi_dump.txt | grep 'nDPI throughput:' | awk 'NR=='" +
- str(x) +
- " | awk '{print $7}'").read().rstrip())
-
- if (dpi_result_pps > 100):
- dpi_result_pps = dpi_result_pps / 1000
-
- if (dpi_result_bps > 100):
- dpi_result_bps = dpi_result_bps / 1000
-
- sum_dpi_pps += dpi_result_pps
- sum_dpi_bps += dpi_result_bps
-
-dpi_result_pps = sum_dpi_pps / 10
-dpi_result_bps = sum_dpi_bps / 10
-
-host = os.popen("hostname").read().rstrip()
-log_time_stamp = str(datetime.datetime.utcnow().isoformat())
-
-os.popen(
- "cat $HOME/qtip_result/dpi_dump.txt > $HOME/qtip_result/" +
- host +
- "-" +
- log_time_stamp +
- ".log")
-
-home_dir = str(os.popen("echo $HOME").read().rstrip())
-host = os.popen("echo $HOSTNAME")
-result = {'pps': round(dpi_result_pps, 3),
- 'bps': round(dpi_result_bps, 3)}
-with open('./result_temp', 'w+') as result_file:
- pickle.dump(result, result_file)
diff --git a/legacy/utils/transform/final_report.py b/legacy/utils/transform/final_report.py
deleted file mode 100644
index 1d7c3001..00000000
--- a/legacy/utils/transform/final_report.py
+++ /dev/null
@@ -1,32 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import pickle
-import json
-import datetime
-import os
-import sys
-
-home_dir = str((os.popen("echo $HOME").read().rstrip()))
-
-with open('./sys_info_temp', 'r') as sys_info_f:
- sys_info_dict = pickle.load(sys_info_f)
-with open('./result_temp', 'r') as result_f:
- result_dict = pickle.load(result_f)
-
-host_name = (os.popen("hostname").read().rstrip())
-benchmark_name = str(sys.argv[1])
-testcase_name = str(sys.argv[2])
-report_time_stamp = str(datetime.datetime.utcnow().isoformat())
-final_dict = {"name": testcase_name,
- "time": report_time_stamp,
- "system_information": sys_info_dict,
- "details": result_dict}
-
-with open('./' + host_name + '-' + report_time_stamp + '.json', 'w+') as result_json:
- json.dump(final_dict, result_json, indent=4, sort_keys=True)
diff --git a/legacy/utils/transform/ramspeed_transform.py b/legacy/utils/transform/ramspeed_transform.py
deleted file mode 100644
index 9aa713ff..00000000
--- a/legacy/utils/transform/ramspeed_transform.py
+++ /dev/null
@@ -1,49 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import os
-import pickle
-import datetime
-
-intmem_copy = os.popen("cat Intmem | grep 'BatchRun Copy' | awk '{print $4}'").read().rstrip()
-intmem_scale = os.popen("cat Intmem | grep 'BatchRun Scale' | awk '{print $4}'").read().rstrip()
-intmem_add = os.popen("cat Intmem | grep 'BatchRun Add' | awk '{print $4}'").read().rstrip()
-intmem_triad = os.popen("cat Intmem | grep 'BatchRun Triad' | awk '{print $4}'").read().rstrip()
-intmem_average = os.popen("cat Intmem | grep 'BatchRun AVERAGE' | awk '{print $4}'").read().rstrip()
-
-print intmem_copy
-print intmem_average
-
-floatmem_copy = os.popen("cat Floatmem | grep 'BatchRun Copy' | awk '{print $4}'").read().rstrip()
-floatmem_scale = os.popen("cat Floatmem | grep 'BatchRun Scale' | awk '{print $4}'").read().rstrip()
-floatmem_add = os.popen("cat Floatmem | grep 'BatchRun Add' | awk '{print $4}'").read().rstrip()
-floatmem_triad = os.popen("cat Floatmem | grep 'BatchRun Triad' | awk '{print $4}'").read().rstrip()
-floatmem_average = os.popen("cat Floatmem | grep 'BatchRun AVERAGE' | awk '{print $4}'").read().rstrip()
-
-print floatmem_copy
-print floatmem_average
-
-hostname = os.popen("hostname").read().rstrip()
-time_stamp = str(datetime.datetime.utcnow().isoformat())
-
-os.system("mv Intmem " + hostname + "-" + time_stamp + ".log")
-os.system("cp Floatmem >> " + hostname + "-" + time_stamp + ".log")
-
-result = {"int_bandwidth": {"copy": intmem_copy,
- "add": intmem_add,
- "scale": intmem_scale,
- "triad": intmem_triad,
- "average": intmem_average},
- "float_bandwidth": {"copy": floatmem_copy,
- "add": floatmem_add,
- "scale": floatmem_scale,
- "triad": floatmem_triad,
- "average": floatmem_average}}
-
-with open('./result_temp', 'w+') as result_file:
- pickle.dump(result, result_file)
diff --git a/legacy/utils/transform/ssl_transform.py b/legacy/utils/transform/ssl_transform.py
deleted file mode 100644
index 24b696e5..00000000
--- a/legacy/utils/transform/ssl_transform.py
+++ /dev/null
@@ -1,62 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import os
-import pickle
-import datetime
-
-openssl_version = os.popen("cat RSA_dump | head -1").read().rstrip()
-rsa_512_sps = os.popen(
- "cat RSA_dump | grep '512 bits ' | awk '{print $6}' ").read().rstrip()
-rsa_512_vps = os.popen(
- "cat RSA_dump | grep '512 bits ' | awk '{print $7}' ").read().rstrip()
-rsa_1024_sps = os.popen(
- "cat RSA_dump | grep '1024 bits ' | awk '{print $6}' ").read().rstrip()
-rsa_1024_vps = os.popen(
- "cat RSA_dump | grep '1024 bits ' | awk '{print $7}' ").read().rstrip()
-rsa_2048_sps = os.popen(
- "cat RSA_dump | grep '2048 bits ' | awk '{print $6}' ").read().rstrip()
-rsa_2048_vps = os.popen(
- "cat RSA_dump | grep '2048 bits ' | awk '{print $7}' ").read().rstrip()
-rsa_4096_sps = os.popen(
- "cat RSA_dump | grep '4096 bits ' | awk '{print $6}' ").read().rstrip()
-rsa_4096_vps = os.popen(
- "cat RSA_dump | grep '4096 bits ' | awk '{print $7}' ").read().rstrip()
-
-aes_16B = os.popen(
- "cat AES-128-CBC_dump | grep 'aes-128-cbc ' | awk '{print $2}' ").read().rstrip()
-aes_64B = os.popen(
- "cat AES-128-CBC_dump | grep 'aes-128-cbc ' | awk '{print $3}' ").read().rstrip()
-aes_256B = os.popen(
- "cat AES-128-CBC_dump | grep 'aes-128-cbc ' | awk '{print $4}' ").read().rstrip()
-aes_1024B = os.popen(
- "cat AES-128-CBC_dump | grep 'aes-128-cbc ' | awk '{print $5}' ").read().rstrip()
-aes_8192B = os.popen(
- "cat AES-128-CBC_dump | grep 'aes-128-cbc ' | awk '{print $6}' ").read().rstrip()
-
-hostname = os.popen("hostname").read().rstrip()
-time_stamp = str(datetime.datetime.utcnow().isoformat())
-
-os.system("mv RSA_dump " + hostname + "-" + time_stamp + ".log")
-os.system("cat AES-128-CBC_dump >> " + hostname + "-" + time_stamp + ".log")
-
-result = {"version": [openssl_version],
- "rsa_sig": {"512_bits": rsa_512_sps,
- "1024_bits": rsa_1024_sps,
- "2048_bits": rsa_2048_sps,
- "4096_bits": rsa_4096_sps,
- "unit": "sig/sec"},
- "aes_128_cbc": {"16B_block": aes_16B,
- "64B_block": aes_64B,
- "256B_block": aes_256B,
- "1024B_block": aes_1024B,
- "8192B_block": aes_8192B,
- "unit": "B/sec"}}
-
-with open('./result_temp', 'w+') as result_file:
- pickle.dump(result, result_file)
diff --git a/legacy/utils/transform/ubench_transform.py b/legacy/utils/transform/ubench_transform.py
deleted file mode 100644
index fe687118..00000000
--- a/legacy/utils/transform/ubench_transform.py
+++ /dev/null
@@ -1,40 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import os
-import json
-import pickle
-
-total_cpu = os.popen(
- "cat $HOME/tempT/UnixBench/results/* | grep 'of tests' | awk '{print $1;}' | awk 'NR==1'").read().rstrip()
-
-cpu_1 = os.popen(
- "cat $HOME/tempT/UnixBench/results/* | grep 'of tests' | awk '{print $6;}' | awk 'NR==1'").read().rstrip()
-
-
-cpu_2 = os.popen(
- "cat $HOME/tempT/UnixBench/results/* | grep 'of tests' | awk '{print $6;}' | awk 'NR==2'").read().rstrip()
-
-
-index_1 = os.popen(
- "cat $HOME/tempT/UnixBench/results/* | grep 'Index Score (Partial Only) ' | awk '{print $7;}' | awk 'NR==1'").read().rstrip()
-index_2 = os.popen(
- "cat $HOME/tempT/UnixBench/results/* | grep 'Index Score (Partial Only) ' | awk '{print $7;}' | awk 'NR==2'").read().rstrip()
-
-
-result = {"n_cpu": total_cpu,
- "single": {"n_para_test": cpu_1,
- "score": index_1},
- "multi": {"n_para_test": cpu_2,
- "score": index_2}
- }
-
-with open('result_temp', 'w+') as result_file:
- pickle.dump(result, result_file)
-print json.dumps(result, indent=4, sort_keys=True)
-# print result.items()