From 8ee70654479bff695a6781a9f3eaea9f5eb6b765 Mon Sep 17 00:00:00 2001 From: Yujun Zhang Date: Wed, 12 Apr 2017 12:14:59 +0800 Subject: Refactoring connection task - split `compute` playbook into `setup` and `run` - save inventory and ssh configuration after in `setup` Change-Id: I0803a954ffcd7c07861ff6bdb76acdbfaa4815bd Signed-off-by: Yujun Zhang --- tests/integration/compute.yaml | 84 ---------------------------------------- tests/integration/hosts | 6 --- tests/integration/hosts.j2 | 21 ++++++++++ tests/integration/hosts.sample | 83 +++++++++++++++++++++++++++++++++++++++ tests/integration/run.yaml | 70 +++++++++++++++++++++++++++++++++ tests/integration/setup.yaml | 21 ++++++++++ tests/integration/ssh.cfg.j2 | 14 +++++++ tests/integration/ssh.cfg.sample | 56 +++++++++++++++++++++++++++ 8 files changed, 265 insertions(+), 90 deletions(-) delete mode 100644 tests/integration/compute.yaml delete mode 100644 tests/integration/hosts create mode 100644 tests/integration/hosts.j2 create mode 100644 tests/integration/hosts.sample create mode 100644 tests/integration/run.yaml create mode 100644 tests/integration/setup.yaml create mode 100644 tests/integration/ssh.cfg.j2 create mode 100644 tests/integration/ssh.cfg.sample (limited to 'tests/integration') diff --git a/tests/integration/compute.yaml b/tests/integration/compute.yaml deleted file mode 100644 index 87553fd7..00000000 --- a/tests/integration/compute.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 -############################################################################## - ---- -# Prepare connection to SUT (System Under Test) -- hosts: fuel-master - gather_facts: no - tasks: - - name: collect facts of fuel hosts - fuel: - - name: add compute node to ansible inventory - add_host: - name: "{{ hosts_meta[item]['ip'] }}" - groups: compute - ansible_user: root - ansible_ssh_common_args: '-o StrictHostKeyChecking=No -o ProxyJump=fuel-master' - with_items: "{{ hosts.compute }}" - -# Execute compute benchmark plan and collect data -# - system information -# - test condition -# - performance metrics -- hosts: compute - tasks: - - name: check ssh connection - ping: - # collect system information - - name: collect system information - include: tasks/inxi.yaml - - name: ssl metrics - include: tasks/openssl.yaml - -- hosts: compute - tasks: - - name: calculate QPI of compute - calculate: - metrics: - ssl_rsa: "{{ openssl_rsa_metrics }}" - spec: # TODO(yujunz) load spec from file - name: compute - description: QTIP Performance Index of compute - formula: weighted arithmetic mean - sections: # split based on different application - - name: SSL - description: cryptography and SSL/TLS performance - formula: geometric mean - metrics: - - name: ssl_rsa - formual: geometric mean - workloads: - - name: rsa_sign_512 - description: RSA signature 512 bits - baseline: 14982.3 - - name: rsa_verify_512 - baseline: 180619.2 - - name: rsa_sign_1024 - baseline: 5037.7 - - name: rsa_verify_1024 - baseline: 67359.9 - - name: rsa_sign_2048 - baseline: 713.6 - - name: rsa_verify_2048 - baseline: 23458.0 - - name: rsa_sign_4096 - baseline: 102.1 - - name: rsa_verify_4096 - baseline: 6402.9 - register: qpi_result - delegate_to: localhost - -# Generate and publish report -- hosts: local - tasks: - - name: create system information report - template: src=templates/system-info.j2 dest=reports/system-info - - name: create qpi report - template: src=templates/qpi-report.j2 dest=reports/qpi-report - # TODO(yujunz) push test result to testapi diff --git a/tests/integration/hosts b/tests/integration/hosts deleted file mode 100644 index 9b91eea6..00000000 --- a/tests/integration/hosts +++ /dev/null @@ -1,6 +0,0 @@ -[fuel-master] -fuel-master - -[local] -localhost ansible_connection=local - diff --git a/tests/integration/hosts.j2 b/tests/integration/hosts.j2 new file mode 100644 index 00000000..868a4e57 --- /dev/null +++ b/tests/integration/hosts.j2 @@ -0,0 +1,21 @@ +[fuel-master] +fuel-master + +[local] +localhost ansible_connection=local + +[fuel-groups:children] +{% for group in hosts|sort %} +{{ group }} +{% endfor %} + +[fuel-groups:vars] +ansible_ssh_common_args=-F ./ssh.cfg + +{% for group in hosts|sort %} +[{{ group }}] +{% for host in hosts[group]|sort %} +{{ host }} +{% endfor %} + +{% endfor %} diff --git a/tests/integration/hosts.sample b/tests/integration/hosts.sample new file mode 100644 index 00000000..e37d38ec --- /dev/null +++ b/tests/integration/hosts.sample @@ -0,0 +1,83 @@ +[fuel-master] +fuel-master + +[local] +localhost ansible_connection=local + +[fuel-groups:children] +ceph-osd +cluster-1 +compute +controller +hw-zte-servers +mongo +node-1 +node-2 +node-3 +node-4 +node-5 +node-6 +node-7 + +[fuel-groups:vars] +ansible_ssh_common_args=-F ./ssh.cfg + +[ceph-osd] +node-2 +node-4 +node-6 +node-7 + +[cluster-1] +node-1 +node-2 +node-3 +node-4 +node-5 +node-6 +node-7 + +[compute] +node-2 +node-4 +node-6 +node-7 + +[controller] +node-1 +node-3 +node-5 + +[hw-zte-servers] +node-1 +node-2 +node-3 +node-4 +node-5 +node-6 +node-7 + +[mongo] +node-1 + +[node-1] +node-1 + +[node-2] +node-2 + +[node-3] +node-3 + +[node-4] +node-4 + +[node-5] +node-5 + +[node-6] +node-6 + +[node-7] +node-7 + diff --git a/tests/integration/run.yaml b/tests/integration/run.yaml new file mode 100644 index 00000000..7eb141d7 --- /dev/null +++ b/tests/integration/run.yaml @@ -0,0 +1,70 @@ +############################################################################## +# 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 +############################################################################## + +--- +# Execute compute benchmark plan and collect data +# - system information +# - test condition +# - performance metrics +- hosts: compute + tasks: + - name: check ssh connection + ping: + # collect system information + - name: collect system information + include: tasks/inxi.yaml + - name: ssl metrics + include: tasks/openssl.yaml + +- hosts: compute + tasks: + - name: calculate QPI of compute + calculate: + metrics: + ssl_rsa: "{{ openssl_rsa_metrics }}" + spec: # TODO(yujunz) load spec from file + name: compute + description: QTIP Performance Index of compute + formula: weighted arithmetic mean + sections: # split based on different application + - name: SSL + description: cryptography and SSL/TLS performance + formula: geometric mean + metrics: + - name: ssl_rsa + formual: geometric mean + workloads: + - name: rsa_sign_512 + description: RSA signature 512 bits + baseline: 14982.3 + - name: rsa_verify_512 + baseline: 180619.2 + - name: rsa_sign_1024 + baseline: 5037.7 + - name: rsa_verify_1024 + baseline: 67359.9 + - name: rsa_sign_2048 + baseline: 713.6 + - name: rsa_verify_2048 + baseline: 23458.0 + - name: rsa_sign_4096 + baseline: 102.1 + - name: rsa_verify_4096 + baseline: 6402.9 + register: qpi_result + delegate_to: localhost + +# Generate and publish report +- hosts: local + tasks: + - name: create system information report + template: src=templates/system-info.j2 dest=reports/system-info + - name: create qpi report + template: src=templates/qpi-report.j2 dest=reports/qpi-report + # TODO(yujunz) push test result to testapi diff --git a/tests/integration/setup.yaml b/tests/integration/setup.yaml new file mode 100644 index 00000000..784d6cc5 --- /dev/null +++ b/tests/integration/setup.yaml @@ -0,0 +1,21 @@ +############################################################################## +# 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 +############################################################################## + +# Prepare connection to SUT (System Under Test) +- hosts: fuel-master + gather_facts: no + tasks: + - name: collect facts of fuel hosts + fuel: + - name: update inventory file + template: src=./hosts.j2 dest=./hosts + delegate_to: localhost + - name: update ssh.cfg file + template: src=./ssh.cfg.j2 dest=./ssh.cfg + delegate_to: localhost diff --git a/tests/integration/ssh.cfg.j2 b/tests/integration/ssh.cfg.j2 new file mode 100644 index 00000000..2fe049e2 --- /dev/null +++ b/tests/integration/ssh.cfg.j2 @@ -0,0 +1,14 @@ +# Connect to target node through jump host +# +# OpenSSH 7.3: +# ProxyJump jumphost +# before OpenSSH 7.3 +# ProxyCommand ssh -o 'ForwardAgent yes' jumphost 'ssh-add && nc %h %p' + +{% for (name, host) in hosts_meta.items() %} +Host {{ name }} + HostName {{ host.ansible_ssh_host }} + User root + ProxyCommand ssh -o 'ForwardAgent yes' fuel-master 'ssh-add && nc %h %p' + +{% endfor %} diff --git a/tests/integration/ssh.cfg.sample b/tests/integration/ssh.cfg.sample new file mode 100644 index 00000000..efa45ab6 --- /dev/null +++ b/tests/integration/ssh.cfg.sample @@ -0,0 +1,56 @@ +Host node-5 + HostName 10.20.5.12 + User root + # Use `ProxyCommand` for OpenSSH before 7.3 + ProxyCommand ssh -o 'ForwardAgent yes' fuel-master 'ssh-add && nc %h %p' + # `ProxyJump` is available since OpenSSH 7.3 + # ProxyJump fuel-master + +Host node-4 + HostName 10.20.5.14 + User root + # Use `ProxyCommand` for OpenSSH before 7.3 + ProxyCommand ssh -o 'ForwardAgent yes' fuel-master 'ssh-add && nc %h %p' + # `ProxyJump` is available since OpenSSH 7.3 + # ProxyJump fuel-master + +Host node-7 + HostName 10.20.5.15 + User root + # Use `ProxyCommand` for OpenSSH before 7.3 + ProxyCommand ssh -o 'ForwardAgent yes' fuel-master 'ssh-add && nc %h %p' + # `ProxyJump` is available since OpenSSH 7.3 + # ProxyJump fuel-master + +Host node-6 + HostName 10.20.5.16 + User root + # Use `ProxyCommand` for OpenSSH before 7.3 + ProxyCommand ssh -o 'ForwardAgent yes' fuel-master 'ssh-add && nc %h %p' + # `ProxyJump` is available since OpenSSH 7.3 + # ProxyJump fuel-master + +Host node-1 + HostName 10.20.5.10 + User root + # Use `ProxyCommand` for OpenSSH before 7.3 + ProxyCommand ssh -o 'ForwardAgent yes' fuel-master 'ssh-add && nc %h %p' + # `ProxyJump` is available since OpenSSH 7.3 + # ProxyJump fuel-master + +Host node-3 + HostName 10.20.5.11 + User root + # Use `ProxyCommand` for OpenSSH before 7.3 + ProxyCommand ssh -o 'ForwardAgent yes' fuel-master 'ssh-add && nc %h %p' + # `ProxyJump` is available since OpenSSH 7.3 + # ProxyJump fuel-master + +Host node-2 + HostName 10.20.5.13 + User root + # Use `ProxyCommand` for OpenSSH before 7.3 + ProxyCommand ssh -o 'ForwardAgent yes' fuel-master 'ssh-add && nc %h %p' + # `ProxyJump` is available since OpenSSH 7.3 + # ProxyJump fuel-master + -- cgit 1.2.3-korg