diff options
author | zhihui wu <wu.zhihui1@zte.com.cn> | 2017-05-16 13:56:28 +0800 |
---|---|---|
committer | zhihui wu <wu.zhihui1@zte.com.cn> | 2017-05-16 14:30:51 +0800 |
commit | 740cbf36beff04167473cc293a72b0442b74e701 (patch) | |
tree | 8a3b6f62fdd7d4e5522033f4ed216776931609aa /qtip/driver | |
parent | 1089daee7bbf76a1686b6e1f4fee8dc79b5b7968 (diff) |
delete unuse code in directory /qtip
Change-Id: I6732c7cf572d5b744c3a176ce266b9739e9233fd
Signed-off-by: zhihui wu <wu.zhihui1@zte.com.cn>
Diffstat (limited to 'qtip/driver')
21 files changed, 0 insertions, 910 deletions
diff --git a/qtip/driver/__init__.py b/qtip/driver/__init__.py deleted file mode 100644 index e69de29b..00000000 --- a/qtip/driver/__init__.py +++ /dev/null diff --git a/qtip/driver/ansible_api.py b/qtip/driver/ansible_api.py deleted file mode 100644 index 5c5baffc..00000000 --- a/qtip/driver/ansible_api.py +++ /dev/null @@ -1,58 +0,0 @@ -############################################################################## -# Copyright (c) 2017 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 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 - - -class AnsibleApi(object): - - def __init__(self): - self.variable_manager = VariableManager() - self.loader = DataLoader() - self.passwords = {} - self.playbook_executor = None - - def execute_playbook(self, playbook_path, hosts_file=None, - key_file=None, extra_vars=None): - 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=key_file, - ssh_common_args=None, ssh_extra_args=None, sftp_extra_args=None, - scp_extra_args=None, become=None, become_method=None, - become_user='root', verbosity=None, check=False) - self.variable_manager.extra_vars = extra_vars - - self.playbook_executor = PlaybookExecutor(playbooks=[playbook_path], - inventory=inventory, - variable_manager=self.variable_manager, - loader=self.loader, - options=options, - passwords=self.passwords) - return self.playbook_executor.run() - - def get_detail_playbook_stats(self): - if self.playbook_executor: - stats = self.playbook_executor._tqm._stats - return map(lambda x: (x, stats.summarize(x)), stats.processed.keys()) - else: - return None diff --git a/qtip/driver/ansible_driver.py b/qtip/driver/ansible_driver.py deleted file mode 100644 index 34ef46ed..00000000 --- a/qtip/driver/ansible_driver.py +++ /dev/null @@ -1,102 +0,0 @@ -############################################################################## -# Copyright (c) 2017 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 collections import defaultdict -from os import path -from operator import add - -from qtip.driver.ansible_api import AnsibleApi -from qtip.util.env import AnsibleEnvSetup -from qtip.util.logger import QtipLogger - -logger = QtipLogger('ansible_driver').get -PLAYBOOK_DIR = path.join(path.dirname(__file__), 'playbook') - - -class AnsibleDriver(object): - """driver for running performance tests with Ansible""" - - def __init__(self, config={}): - self.config = config - self.env = AnsibleEnvSetup() - self.env_setup_flag = False - - @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 pre_run(self): - if self.env_setup_flag: - logger.info("Already setup environment......") - else: - logger.info("Starting to setup test environment...") - self.env.setup(self.config) - self.env_setup_flag = True - logger.info("Setup test enviroment, Done!") - - def cleanup(self): - self.env.cleanup() - - def run(self, metric_list, **kwargs): - if 'args' in self.config: - extra_vars = self.merge_two_dicts(kwargs, self.config['args']) - else: - extra_vars = kwargs - logger.info("extra_var: {0}".format(extra_vars)) - - tool_to_metrics = defaultdict(list) - for metric in metric_list: - if metric == 'dhrystone' or metric == 'whetstone': - tool_to_metrics['unixbench'].append(metric) - extra_vars[metric] = True - elif metric == 'ssl': - tool_to_metrics['openssl'].append(metric) - else: - tool_to_metrics[metric].append(metric) - - result_list = map(lambda tool: self._run_metric(tool, - tool_to_metrics[tool], - extra_vars), - tool_to_metrics) - return False not in result_list - - def _run_metric(self, tool, metrics, extra_vars): - logger.info('Using {0} to measure metrics {1}'.format(tool, metrics)) - - setup_pbook = "{0}/{1}/setup.yaml".format(PLAYBOOK_DIR, tool) - run_pbook = "{0}/{1}/run.yaml".format(PLAYBOOK_DIR, tool) - clean_pbook = "{0}/{1}/clean.yaml".format(PLAYBOOK_DIR, tool) - - if self._run_ansible_playbook(setup_pbook, extra_vars): - self._run_ansible_playbook(run_pbook, extra_vars) - else: - logger.error("{0} is failed.".format(setup_pbook)) - - return self._run_ansible_playbook(clean_pbook, extra_vars) - - def _run_ansible_playbook(self, pbook, extra_vars): - ansible_api = AnsibleApi() - logger.debug("Run {0} with extra_vars: {1}".format(pbook, extra_vars)) - ansible_api.execute_playbook(pbook, self.env.hostfile, - self.env.keypair['private'], extra_vars) - playbook_stats = ansible_api.get_detail_playbook_stats() - logger.debug("playbook_stat: {0}".format(playbook_stats)) - return self.is_pass(playbook_stats) - - @staticmethod - def is_pass(stats): - return 0 == reduce(add, - map(lambda x: x[1]['failures'] + x[1]['unreachable'], - stats)) diff --git a/qtip/driver/base.py b/qtip/driver/base.py deleted file mode 100644 index 6f5cab3c..00000000 --- a/qtip/driver/base.py +++ /dev/null @@ -1,20 +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 -############################################################################## - - -class BaseDriver(object): - """performance testing tool driver""" - def pre_run(self): - pass - - def run(self): - pass - - def post_run(self): - pass diff --git a/qtip/driver/playbook/dpi/clean.yaml b/qtip/driver/playbook/dpi/clean.yaml deleted file mode 100644 index 0b9f9291..00000000 --- a/qtip/driver/playbook/dpi/clean.yaml +++ /dev/null @@ -1,23 +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: hosts - become: yes - remote_user: root - - tasks: - - name: Cleaning tempD - file: - path: '{{ ansible_env.HOME }}/tempD' - state: absent - - - name: Cleaning qtip_result - file: - path: '{{ ansible_env.HOME }}/qtip_result' - state: absent diff --git a/qtip/driver/playbook/dpi/dpi_average.sh b/qtip/driver/playbook/dpi/dpi_average.sh deleted file mode 100644 index 6f038053..00000000 --- a/qtip/driver/playbook/dpi/dpi_average.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -COUNTER=0 -WDIR=$PWD -while [ $COUNTER -lt 10 ]; do - echo $WDIR - $( ./ndpiReader -i test.pcap >> $WDIR/dpi_dump.txt ) - let COUNTER=COUNTER+1 - echo "Run number: $COUNTER" -done
\ No newline at end of file diff --git a/qtip/driver/playbook/dpi/run.yaml b/qtip/driver/playbook/dpi/run.yaml deleted file mode 100644 index f4c8c457..00000000 --- a/qtip/driver/playbook/dpi/run.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 -############################################################################## - -- hosts: hosts - become: yes - remote_user: root - - tasks: - - name: Make some directories needed - file: - path: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/dpi/' - state: directory - - - include: ../inxi.yaml - vars: - dest_path: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/dpi/' - - - include: ../top.yaml - vars: - dest_path: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/dpi/' - - - name: Run nDPI benchmark - shell: ./dpi_average.sh - args: - chdir: '{{ ansible_env.HOME }}/tempD/nDPI/example/' - - - name: Copying result and system info to qtip result directory - command: cp $HOME/tempD/nDPI/example/dpi_dump.txt ./ - args: - chdir: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/dpi/' - - - name: Fetch result files to local manchine - synchronize: - mode: pull - src: '{{ ansible_env.HOME }}/qtip_result/' - dest: '{{ result_dir }}/' diff --git a/qtip/driver/playbook/dpi/setup.yaml b/qtip/driver/playbook/dpi/setup.yaml deleted file mode 100644 index 76e62e6d..00000000 --- a/qtip/driver/playbook/dpi/setup.yaml +++ /dev/null @@ -1,93 +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: '{{ result_dir }}/' - state: directory - -- hosts: hosts - become: yes - remote_user: root - - tasks: - - name: Cleaning tempD directory - file: - path: '{{ ansible_env.HOME }}/tempD' - state: absent - - - name: Cleaning qtip_result directory - file: - path: '{{ ansible_env.HOME }}/qtip_result' - state: absent - - - include: ../prepare_env.yaml - - - name: Installing nDPI dependencies if CentOS - yum: - name: '{{ item }}' - state: present - when: ansible_os_family == "RedHat" - with_items: - - git - - gcc - - patch - - perl-Time-HiRes - - autofconf - - automake - - libpcap-devel libtool - - - name: Installing nDPI dependencies if Ubuntu - apt: - name: '{{ item }}' - state: present - when: ansible_os_family == "Debian" - with_items: - - git - - gcc - - patch - - autoconf - - automake - - libpcap-dev - - libtool - - - name: Making nDPI temporary directory - file: - path: '{{ ansible_env.HOME }}/tempD' - state: directory - - - name: Clone nDPI - git: - repo: https://github.com/ntop/nDPI.git - dest: '{{ ansible_env.HOME }}/tempD/nDPI' - - - name: Run autogen && configure Dpi && make Dpi - command: '{{ item }}' - with_items: - - ./autogen.sh - - ./configure - - make - args: - chdir: '{{ ansible_env.HOME }}/tempD/nDPI/' - - - name: Fetching Test_pcap file - get_url: - url: http://build.opnfv.org/artifacts.opnfv.org/qtip/utilities/test.pcap - dest: '{{ ansible_env.HOME }}/tempD/nDPI/example/test.pcap' - - - name: Fetch Averaging script - copy: - src: ./dpi_average.sh - dest: '{{ ansible_env.HOME }}/tempD/nDPI/example' - mode: 777
\ No newline at end of file diff --git a/qtip/driver/playbook/inxi.yaml b/qtip/driver/playbook/inxi.yaml deleted file mode 100644 index 2a4d9b3f..00000000 --- a/qtip/driver/playbook/inxi.yaml +++ /dev/null @@ -1,25 +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 -############################################################################## -- name: Install Inxi when CentOS - yum: - name: inxi - state: present - when: ansible_os_family == "RedHat" - -- name: Install Inxi when Ubuntu - apt: - name: inxi - state: present - update_cache: yes - when: ansible_os_family == "Debian" - -- name: Run inxi - shell: inxi -b -c0 -n > inxi.log - args: - chdir: '{{ dest_path }}' diff --git a/qtip/driver/playbook/openssl/clean.yaml b/qtip/driver/playbook/openssl/clean.yaml deleted file mode 100644 index 0139ba54..00000000 --- a/qtip/driver/playbook/openssl/clean.yaml +++ /dev/null @@ -1,23 +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: hosts - become: yes - remote_user: root - - tasks: - - name: Cleaning Open_SSL - file: - path: '{{ ansible_env.HOME }}/Open_SSL' - state: absent - - - name: Cleaning qtip_result - file: - path: '{{ ansible_env.HOME }}/qtip_result' - state: absent diff --git a/qtip/driver/playbook/openssl/run.yaml b/qtip/driver/playbook/openssl/run.yaml deleted file mode 100644 index db923fed..00000000 --- a/qtip/driver/playbook/openssl/run.yaml +++ /dev/null @@ -1,45 +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: hosts - become: yes - remote_user: root - - tasks: - - name: Make some directories needed - file: - path: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/ssl/' - state: directory - - - include: ../inxi.yaml - vars: - dest_path: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/ssl/' - - - include: ../top.yaml - vars: - dest_path: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/ssl/' - - - name: Benchmarking RSA signatures and AES-128-cbc cipher encryption throughput - shell: '{{ item }}' - with_items: - - ./openssl speed rsa >> RSA_dump - - ./openssl speed -evp aes-128-cbc >> AES-128-CBC_dump - args: - chdir: '{{ ansible_env.HOME }}/Open_SSL/openssl-1.0.2f/apps' - - - name: Copying result to qtip result directory - shell: cp ~/Open_SSL/openssl-1.0.2f/apps/*_dump ./ - args: - chdir: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/ssl/' - - - name: Fetch result files to local manchine - synchronize: - mode: pull - src: '{{ ansible_env.HOME }}/qtip_result/' - dest: '{{ result_dir }}/' diff --git a/qtip/driver/playbook/openssl/setup.yaml b/qtip/driver/playbook/openssl/setup.yaml deleted file mode 100644 index 3a6f385a..00000000 --- a/qtip/driver/playbook/openssl/setup.yaml +++ /dev/null @@ -1,87 +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: '{{ result_dir }}/' - state: directory - -- hosts: hosts - become: yes - remote_user: root - - tasks: - - name: Cleaning Open_SSL directory - file: - path: '{{ ansible_env.HOME }}/Open_SSL' - state: absent - - - name: Cleaning qtip_result directory - file: - path: '{{ ansible_env.HOME }}/qtip_result' - state: absent - - - include: ../prepare_env.yaml - - - name: Installing UnixBench dependencies if CentOS - yum: - name: '{{ item }}' - state: present - when: ansible_os_family == "RedHat" - with_items: - - git - - gcc - - patch - - perl-Time-HiRes - - wget - - autofconf - - automake - - libpcap-devel - - libtool - - - name: Installing UnixBench dependencies if Ubuntu - apt: - name: '{{ item }}' - state: present - when: ansible_os_family == "Debian" - with_items: - - git - - gcc - - patch - - perl - - wget - - autoconf - - automake - - libpcap-dev - - libtool - - - name: Make Open_SSL directory - file: - path: '{{ ansible_env.HOME }}/Open_SSL' - state: directory - - - name: Untar OpenSSL - unarchive: - src: http://artifacts.opnfv.org/qtip/utilities/openssl-1.0.2f.tar.gz - dest: '{{ ansible_env.HOME }}/Open_SSL/' - remote_src: True - - - name: Configure && Make && Install OpenSSL - shell: "{{ item }}" - with_items: - - ./config - - make - - make install - args: - chdir: '{{ ansible_env.HOME }}/Open_SSL/openssl-1.0.2f'
\ No newline at end of file diff --git a/qtip/driver/playbook/prepare_env.yaml b/qtip/driver/playbook/prepare_env.yaml deleted file mode 100644 index 1ec71520..00000000 --- a/qtip/driver/playbook/prepare_env.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 -############################################################################## -- name: Epel Release install when CentOS - yum: - name: epel-release - state: present - when: ansible_os_family == "RedHat" - -- name: Software Properties Common - apt: - name: software-properties-common - state: present - when: ansible_os_family == "Debian" - -- name: Adding ubuntu backport main repo - apt_repository: - repo: deb http://archive.ubuntu.com/ubuntu/ {{ansible_distribution_release}}-backports main restricted universe multiverse - state: present - when: ansible_os_family == "Debian" - -- name: Adding ubuntu main repo - apt_repository: - repo: deb http://archive.ubuntu.com/ubuntu/ {{ansible_distribution_release}} main restricted universe multiverse - when: ansible_os_family == "Debian" - -- name: Install ansible copy dependencies if remote host has selinux enabled - yum: - name: libselinux-python - state: present - when: ansible_os_family == "RedHat" - -- name: Install ansiblle copy dependencies if remote host has selinux enaled - apt: - name: python-selinux - state: present - when: ansible_os_family == "Debian" - -- name: Install rsync when CentOS - yum: - name: rsync - state: present - when: ansible_os_family == "RedHat" - -- name: Install rsync when Ubuntu - apt: - name: rsync - state: present - when: ansible_os_family == "Debian" diff --git a/qtip/driver/playbook/ramspeed/clean.yaml b/qtip/driver/playbook/ramspeed/clean.yaml deleted file mode 100644 index f0188159..00000000 --- a/qtip/driver/playbook/ramspeed/clean.yaml +++ /dev/null @@ -1,23 +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: hosts - become: yes - remote_user: root - - tasks: - - name: Cleaning ramspeed - file: - path: '{{ ansible_env.HOME }}/ramspeed' - state: absent - - - name: Cleaning qtip_result - file: - path: '{{ ansible_env.HOME }}/qtip_result' - state: absent diff --git a/qtip/driver/playbook/ramspeed/run.yaml b/qtip/driver/playbook/ramspeed/run.yaml deleted file mode 100644 index 496cd5db..00000000 --- a/qtip/driver/playbook/ramspeed/run.yaml +++ /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 -############################################################################## - -- hosts: hosts - become: yes - remote_user: root - - tasks: - - name: Make some directories needed - file: - path: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/ramspeed/' - state: directory - - - include: ../inxi.yaml - vars: - dest_path: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/ramspeed/' - - - include: ../top.yaml - vars: - dest_path: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/ramspeed/' - - - name: Benchmarking IntMem Bandwidth and FloatMem Bandwidth - shell: '{{ item }}' - with_items: - - ~/ramspeed/ramsmp-3.5.0/ramsmp -b 3 -l 5 -p 1 >> Intmem - - ~/ramspeed/ramsmp-3.5.0/ramsmp -b 6 -l 5 -p 1 >> Floatmem - args: - chdir: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/ramspeed/' - - - name: Fetch result files to local manchine - synchronize: - mode: pull - src: '{{ ansible_env.HOME }}/qtip_result/' - dest: '{{ result_dir }}/' diff --git a/qtip/driver/playbook/ramspeed/setup.yaml b/qtip/driver/playbook/ramspeed/setup.yaml deleted file mode 100644 index 842bbda2..00000000 --- a/qtip/driver/playbook/ramspeed/setup.yaml +++ /dev/null @@ -1,70 +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: '{{ result_dir }}/' - state: directory - -- hosts: hosts - become: yes - remote_user: root - - tasks: - - name: Cleaning ramspeed directory - file: - path: '{{ ansible_env.HOME }}/ramspeed' - state: absent - - - name: Cleaning qtip_result directory - file: - path: '{{ ansible_env.HOME }}/qtip_result' - state: absent - - - include: ../prepare_env.yaml - - - name: Installing RAM_Speed dependencies if CentOS - yum: - name: '{{ item }}' - state: present - when: ansible_os_family == "RedHat" - with_items: - - gcc - - wget - - - name: Installing RAM_Speed dependencies if Ubuntu - apt: - name: '{{ item }}' - state: present - when: ansible_os_family == "Debian" - with_items: - - gcc - - wget - - - name: Making ramspeed temporary directory - file: - path: '{{ ansible_env.HOME }}/ramspeed' - state: directory - - - name: Fetch and untar ramspeed.tar.gz - unarchive: - # TODO: Need to upload this file to http://artifacts.opnfv.org/qtip/utilities - src: https://docs.google.com/uc?id=0B92Bp5LZTM7gRFctalZLMktTNDQ - dest: '{{ ansible_env.HOME }}/ramspeed/' - remote_src: True - - - name: Build ramsmp - shell: ./build.sh - args: - chdir: '{{ ansible_env.HOME }}/ramspeed/ramsmp-3.5.0' diff --git a/qtip/driver/playbook/unixbench/clean.yaml b/qtip/driver/playbook/unixbench/clean.yaml deleted file mode 100644 index a7cb2540..00000000 --- a/qtip/driver/playbook/unixbench/clean.yaml +++ /dev/null @@ -1,25 +0,0 @@ -############################################################################## -# Copyright (c) 2017 ZTE Corporation and others. -# zhihui.wu1@zte.com.cn -# 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: hosts - become: yes - remote_user: root - - tasks: - - name: Cleaning tempT - file: - path: '{{ ansible_env.HOME }}/tempT' - state: absent - - - name: Cleaning qtip_result - file: - path: '{{ ansible_env.HOME }}/qtip_result' - state: absent - - diff --git a/qtip/driver/playbook/unixbench/dhrystone.yaml b/qtip/driver/playbook/unixbench/dhrystone.yaml deleted file mode 100644 index a0ee89a3..00000000 --- a/qtip/driver/playbook/unixbench/dhrystone.yaml +++ /dev/null @@ -1,41 +0,0 @@ -############################################################################## -# Copyright (c) 2017 ZTE Corporation and others. -# zhihui.wu1@zte.com.cn -# 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 -############################################################################## - -- name: Make dhrystone directories - file: - path: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/dhrystone/' - state: directory - -- include: ../inxi.yaml - vars: - dest_path: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/dhrystone/' - -- include: ../top.yaml - vars: - dest_path: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/dhrystone/' - -- name: Run dhrystone - shell: ./Run -v dhrystone - args: - chdir: '{{ ansible_env.HOME }}/tempT/UnixBench/' - -- name: Copying result to qtip result directory - shell: '{{ item }}' - with_items: - - mv ~/tempT/UnixBench/results/*.log ./ - - mv ~/tempT/UnixBench/results/*.html ./ - - mv ~/tempT/UnixBench/results/* ./dhrystone - args: - chdir: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/dhrystone/' - -- name: Fetch dhrystone result files to local manchine - synchronize: - mode: pull - src: '{{ ansible_env.HOME }}/qtip_result/' - dest: '{{ result_dir }}/' diff --git a/qtip/driver/playbook/unixbench/run.yaml b/qtip/driver/playbook/unixbench/run.yaml deleted file mode 100644 index fbe4d4ad..00000000 --- a/qtip/driver/playbook/unixbench/run.yaml +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################## -# Copyright (c) 2017 ZTE Corporation and others. -# zhihui.wu1@zte.com.cn -# 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: hosts - become: yes - remote_user: root - - tasks: - - set_fact: - is_dhrystone: "{{ dhrystone | default(False) }}" - is_whetstone: "{{ whetstone | default(False) }}" - - - include: ./dhrystone.yaml - when: "{{ is_dhrystone }}" - - - include: ./whetstone.yaml - when: "{{ is_whetstone }}"
\ No newline at end of file diff --git a/qtip/driver/playbook/unixbench/setup.yaml b/qtip/driver/playbook/unixbench/setup.yaml deleted file mode 100644 index 4dcdd2c4..00000000 --- a/qtip/driver/playbook/unixbench/setup.yaml +++ /dev/null @@ -1,65 +0,0 @@ -############################################################################# -# Copyright (c) 2017 ZTE Corporation and others. -# zhihui.wu1@zte.com.cn -# 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: '{{ result_dir }}/' - state: directory - -- hosts: hosts - become: yes - remote_user: root - - tasks: - - name: Cleaning tempT directory - file: - path: '{{ ansible_env.HOME }}/tempT' - state: absent - - - name: Cleaning qtip_result directory - file: - path: '{{ ansible_env.HOME }}/qtip_result' - state: absent - - - include: ../prepare_env.yaml - - - name: Installing UnixBench dependencies if CentOS - yum: - name: '{{ item }}' - state: present - when: ansible_os_family == "RedHat" - with_items: - - git - - gcc - - patch - - perl-Time-HiRes - - - name: Installing UnixBench dependencies if Ubuntu - apt: - name: '{{ item }}' - state: present - when: ansible_os_family == "Debian" - with_items: - - git - - gcc - - patch - - perl - - - name: Clone UnixBench - git: - repo: https://github.com/kdlucas/byte-unixbench.git - dest: '{{ ansible_env.HOME }}/tempT/' - - - name: Make UnixBench1 - shell: make --directory $HOME/tempT/UnixBench/
\ No newline at end of file diff --git a/qtip/driver/playbook/unixbench/whetstone.yaml b/qtip/driver/playbook/unixbench/whetstone.yaml deleted file mode 100644 index c753779f..00000000 --- a/qtip/driver/playbook/unixbench/whetstone.yaml +++ /dev/null @@ -1,41 +0,0 @@ -############################################################################## -# Copyright (c) 2017 ZTE Corporation and others. -# zhihui.wu1@zte.com.cn -# 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 -############################################################################## - -- name: Make whetstone directories - file: - path: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/whetstone/' - state: directory - -- include: ../inxi.yaml - vars: - dest_path: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/whetstone/' - -- include: ../top.yaml - vars: - dest_path: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/whetstone/' - -- name: Run whetstone - shell: ./Run -v whetstone - args: - chdir: '{{ ansible_env.HOME }}/tempT/UnixBench/' - -- name: Copying result to qtip result directory - shell: '{{ item }}' - with_items: - - mv ~/tempT/UnixBench/results/*.log ./ - - mv ~/tempT/UnixBench/results/*.html ./ - - mv ~/tempT/UnixBench/results/* ./whetstone - args: - chdir: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/whetstone/' - -- name: Fetch whetstone result files to local manchine - synchronize: - mode: pull - src: '{{ ansible_env.HOME }}/qtip_result/' - dest: '{{ result_dir }}/' |