aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.rst79
-rw-r--r--config/QtipKey (renamed from data/QtipKey)0
-rw-r--r--config/QtipKey.pub (renamed from data/QtipKey.pub)0
-rw-r--r--config/SampleHeat.yaml (renamed from heat/SampleHeat.yaml)0
-rwxr-xr-xdata/file_permission.sh3
-rwxr-xr-xdocker/run_qtip.sh12
-rw-r--r--docs/configguide/configuration.rst2
-rw-r--r--func/driver.py4
-rw-r--r--func/env_setup.py20
-rw-r--r--func/spawn_vm.py8
-rw-r--r--qtip.py2
-rwxr-xr-xscripts/fetch_compute_ips.sh (renamed from data/fetch_compute_ips.sh)0
-rwxr-xr-xscripts/fetch_os_creds.sh (renamed from data/fetch_os_creds.sh)0
-rwxr-xr-xscripts/file_permission.sh3
-rwxr-xr-xscripts/get_env_info.sh (renamed from get_env_info.sh)2
-rwxr-xr-xscripts/qtip_creds.sh (renamed from data/qtip_creds.sh)14
-rw-r--r--scripts/ref_results/__init__.py (renamed from data/__init__.py)0
-rw-r--r--scripts/ref_results/compute_benchmarks_indices.py (renamed from data/ref_results/compute_benchmarks_indices.py)0
-rw-r--r--scripts/ref_results/generator_ref_json.py (renamed from data/ref_results/generator_ref_json.py)0
-rw-r--r--scripts/ref_results/index_calculation.py (renamed from data/ref_results/index_calculation.py)2
-rw-r--r--scripts/ref_results/network_benchmarks_indices.py (renamed from data/ref_results/network_benchmarks_indices.py)0
-rw-r--r--scripts/ref_results/reference.json (renamed from data/ref_results/reference.json)0
-rw-r--r--scripts/ref_results/result_accum.py (renamed from data/ref_results/result_accum.py)0
-rw-r--r--scripts/ref_results/storage_benchmarks_indices.py (renamed from data/ref_results/storage_benchmarks_indices.py)0
-rw-r--r--scripts/ref_results/suite_result.py (renamed from data/ref_results/suite_result.py)0
-rw-r--r--scripts/ssh_exch.exp (renamed from data/ssh_exch.exp)0
-rw-r--r--setup.py2
-rw-r--r--supporting/servers/ansible.cfg3
-rw-r--r--supporting/servers/elk.yml4
-rw-r--r--supporting/servers/inventory4
-rw-r--r--supporting/servers/roles/elk/defaults/main.yml4
-rw-r--r--supporting/servers/roles/elk/handlers/main.yml8
-rw-r--r--supporting/servers/roles/elk/tasks/main.yml60
-rw-r--r--supporting/servers/roles/elk/templates/elk.conf.j214
-rw-r--r--supporting/servers/roles/ssh/defaults/main.yml5
-rw-r--r--supporting/servers/roles/ssh/files/serena.authorized_keys1
-rw-r--r--supporting/servers/roles/ssh/files/taseer.authorized_keys1
-rw-r--r--supporting/servers/roles/ssh/files/yujunz.authorized_keys1
-rw-r--r--supporting/servers/roles/ssh/tasks/main.yml26
-rw-r--r--supporting/servers/ssh.yml4
-rw-r--r--tests/ansible_api_test.py2
-rw-r--r--tests/cli_test.py8
-rw-r--r--tests/env_setup_test.py2
-rw-r--r--tests/qtip_server_test.py4
-rw-r--r--utils/report/Qtip_Report.py (renamed from data/report/Qtip_Report.py)0
-rw-r--r--utils/report/__init__.py (renamed from data/ref_results/__init__.py)0
-rw-r--r--utils/report/get_indices.py (renamed from data/report/get_indices.py)0
-rw-r--r--utils/report/get_results.py (renamed from data/report/get_results.py)0
-rw-r--r--utils/report/qtip_graph.py (renamed from data/report/qtip_graph.py)0
49 files changed, 259 insertions, 45 deletions
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
new file mode 100644
index 00000000..d3e21b80
--- /dev/null
+++ b/CONTRIBUTING.rst
@@ -0,0 +1,79 @@
+####################
+Contributing to QTIP
+####################
+
+First of all, thanks for taking your time to contribute.
+
+QTIP is a project in OPNFV. If you are new to OPNFV, you may read
+:title:`Developer Getting Started`_ first.
+
+***********
+Peer Review
+***********
+
+Peer review is the most important communication channel between developers.
+Every subtle change to the code or document **MUST** be reviewed before
+submission.
+
+Please make sure there is at least one ``+1`` or ``+2`` from others before
+submitting[#f1] a patch set.
+
+****************
+Tasks and Issues
+****************
+
+Tasks and issues are management in `JIRA`_. The usage of different
+:title:`Issue Types`_ in QTIP are as following:
+
+* ``Task``: it must be achievable in **one sprint**, otherwise it needs to be split.
+* ``Sub-Task``: it must be resolvable by **one developer** within **one sprint**,
+otherwise it need to be split.
+
+``Bug``, ``New Feature``, ``Improvement``, ``Story`` and ``Epic`` are not
+restricted by time frame. But it is recommended to to define the scope clearly
+and break down into manageable tasks.
+
+*****************
+Development Cycle
+*****************
+
+QTIP follows the cycle of `OPNFV Releases`_ which is approximately one release
+every half year.
+
+The tasks are organized by sprints, three weeks for each.
+
+The target and content of each sprint is discussed in weekly meeting.
+
+************
+Coding Style
+************
+
+QTIP follows :title:`OpenStack Style Guidelines`_ for source code and commit message.
+
+Specially, it is recommended to link each patch set with a JIRA issue. Put
+
+ JIRA: QTIP-n
+
+in commit message to create an automatic link.
+
+************************
+Frequent Asked Questions
+************************
+
+Q: May I work on task which have already been assigned to others?
+A: Yes. But please make sure you have contacted the original assignee to avoid
+overlapping.
+
+.. rubric:: Footnotes
+
+.. [#f1] only members in ``ldap/opnfv-gerrit-qtip-submitters`` have permission
+to submit. The current members are listed in `INFO`_.
+
+.. rubric:: Reference
+
+.. _Developer Getting Started: https://wiki.opnfv.org/display/DEV/Developer+Getting+Started
+.. _JIRA: https://jira.opnfv.org/browse/QTIP
+.. _OPNFV Releases: https://wiki.opnfv.org/display/SWREL
+.. _Issue Types: https://jira.opnfv.org/secure/ShowConstantsHelp.jspa?decorator=popup#IssueTypes
+.. _OpenStack Style Guidelines: http://docs.openstack.org/developer/hacking/
+.. _INFO: https://git.opnfv.org/cgit/qtip/tree/INFO \ No newline at end of file
diff --git a/data/QtipKey b/config/QtipKey
index 3f520775..3f520775 100644
--- a/data/QtipKey
+++ b/config/QtipKey
diff --git a/data/QtipKey.pub b/config/QtipKey.pub
index 7a40f91c..7a40f91c 100644
--- a/data/QtipKey.pub
+++ b/config/QtipKey.pub
diff --git a/heat/SampleHeat.yaml b/config/SampleHeat.yaml
index ae9f5667..ae9f5667 100644
--- a/heat/SampleHeat.yaml
+++ b/config/SampleHeat.yaml
diff --git a/data/file_permission.sh b/data/file_permission.sh
deleted file mode 100755
index 01a77d50..00000000
--- a/data/file_permission.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/bash
-chmod 0600 data/QtipKey
-chmod 0600 data/QtipKey.pub
diff --git a/docker/run_qtip.sh b/docker/run_qtip.sh
index d766d46c..62f97c88 100755
--- a/docker/run_qtip.sh
+++ b/docker/run_qtip.sh
@@ -3,21 +3,21 @@ run_test_suite()
{
if [ "$TEST_CASE" == "compute" ]; then
cd ${QTIP_DIR} && python qtip.py -l default -f compute
- cd ${QTIP_DIR} && python data/ref_results/suite_result.py compute
+ cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py compute
elif [ "$TEST_CASE" == "storage" ]; then
cd ${QTIP_DIR} && python qtip.py -l default -f storage
- cd ${QTIP_DIR} && python data/ref_results/suite_result.py storage
+ cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py storage
elif [ "$TEST_CASE" == "network" ]; then
cd ${QTIP_DIR} && python qtip.py -l default -f network
- cd ${QTIP_DIR} && python data/ref_results/suite_result.py network
+ cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py network
elif [ "$TEST_CASE" == "all" ]; then
cd ${QTIP_DIR} && python qtip.py -l default -f compute
cd ${QTIP_DIR} && python qtip.py -l default -f storage
cd ${QTIP_DIR} && python qtip.py -l default -f network
- cd ${QTIP_DIR} && python data/ref_results/suite_result.py compute
- cd ${QTIP_DIR} && python data/ref_results/suite_result.py storage
- cd ${QTIP_DIR} && python data/ref_results/suite_result.py network
+ cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py compute
+ cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py storage
+ cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py network
fi
}
diff --git a/docs/configguide/configuration.rst b/docs/configguide/configuration.rst
index 5d03de04..a9bb6b1a 100644
--- a/docs/configguide/configuration.rst
+++ b/docs/configguide/configuration.rst
@@ -94,7 +94,7 @@ QTIP default key pair
""""""""""""""""""""""
QTIP uses a SSH key pair to connect to the guest image. This key pair can
-be found in the ``data/`` directory.
+be found in the ``config/`` directory.
Hardware configuration
diff --git a/func/driver.py b/func/driver.py
index bcda0ce1..9a011c2a 100644
--- a/func/driver.py
+++ b/func/driver.py
@@ -64,9 +64,9 @@ class Driver:
def run_ansible_playbook(self, benchmark, extra_vars):
logger.info(extra_vars)
ansible_api = AnsibleApi()
- ansible_api.execute_playbook('./data/hosts',
+ ansible_api.execute_playbook('./config/hosts',
'./benchmarks/playbooks/{0}.yaml'.format(benchmark),
- './data/QtipKey', extra_vars)
+ './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,
diff --git a/func/env_setup.py b/func/env_setup.py
index ca83f040..9e21a5b6 100644
--- a/func/env_setup.py
+++ b/func/env_setup.py
@@ -46,7 +46,7 @@ class Env_setup:
@staticmethod
def write_to_file(role):
- f_name_2 = open('./data/hosts', 'w')
+ f_name_2 = open('./config/hosts', 'w')
print role.items()
for k in role:
f_name_2.write('[' + k + ']\n')
@@ -58,29 +58,29 @@ class Env_setup:
@staticmethod
def ssh_test(hosts):
for ip, pw in hosts:
- print '\nBeginning SSH Test: %s \n' % ip
- os.system('ssh-keyscan %s >> ~/.ssh/known_hosts' % ip)
+ logger.info('Beginning SSH Test: %s \n' % ip)
+ os.system('ssh-keyscan %s >> /root/.ssh/known_hosts' % ip)
time.sleep(2)
- ssh_cmd = './data/qtip_creds.sh %s' % ip
- print "run command: %s " % ssh_cmd
+ 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='./data/QtipKey')
+ ssh.connect(ip, key_filename='./config/QtipKey')
for attempts in range(100):
try:
stdin, stdout, stderr = ssh.exec_command('uname')
if not stderr.readlines():
- print('SSH successful')
+ logger.info('SSH successful')
break
except socket.error:
- print 'SSH is still unavailable, retry!'
+ logger.error('SSH is still unavailable, retry!')
time.sleep(2)
if attempts == 99:
- print "Try 99 times, SSH failed: %s" % ip
+ logger.error("Try 99 times, SSH failed: %s" % ip)
@staticmethod
def ping_test(lister, attempts=30):
@@ -109,7 +109,7 @@ class Env_setup:
if not installer_ip:
raise RuntimeError("undefine environment variable INSTALLER_IP")
- cmd = "bash ./data/fetch_compute_ips.sh -i %s -a %s" % \
+ cmd = "bash ./scripts/fetch_compute_ips.sh -i %s -a %s" % \
(installer_type, installer_ip)
logger.info(cmd)
os.system(cmd)
diff --git a/func/spawn_vm.py b/func/spawn_vm.py
index c45af00e..3a16e02d 100644
--- a/func/spawn_vm.py
+++ b/func/spawn_vm.py
@@ -65,15 +65,15 @@ class SpawnVM(Env_setup):
def heat_template_vm(self, vm_params, installer):
Heat_Dic = {}
try:
- with open('./heat/SampleHeat.yaml', 'r+') as H_temp:
+ with open('./config/SampleHeat.yaml', 'r+') as H_temp:
Heat_Dic = yaml.safe_load(H_temp)
except yaml.YAMLError as exc:
if hasattr(exc, 'problem_mark'):
mark = exc.problem_mark
- print 'Error in qtip/heat/SampleHeat.yaml at: (%s,%s)' % (mark.line + 1, mark.column + 1)
+ print 'Error in qtip/config/SampleHeat.yaml at: (%s,%s)' % (mark.line + 1, mark.column + 1)
print 'EXITING PROGRAM. Correct File and restart'
sys.exit(1)
- fopen = open('./data/QtipKey.pub', 'r')
+ fopen = open('./config/QtipKey.pub', 'r')
fopenstr = fopen.read()
fopenstr = fopenstr.rstrip()
scriptcmd = '#!/bin/bash \n echo {0} >> foo.txt \n echo {1} >> /root/.ssh/authorized_keys'.format(
@@ -243,7 +243,7 @@ class SpawnVM(Env_setup):
if i['output_key'] == 'KeyPair_PublicKey':
sshkey = str(i['output_value'])
- with open('./data/my_key.pem', 'w') as fopen:
+ with open('./config/my_key.pem', 'w') as fopen:
fopen.write(sshkey)
fopen.close()
print Env_setup.ip_pw_list
diff --git a/qtip.py b/qtip.py
index 38130955..493f014e 100644
--- a/qtip.py
+++ b/qtip.py
@@ -11,7 +11,7 @@ import os
def main():
- os.system('./data/file_permission.sh')
+ os.system('./scripts/file_permission.sh')
Cli()
diff --git a/data/fetch_compute_ips.sh b/scripts/fetch_compute_ips.sh
index ebe817a6..ebe817a6 100755
--- a/data/fetch_compute_ips.sh
+++ b/scripts/fetch_compute_ips.sh
diff --git a/data/fetch_os_creds.sh b/scripts/fetch_os_creds.sh
index 3b493e14..3b493e14 100755
--- a/data/fetch_os_creds.sh
+++ b/scripts/fetch_os_creds.sh
diff --git a/scripts/file_permission.sh b/scripts/file_permission.sh
new file mode 100755
index 00000000..a8af957e
--- /dev/null
+++ b/scripts/file_permission.sh
@@ -0,0 +1,3 @@
+#! /bin/bash
+chmod 0600 config/QtipKey
+chmod 0600 config/QtipKey.pub
diff --git a/get_env_info.sh b/scripts/get_env_info.sh
index 2fb0d22b..4b362fac 100755
--- a/get_env_info.sh
+++ b/scripts/get_env_info.sh
@@ -34,4 +34,4 @@ if [ $INSTALLER_TYPE == "apex" ]
fi
-./data/fetch_os_creds.sh -d ./opnfv-creds.sh
+./scripts/fetch_os_creds.sh -d ./opnfv-creds.sh
diff --git a/data/qtip_creds.sh b/scripts/qtip_creds.sh
index beb4659f..94d9133c 100755
--- a/data/qtip_creds.sh
+++ b/scripts/qtip_creds.sh
@@ -1,4 +1,4 @@
-#! /bin/bash
+! /bin/bash
DEST_IP=$1
echo $INSTALLER_TYPE
@@ -6,21 +6,21 @@ echo $INSTALLER_IP
sshoptions="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
case "$INSTALLER_TYPE" in
apex)
- scp $sshoptions -i $APEX_KEY ./data/QtipKey.pub stack@$INSTALLER_IP:/home/stack
- scp $sshoptions -i $APEX_KEY ./data/QtipKey stack@$INSTALLER_IP:/home/stack
+ scp $sshoptions -i $APEX_KEY ./config/QtipKey.pub stack@$INSTALLER_IP:/home/stack
+ scp $sshoptions -i $APEX_KEY ./config/QtipKey stack@$INSTALLER_IP:/home/stack
ssh $sshoptions -i $APEX_KEY stack@$INSTALLER_IP "ssh-copy-id $sshoptions -i /home/stack/QtipKey.pub heat-admin@$DEST_IP && rm -rf /home/stack/QtipKey && rm -rf /home/stack/QtipKey.pub"
;;
fuel)
PSWD="r00tme"
- sshpass -p $PSWD scp $sshoptions ./data/QtipKey.pub root@$INSTALLER_IP:/root
- sshpass -p $PSWD scp $sshoptions ./data/QtipKey root@$INSTALLER_IP:/root
+ sshpass -p $PSWD scp $sshoptions ./config/QtipKey.pub root@$INSTALLER_IP:/root
+ sshpass -p $PSWD scp $sshoptions ./config/QtipKey root@$INSTALLER_IP:/root
sshpass -p $PSWD ssh $sshoptions root@$INSTALLER_IP "grep -q '\-F /dev/null ' /usr/bin/ssh-copy-id || sed -i 's/\(ssh -i.*$\)/\1\n -F \/dev\/null \\\/g' `which ssh-copy-id`"
sshpass -p $PSWD ssh $sshoptions root@$INSTALLER_IP "ssh-copy-id $sshoptions -i /root/QtipKey root@$DEST_IP && rm -rf /root/QtipKey && rm -rf /root/QtipKey.pub"
;;
compass)
PSWD="root"
- sshpass -p $PSWD scp $sshoptions ./data/QtipKey.pub root@$INSTALLER_IP:/root
- sshpass -p $PSWD scp $sshoptions ./data/QtipKey root@$INSTALLER_IP:/root
+ sshpass -p $PSWD scp $sshoptions ./config/QtipKey.pub root@$INSTALLER_IP:/root
+ sshpass -p $PSWD scp $sshoptions ./config/QtipKey root@$INSTALLER_IP:/root
sshpass -p $PSWD ssh $sshoptions root@$INSTALLER_IP "ssh-copy-id $sshoptions -i /root/QtipKey.pub root@$DEST_IP && rm -rf /root/QtipKey && rm -rf /root/QtipKey.pub"
;;
joid)
diff --git a/data/__init__.py b/scripts/ref_results/__init__.py
index e69de29b..e69de29b 100644
--- a/data/__init__.py
+++ b/scripts/ref_results/__init__.py
diff --git a/data/ref_results/compute_benchmarks_indices.py b/scripts/ref_results/compute_benchmarks_indices.py
index 9012cefc..9012cefc 100644
--- a/data/ref_results/compute_benchmarks_indices.py
+++ b/scripts/ref_results/compute_benchmarks_indices.py
diff --git a/data/ref_results/generator_ref_json.py b/scripts/ref_results/generator_ref_json.py
index 6b2d813c..6b2d813c 100644
--- a/data/ref_results/generator_ref_json.py
+++ b/scripts/ref_results/generator_ref_json.py
diff --git a/data/ref_results/index_calculation.py b/scripts/ref_results/index_calculation.py
index 5ca4a46e..4ead79ff 100644
--- a/data/ref_results/index_calculation.py
+++ b/scripts/ref_results/index_calculation.py
@@ -13,7 +13,7 @@ def compute_index(total_measured, ref_result, count):
def get_reference(*args):
- with open('data/ref_results/reference.json') as reference_file:
+ with open('scripts/ref_results/reference.json') as reference_file:
reference_djson = json.load(reference_file)
for arg in args:
ref_n = reference_djson.get(str(arg))
diff --git a/data/ref_results/network_benchmarks_indices.py b/scripts/ref_results/network_benchmarks_indices.py
index c19d18eb..c19d18eb 100644
--- a/data/ref_results/network_benchmarks_indices.py
+++ b/scripts/ref_results/network_benchmarks_indices.py
diff --git a/data/ref_results/reference.json b/scripts/ref_results/reference.json
index cfcbfc3b..cfcbfc3b 100644
--- a/data/ref_results/reference.json
+++ b/scripts/ref_results/reference.json
diff --git a/data/ref_results/result_accum.py b/scripts/ref_results/result_accum.py
index 6cd55886..6cd55886 100644
--- a/data/ref_results/result_accum.py
+++ b/scripts/ref_results/result_accum.py
diff --git a/data/ref_results/storage_benchmarks_indices.py b/scripts/ref_results/storage_benchmarks_indices.py
index a5aef638..a5aef638 100644
--- a/data/ref_results/storage_benchmarks_indices.py
+++ b/scripts/ref_results/storage_benchmarks_indices.py
diff --git a/data/ref_results/suite_result.py b/scripts/ref_results/suite_result.py
index d0b4647f..d0b4647f 100644
--- a/data/ref_results/suite_result.py
+++ b/scripts/ref_results/suite_result.py
diff --git a/data/ssh_exch.exp b/scripts/ssh_exch.exp
index c52140b7..c52140b7 100644
--- a/data/ssh_exch.exp
+++ b/scripts/ssh_exch.exp
diff --git a/setup.py b/setup.py
index 52874dd3..85dc966b 100644
--- a/setup.py
+++ b/setup.py
@@ -7,4 +7,4 @@ setup(name='qtip',
py_modules=['qtip'],
version='1.0',
author='opnfv',
- packages=['func', 'data.ref_results', 'data.report'])
+ packages=['func', 'scripts.ref_results', 'utils.report'])
diff --git a/supporting/servers/ansible.cfg b/supporting/servers/ansible.cfg
new file mode 100644
index 00000000..93022c4e
--- /dev/null
+++ b/supporting/servers/ansible.cfg
@@ -0,0 +1,3 @@
+[defaults]
+hostfile = inventory
+host_key_checking = False \ No newline at end of file
diff --git a/supporting/servers/elk.yml b/supporting/servers/elk.yml
new file mode 100644
index 00000000..406ba93f
--- /dev/null
+++ b/supporting/servers/elk.yml
@@ -0,0 +1,4 @@
+---
+- hosts: elk-servers
+ roles:
+ - elk
diff --git a/supporting/servers/inventory b/supporting/servers/inventory
new file mode 100644
index 00000000..aa9388fe
--- /dev/null
+++ b/supporting/servers/inventory
@@ -0,0 +1,4 @@
+qtip-dev ansible_host=qtip
+
+[elk-servers]
+qtip-dev \ No newline at end of file
diff --git a/supporting/servers/roles/elk/defaults/main.yml b/supporting/servers/roles/elk/defaults/main.yml
new file mode 100644
index 00000000..855fc7ea
--- /dev/null
+++ b/supporting/servers/roles/elk/defaults/main.yml
@@ -0,0 +1,4 @@
+---
+services:
+ - { name: kibana, upstream: 'http://127.0.0.1:5601' }
+ - { name: elastic, upstream: 'http://127.0.0.1:9200' }
diff --git a/supporting/servers/roles/elk/handlers/main.yml b/supporting/servers/roles/elk/handlers/main.yml
new file mode 100644
index 00000000..46bd76c7
--- /dev/null
+++ b/supporting/servers/roles/elk/handlers/main.yml
@@ -0,0 +1,8 @@
+---
+- name: starting docker service
+ become: true
+ service: name=docker state=started
+
+- name: restart nginx
+ become: true
+ service: name=nginx state=restarted
diff --git a/supporting/servers/roles/elk/tasks/main.yml b/supporting/servers/roles/elk/tasks/main.yml
new file mode 100644
index 00000000..7628f378
--- /dev/null
+++ b/supporting/servers/roles/elk/tasks/main.yml
@@ -0,0 +1,60 @@
+---
+- name: adding keys
+ become: true
+ apt_key: keyserver=hkp://p80.pool.sks-keyservers.net id=0X58118E89F3A912897C070ADBF76221572C52609D
+
+- name: adding entry for ubuntu
+ become: true
+ apt_repository: repo='deb https://apt.dockerproject.org/repo ubuntu-xenial main' state=present filename='docker'
+ when: ansible_distribution == "Ubuntu" and ansible_distribution_version == "16.04"
+
+- name: installing from docker repo
+ become: true
+ shell: apt-cache policy docker-engine
+ when: ansible_distribution == "Ubuntu" and ansible_distribution_version== "16.04"
+
+- name: adding entry for ubuntu
+ become: true
+ apt_repository: repo='deb https://apt.dockerproject.org/repo ubuntu-trusty main' state=present filename='docker'
+ when: ansible_distribution == "Ubuntu" and ansible_distribution_version == "14.04"
+
+- name: updating
+ become: true
+ apt: update_cache=yes
+
+- name: installing docker engine
+ become: true
+ apt: name=docker-engine
+
+- name: pulling elasticsearch and kibana
+ become: true
+ docker_image: name={{ item }} state=present
+ with_items:
+ - elasticsearch
+ - kibana
+
+- name: setting up elasticsearch
+ become: true
+ docker_container:
+ name: esearch
+ image: elasticsearch
+ published_ports: 9200:9200
+
+- name: setting up kibana
+ become: true
+ docker_container:
+ name: kibana
+ image: kibana
+ published_ports: 5601:5601
+ links: esearch:elasticsearch
+
+- name: nginx is installed
+ become: true
+ package: name=nginx state=present
+- name: qtip server configuration is generated
+ become: true
+ template: src={{ item }}.conf.j2 dest=/etc/nginx/sites-enabled/{{ item }}.conf
+ with_items:
+ - elk
+ notify:
+ - restart nginx
diff --git a/supporting/servers/roles/elk/templates/elk.conf.j2 b/supporting/servers/roles/elk/templates/elk.conf.j2
new file mode 100644
index 00000000..271690e0
--- /dev/null
+++ b/supporting/servers/roles/elk/templates/elk.conf.j2
@@ -0,0 +1,14 @@
+# {{ ansible_managed }}
+
+# servers
+#
+{% for service in services %}
+server {
+ listen 80;
+ listen 443 ssl;
+ server_name {{ service.name }}.qtip.openzero.net;
+ location / {
+ proxy_pass {{ service.upstream }};
+ }
+}
+{% endfor %}
diff --git a/supporting/servers/roles/ssh/defaults/main.yml b/supporting/servers/roles/ssh/defaults/main.yml
new file mode 100644
index 00000000..59dfd086
--- /dev/null
+++ b/supporting/servers/roles/ssh/defaults/main.yml
@@ -0,0 +1,5 @@
+---
+users:
+ - { name: yujunz, comment: "Yujun Zhang <zhang.yujunz@zte.com.cn>" }
+ - { name: taseer, comment: "Taseer Ahmed <taseer94@gmail.com>" }
+ - { name: serena, comment: "Serena Feng <feng.xiaowei@zte.com.cn>" }
diff --git a/supporting/servers/roles/ssh/files/serena.authorized_keys b/supporting/servers/roles/ssh/files/serena.authorized_keys
new file mode 100644
index 00000000..5cdbfe00
--- /dev/null
+++ b/supporting/servers/roles/ssh/files/serena.authorized_keys
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYlLrMOPxwLNQvLpxXVLYXQCxNkaKfVWt7u9k+6T0SU7VNuT8e1VoTk6b/iVWyXQ4j1hW4sNroTucqZjl+8V2z2nYgpEMIy6jBuehlKP2LJ9v/p98/OBVVxgEnRJGzFYIeO/GKBLMaUu43OkCO2Ef67qKeISeNP5/ewUR12YCUHQg5GkGYnDL3fFd7SiVDkYPEXQvHfi85beGOuPwDTjbKoKbF9WATIIzJSPUmslGjFRpKqM8AQLGWEyTeklU7H4ddRqaKxe6DGbpTLJM2rCMF8W91097nmiOKEnuxi6vJKTmyX81BZXi48ugCRh3942ONYRH8W7dBegrvRY3kyAtH root@gsmdev-VirtualBox
diff --git a/supporting/servers/roles/ssh/files/taseer.authorized_keys b/supporting/servers/roles/ssh/files/taseer.authorized_keys
new file mode 100644
index 00000000..2efb95e8
--- /dev/null
+++ b/supporting/servers/roles/ssh/files/taseer.authorized_keys
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCxCG9Z+8rBLQiJ9yt+RzRkAZZQIlou83e899Kkuf/UgXd+1TUgIu4AJUDvayrorTxk2kw7ra+DoysEa2NBkLL6FNnG+NpYV+XTaG+Z3tvp4l62ROV+5+O4soiWtBroRghQPDkrpiTQuFJ7/BKQt9bKZYPb3t2bxCLeFVWtUzCpFDIj6wDPGwDeTLnLMPtQNQtIlgPV+XGAet17rNSrm7EcDzqdDQcdZFmfeH5YvBsY9ZO+qwcbelEpMBWPsyEMU6OgwTqUj7mm3o+Quew35y13Zrhf+GAx5ZMXho/Cpjp1TzognDkwAFpFzZG7zWSNexXrD15Wzgyae2cl/vD75I7 taseer@123.org \ No newline at end of file
diff --git a/supporting/servers/roles/ssh/files/yujunz.authorized_keys b/supporting/servers/roles/ssh/files/yujunz.authorized_keys
new file mode 100644
index 00000000..168979c3
--- /dev/null
+++ b/supporting/servers/roles/ssh/files/yujunz.authorized_keys
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0o+WARhbI5DeZK9eiZKVprY3oQ910npo/EPFI9prfpN7zeF0UA4TwT9rqsrwFgRQeJkKvbDTOPt5Ox9vLIEnxT4PdirvrYNxtyJHHfbL4ZxKemYhBi2BA6CAbI3f9CR+dtbfOBxtTpXAj1Y5oA9y59o1hqHpuVmM8dBpcQt/ELdYCHZ0khxft5WaSOURsslTZN18bikVX9WHlKflVyRA8efxqzTZ4w5ufHl1Fv9i/G0u7iGbUtvlI8X7+Z+ePuysZhHKErQSGfv2NybDi+r8xM5hL2LYXxjAu0PV58olUl1SX40OY9yA2Yx+PVzIGhv6EQ8snUFnsoMy0ZIbQ+ysB yujunz@silver.mbp
diff --git a/supporting/servers/roles/ssh/tasks/main.yml b/supporting/servers/roles/ssh/tasks/main.yml
new file mode 100644
index 00000000..7de1e208
--- /dev/null
+++ b/supporting/servers/roles/ssh/tasks/main.yml
@@ -0,0 +1,26 @@
+- name: add users for ssh access
+ become: true
+ user:
+ name: "{{ item.name }}"
+ comment: "{{ item.comment }}"
+ groups: "qtip"
+ append: yes
+ with_items: "{{ users }}"
+- name: create .ssh directory
+ become: true
+ file:
+ path: "/home/{{ item.name }}/.ssh"
+ state: directory
+ owner: "{{ item.name }}"
+ group: "{{ item.name }}"
+ mode: 0700
+ with_items: "{{ users }}"
+- name: authorize public key
+ become: true
+ copy:
+ src: "{{ item.name }}.authorized_keys"
+ dest: "/home/{{ item.name }}/.ssh/authorized_keys"
+ owner: "{{ item.name }}"
+ group: "{{ item.name }}"
+ mode: 0600
+ with_items: "{{ users }}" \ No newline at end of file
diff --git a/supporting/servers/ssh.yml b/supporting/servers/ssh.yml
new file mode 100644
index 00000000..bd74ab3b
--- /dev/null
+++ b/supporting/servers/ssh.yml
@@ -0,0 +1,4 @@
+---
+- hosts: elk-servers
+ roles:
+ - ssh
diff --git a/tests/ansible_api_test.py b/tests/ansible_api_test.py
index e9f0a77d..613d5f7e 100644
--- a/tests/ansible_api_test.py
+++ b/tests/ansible_api_test.py
@@ -14,6 +14,6 @@ class TestClass:
ansible_api = AnsibleApi()
ret = ansible_api.execute_playbook('tests/data/hosts',
'tests/data/test.yml',
- 'data/QtipKey',
+ 'config/QtipKey',
{'keys': 'test'})
assert ret == 3
diff --git a/tests/cli_test.py b/tests/cli_test.py
index 12d0abb0..43a11089 100644
--- a/tests/cli_test.py
+++ b/tests/cli_test.py
@@ -11,7 +11,7 @@ class TestClass:
'-f',
'compute'], "You have specified a lab that is not present in test_cases"),
(['-l',
- 'zte-pod1',
+ 'default',
'-f',
'test'], "Test File Does not exist in test_list")
])
@@ -26,10 +26,10 @@ class TestClass:
@pytest.mark.parametrize("test_input, expected", [
(['-l',
- 'zte-pod1',
+ 'default',
'-f',
- 'storage'], [('fuel', '/home', './test_cases/zte-pod1/storage/fio_bm.yaml'),
- ('fuel', '/home', './test_cases/zte-pod1/storage/fio_vm.yaml')])
+ 'storage'], [('fuel', '/home', './test_cases/default/storage/fio_bm.yaml'),
+ ('fuel', '/home', './test_cases/default/storage/fio_vm.yaml')])
])
@mock.patch('func.cli.args_handler.prepare_and_run_benchmark')
def test_cli_successful(self, mock_args_handler, test_input, expected):
diff --git a/tests/env_setup_test.py b/tests/env_setup_test.py
index cc3c6b60..a0bbf640 100644
--- a/tests/env_setup_test.py
+++ b/tests/env_setup_test.py
@@ -64,7 +64,7 @@ class TestClass:
test_class.fetch_compute_ips = mock_ips
test_class.parse("tests/test_case/bm_without_proxy.yaml")
test_class.update_ansible()
- result = filecmp.cmp('tests/output/hosts', 'data/hosts')
+ result = filecmp.cmp('tests/output/hosts', 'config/hosts')
assert result
def test_ping(self, capfd):
diff --git a/tests/qtip_server_test.py b/tests/qtip_server_test.py
index 9def21f8..81bb302b 100644
--- a/tests/qtip_server_test.py
+++ b/tests/qtip_server_test.py
@@ -46,7 +46,7 @@ class TestClass:
'result': 0}),
({'installer_type': 'fuel',
'installer_ip': '10.20.0.2',
- 'pod_name': 'zte-pod1',
+ 'pod_name': 'default',
'max_minutes': 20,
'suite_name': 'compute',
'type': 'VM',
@@ -56,7 +56,7 @@ class TestClass:
{'job_id': '',
'installer_type': 'fuel',
'installer_ip': '10.20.0.2',
- 'pod_name': 'zte-pod1',
+ 'pod_name': 'default',
'suite_name': 'compute',
'max_minutes': 20,
'type': 'VM',
diff --git a/data/report/Qtip_Report.py b/utils/report/Qtip_Report.py
index cd20d57c..cd20d57c 100644
--- a/data/report/Qtip_Report.py
+++ b/utils/report/Qtip_Report.py
diff --git a/data/ref_results/__init__.py b/utils/report/__init__.py
index e69de29b..e69de29b 100644
--- a/data/ref_results/__init__.py
+++ b/utils/report/__init__.py
diff --git a/data/report/get_indices.py b/utils/report/get_indices.py
index 91219c0b..91219c0b 100644
--- a/data/report/get_indices.py
+++ b/utils/report/get_indices.py
diff --git a/data/report/get_results.py b/utils/report/get_results.py
index 23fd5383..23fd5383 100644
--- a/data/report/get_results.py
+++ b/utils/report/get_results.py
diff --git a/data/report/qtip_graph.py b/utils/report/qtip_graph.py
index acbda40c..acbda40c 100644
--- a/data/report/qtip_graph.py
+++ b/utils/report/qtip_graph.py