diff options
-rw-r--r-- | ansible/ansible.cfg | 2 | ||||
-rw-r--r-- | ansible/cpu_pin_setup.yaml | 23 | ||||
-rw-r--r-- | ansible/cpu_pin_teardown.yaml | 23 | ||||
-rw-r--r-- | ansible/inventory.ini | 8 | ||||
-rw-r--r-- | ansible/roles/cpu_pin_local_setup/tasks/main.yaml | 63 | ||||
-rw-r--r-- | ansible/roles/cpu_pin_local_teardowm/tasks/main.yaml | 50 | ||||
-rw-r--r-- | ansible/roles/restart_nova_compute/tasks/main.yaml | 14 | ||||
-rw-r--r-- | ansible/roles/restart_nova_scheduler/tasks/main.yaml | 14 | ||||
-rw-r--r-- | ansible/roles/scheduler_default_filters_reset/tasks/main.yaml | 15 | ||||
-rw-r--r-- | ansible/roles/scheduler_default_filters_setup/tasks/main.yaml | 15 | ||||
-rw-r--r-- | ansible/roles/scheduler_default_filters_setup/vars/main.yaml | 1 | ||||
-rw-r--r-- | ansible/roles/vcpu_pin_set_reset/tasks/main.yaml | 21 | ||||
-rw-r--r-- | ansible/roles/vcpu_pin_set_setup/tasks/main.yaml | 21 | ||||
-rw-r--r-- | ansible/roles/vcpu_pin_set_setup/vars/main.yaml | 2 | ||||
-rw-r--r-- | api/resources/testsuites_action.py | 25 | ||||
-rw-r--r-- | docs/apidocs/index.rst | 2 | ||||
-rw-r--r-- | docs/release/release-notes/index.rst (renamed from docs/release/index.rst) | 2 | ||||
-rw-r--r-- | docs/release/release-notes/release-notes.rst (renamed from docs/release/release-notes.rst) | 0 | ||||
-rw-r--r-- | docs/release/results/index.rst (renamed from docs/results/index.rst) | 2 | ||||
-rw-r--r-- | docs/release/results/os-nosdn-kvm-ha.rst (renamed from docs/results/os-nosdn-kvm-ha.rst) | 0 | ||||
-rw-r--r-- | docs/release/results/os-nosdn-nofeature-ha.rst (renamed from docs/results/os-nosdn-nofeature-ha.rst) | 0 | ||||
-rw-r--r-- | docs/release/results/os-nosdn-nofeature-noha.rst (renamed from docs/results/os-nosdn-nofeature-noha.rst) | 0 | ||||
-rw-r--r-- | docs/release/results/os-odl_l2-bgpvpn-ha.rst (renamed from docs/results/os-odl_l2-bgpvpn-ha.rst) | 0 | ||||
-rw-r--r-- | docs/release/results/os-odl_l2-nofeature-ha.rst (renamed from docs/results/os-odl_l2-nofeature-ha.rst) | 0 | ||||
-rw-r--r-- | docs/release/results/os-odl_l2-sfc-ha.rst (renamed from docs/results/os-odl_l2-sfc-ha.rst) | 0 | ||||
-rw-r--r-- | docs/release/results/os-onos-nofeature-ha.rst (renamed from docs/results/os-onos-nofeature-ha.rst) | 0 | ||||
-rw-r--r-- | docs/release/results/os-onos-sfc-ha.rst (renamed from docs/results/os-onos-sfc-ha.rst) | 0 | ||||
-rw-r--r-- | docs/release/results/overview.rst (renamed from docs/results/overview.rst) | 0 | ||||
-rw-r--r-- | docs/release/results/results.rst (renamed from docs/results/results.rst) | 0 | ||||
-rw-r--r-- | docs/release/results/yardstick-opnfv-ha.rst (renamed from docs/results/yardstick-opnfv-ha.rst) | 0 | ||||
-rw-r--r-- | docs/release/results/yardstick-opnfv-kvm.rst (renamed from docs/results/yardstick-opnfv-kvm.rst) | 0 | ||||
-rw-r--r-- | docs/release/results/yardstick-opnfv-parser.rst (renamed from docs/results/yardstick-opnfv-parser.rst) | 0 | ||||
-rw-r--r-- | docs/release/results/yardstick-opnfv-vtc.rst (renamed from docs/results/yardstick-opnfv-vtc.rst) | 0 | ||||
-rwxr-xr-x | docs/testing/user/userguide/01-introduction.rst (renamed from docs/userguide/01-introduction.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/02-methodology.rst (renamed from docs/userguide/02-methodology.rst) | 0 | ||||
-rwxr-xr-x | docs/testing/user/userguide/03-architecture.rst (renamed from docs/userguide/03-architecture.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/04-vtc-overview.rst (renamed from docs/userguide/04-vtc-overview.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/05-apexlake_installation.rst (renamed from docs/userguide/05-apexlake_installation.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/06-apexlake_api.rst (renamed from docs/userguide/06-apexlake_api.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/07-nsb-overview.rst (renamed from docs/userguide/07-nsb-overview.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/08-nsb_installation.rst (renamed from docs/userguide/08-nsb_installation.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/09-installation.rst (renamed from docs/userguide/09-installation.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/10-yardstick_plugin.rst (renamed from docs/userguide/10-yardstick_plugin.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/11-result-store-InfluxDB.rst (renamed from docs/userguide/11-result-store-InfluxDB.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/12-grafana.rst (renamed from docs/userguide/12-grafana.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/13-list-of-tcs.rst (renamed from docs/userguide/13-list-of-tcs.rst) | 0 | ||||
-rwxr-xr-x | docs/testing/user/userguide/Yardstick_task_templates.rst (renamed from docs/userguide/Yardstick_task_templates.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/comp-intro.rst (renamed from docs/userguide/comp-intro.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/glossary.rst (renamed from docs/userguide/glossary.rst) | 0 | ||||
-rwxr-xr-x | docs/testing/user/userguide/images/Deployment.png (renamed from docs/userguide/images/Deployment.png) | bin | 17958 -> 17958 bytes | |||
-rw-r--r-- | docs/testing/user/userguide/images/Grafana_config.png (renamed from docs/userguide/images/Grafana_config.png) | bin | 143507 -> 143507 bytes | |||
-rw-r--r-- | docs/testing/user/userguide/images/InfluxDB_store.png (renamed from docs/userguide/images/InfluxDB_store.png) | bin | 1623955 -> 1623955 bytes | |||
-rw-r--r-- | docs/testing/user/userguide/images/Logical_view.png (renamed from docs/userguide/images/Logical_view.png) | bin | 58840 -> 58840 bytes | |||
-rw-r--r-- | docs/testing/user/userguide/images/TC002.png (renamed from docs/userguide/images/TC002.png) | bin | 106382 -> 106382 bytes | |||
-rw-r--r-- | docs/testing/user/userguide/images/Use_case.png (renamed from docs/userguide/images/Use_case.png) | bin | 105787 -> 105787 bytes | |||
-rw-r--r-- | docs/testing/user/userguide/images/add.png (renamed from docs/userguide/images/add.png) | bin | 169904 -> 169904 bytes | |||
-rw-r--r-- | docs/testing/user/userguide/images/login.png (renamed from docs/userguide/images/login.png) | bin | 32761 -> 32761 bytes | |||
-rw-r--r-- | docs/testing/user/userguide/images/results_visualization.png (renamed from docs/userguide/images/results_visualization.png) | bin | 41905 -> 41905 bytes | |||
-rw-r--r-- | docs/testing/user/userguide/images/test_execution_flow.png (renamed from docs/userguide/images/test_execution_flow.png) | bin | 51473 -> 51473 bytes | |||
-rw-r--r-- | docs/testing/user/userguide/index.rst (renamed from docs/userguide/index.rst) | 4 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc001.rst (renamed from docs/userguide/opnfv_yardstick_tc001.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc002.rst (renamed from docs/userguide/opnfv_yardstick_tc002.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc004.rst (renamed from docs/userguide/opnfv_yardstick_tc004.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc005.rst (renamed from docs/userguide/opnfv_yardstick_tc005.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc006.rst (renamed from docs/userguide/opnfv_yardstick_tc006.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc007.rst (renamed from docs/userguide/opnfv_yardstick_tc007.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc008.rst (renamed from docs/userguide/opnfv_yardstick_tc008.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc009.rst (renamed from docs/userguide/opnfv_yardstick_tc009.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc010.rst (renamed from docs/userguide/opnfv_yardstick_tc010.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc011.rst (renamed from docs/userguide/opnfv_yardstick_tc011.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc012.rst (renamed from docs/userguide/opnfv_yardstick_tc012.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc014.rst (renamed from docs/userguide/opnfv_yardstick_tc014.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc019.rst (renamed from docs/userguide/opnfv_yardstick_tc019.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc020.rst (renamed from docs/userguide/opnfv_yardstick_tc020.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc021.rst (renamed from docs/userguide/opnfv_yardstick_tc021.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc024.rst (renamed from docs/userguide/opnfv_yardstick_tc024.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc025.rst (renamed from docs/userguide/opnfv_yardstick_tc025.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc027.rst (renamed from docs/userguide/opnfv_yardstick_tc027.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc028.rst (renamed from docs/userguide/opnfv_yardstick_tc028.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc037.rst (renamed from docs/userguide/opnfv_yardstick_tc037.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc038.rst (renamed from docs/userguide/opnfv_yardstick_tc038.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc040.rst (renamed from docs/userguide/opnfv_yardstick_tc040.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc042.rst (renamed from docs/userguide/opnfv_yardstick_tc042.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc043.rst (renamed from docs/userguide/opnfv_yardstick_tc043.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc044.rst (renamed from docs/userguide/opnfv_yardstick_tc044.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc045.rst (renamed from docs/userguide/opnfv_yardstick_tc045.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc046.rst (renamed from docs/userguide/opnfv_yardstick_tc046.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc047.rst (renamed from docs/userguide/opnfv_yardstick_tc047.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc048.rst (renamed from docs/userguide/opnfv_yardstick_tc048.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc049.rst (renamed from docs/userguide/opnfv_yardstick_tc049.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc050.rst (renamed from docs/userguide/opnfv_yardstick_tc050.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc051.rst (renamed from docs/userguide/opnfv_yardstick_tc051.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc052.rst (renamed from docs/userguide/opnfv_yardstick_tc052.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc053.rst (renamed from docs/userguide/opnfv_yardstick_tc053.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc054.rst (renamed from docs/userguide/opnfv_yardstick_tc054.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc055.rst (renamed from docs/userguide/opnfv_yardstick_tc055.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc061.rst (renamed from docs/userguide/opnfv_yardstick_tc061.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc063.rst (renamed from docs/userguide/opnfv_yardstick_tc063.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc069.rst (renamed from docs/userguide/opnfv_yardstick_tc069.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc070.rst (renamed from docs/userguide/opnfv_yardstick_tc070.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc071.rst (renamed from docs/userguide/opnfv_yardstick_tc071.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc072.rst (renamed from docs/userguide/opnfv_yardstick_tc072.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc073.rst (renamed from docs/userguide/opnfv_yardstick_tc073.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc074.rst (renamed from docs/userguide/opnfv_yardstick_tc074.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc075.rst (renamed from docs/userguide/opnfv_yardstick_tc075.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/opnfv_yardstick_tc076.rst (renamed from docs/userguide/opnfv_yardstick_tc076.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/references.rst (renamed from docs/userguide/references.rst) | 0 | ||||
-rw-r--r-- | docs/testing/user/userguide/testcase_description_v2_template.rst (renamed from docs/userguide/testcase_description_v2_template.rst) | 0 | ||||
-rw-r--r-- | fuel-plugin/deployment_scripts/puppet/manifests/yardstick-install.pp | 3 | ||||
-rwxr-xr-x | nsb_setup.sh | 11 | ||||
-rwxr-xr-x | tests/ci/load_images.sh | 56 | ||||
-rw-r--r-- | tests/opnfv/test_suites/opnfv_k8-nosdn-nofeature-noha_daily.yaml | 62 | ||||
-rw-r--r-- | tests/opnfv/test_suites/opnfv_os-nosdn-openo-ha_daily.yaml | 116 | ||||
-rw-r--r-- | tests/unit/benchmark/contexts/test_node.py | 20 | ||||
-rw-r--r-- | tests/unit/benchmark/scenarios/compute/memload_sample_output.txt | 4 | ||||
-rw-r--r-- | tests/unit/benchmark/scenarios/compute/test_memload.py | 47 | ||||
-rw-r--r-- | tests/unit/dispatcher/test_influxdb.py | 14 | ||||
-rwxr-xr-x | tools/ubuntu-server-cloudimg-dpdk-modify.sh | 19 | ||||
-rwxr-xr-x | tools/ubuntu-server-cloudimg-modify.sh | 31 | ||||
-rwxr-xr-x | tools/yardstick-img-modify | 8 | ||||
-rw-r--r-- | yardstick/benchmark/contexts/base.py | 4 | ||||
-rw-r--r-- | yardstick/benchmark/contexts/dummy.py | 2 | ||||
-rw-r--r-- | yardstick/benchmark/contexts/heat.py | 19 | ||||
-rw-r--r-- | yardstick/benchmark/contexts/node.py | 37 | ||||
-rw-r--r-- | yardstick/benchmark/contexts/standalone.py | 2 | ||||
-rw-r--r-- | yardstick/benchmark/core/task.py | 218 | ||||
-rwxr-xr-x | yardstick/benchmark/runners/base.py | 21 | ||||
-rw-r--r-- | yardstick/benchmark/scenarios/compute/memload.py | 10 | ||||
-rw-r--r-- | yardstick/benchmark/scenarios/networking/netutilization.py | 29 | ||||
-rw-r--r-- | yardstick/common/constants.py | 2 | ||||
-rw-r--r-- | yardstick/common/openstack_utils.py | 21 | ||||
-rw-r--r-- | yardstick/common/utils.py | 21 | ||||
-rw-r--r-- | yardstick/dispatcher/base.py | 4 | ||||
-rw-r--r-- | yardstick/dispatcher/file.py | 2 | ||||
-rw-r--r-- | yardstick/dispatcher/http.py | 2 | ||||
-rw-r--r-- | yardstick/dispatcher/influxdb.py | 60 | ||||
-rw-r--r-- | yardstick/network_services/traffic_profile/fixed.py | 3 | ||||
-rw-r--r-- | yardstick/network_services/vnf_generic/vnf/tg_trex.py | 2 | ||||
-rw-r--r-- | yardstick/orchestrator/heat.py | 5 |
139 files changed, 848 insertions, 314 deletions
diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg new file mode 100644 index 000000000..14c806515 --- /dev/null +++ b/ansible/ansible.cfg @@ -0,0 +1,2 @@ +[defaults] +host_key_checking = False diff --git a/ansible/cpu_pin_setup.yaml b/ansible/cpu_pin_setup.yaml new file mode 100644 index 000000000..2a3fb5b3f --- /dev/null +++ b/ansible/cpu_pin_setup.yaml @@ -0,0 +1,23 @@ +--- +############################################################################## +# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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 + roles: + - cpu_pin_local_setup + +- hosts: controller + roles: + - scheduler_default_filters_setup + - restart_nova_scheduler + +- hosts: compute + roles: + - vcpu_pin_set_setup + - restart_nova_compute diff --git a/ansible/cpu_pin_teardown.yaml b/ansible/cpu_pin_teardown.yaml new file mode 100644 index 000000000..7647eebdb --- /dev/null +++ b/ansible/cpu_pin_teardown.yaml @@ -0,0 +1,23 @@ +--- +############################################################################## +# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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: compute + roles: + - vcpu_pin_set_reset + - restart_nova_compute + +- hosts: controller + roles: + - scheduler_default_filters_reset + - restart_nova_scheduler + +- hosts: localhost + roles: + - cpu_pin_local_teardown diff --git a/ansible/inventory.ini b/ansible/inventory.ini new file mode 100644 index 000000000..440e625bd --- /dev/null +++ b/ansible/inventory.ini @@ -0,0 +1,8 @@ +[controller] +host1 ansible_host=10.1.0.50 ansible_user=root ansible_ssh_pass=root +host2 ansible_host=10.1.0.51 ansible_user=root ansible_ssh_pass=root +host3 ansible_host=10.1.0.52 ansible_user=root ansible_ssh_pass=root + +[compute] +host4 ansible_host=10.1.0.53 ansible_user=root ansible_ssh_pass=root +host5 ansible_host=10.1.0.54 ansible_user=root ansible_ssh_pass=root diff --git a/ansible/roles/cpu_pin_local_setup/tasks/main.yaml b/ansible/roles/cpu_pin_local_setup/tasks/main.yaml new file mode 100644 index 000000000..c25b801be --- /dev/null +++ b/ansible/roles/cpu_pin_local_setup/tasks/main.yaml @@ -0,0 +1,63 @@ +--- +############################################################################## +# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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: get nova-compute host + shell: + source /etc/yardstick/openstack.creds; + openstack availability zone list --long | grep nova-compute | sort | awk '{print $7}'; + args: + executable: /bin/bash + register: compute_nodes + +- name: get existing flavor list + shell: + source /etc/yardstick/openstack.creds; + openstack flavor list | grep "True" | cut -f 2 -d ' '; + args: + executable: /bin/bash + register: flavors + +- name: create pinned-cpu and regular host aggregate + shell: + source /etc/yardstick/openstack.creds; + openstack aggregate create pinned-cpu; + openstack aggregate create regular; + nova aggregate-set-metadata pinned-cpu pinned=true; + nova aggregate-set-metadata regular pinned=false; + nova aggregate-add-host pinned-cpu {{ compute_nodes.stdout_lines[0] }}; + nova aggregate-add-host regular {{ compute_nodes.stdout_lines[1] }}; + args: + executable: /bin/bash + +- name: set flavor default property + shell: + source /etc/yardstick/openstack.creds; + openstack flavor set --property aggregate_instance_extra_specs:pinned=false {{item}}; + args: + executable: /bin/bash + with_items: + - '{{ flavors.stdout_lines }}' + +- name: create flavor yardstick-pinned-flavor + os_nova_flavor: + cloud: opnfv + state: present + name: yardstick-pinned-flavor + ram: 512 + vcpus: 3 + disk: 3 + +- name: set yardstick-pinned-flavor property + shell: + source /etc/yardstick/openstack.creds; + openstack flavor set --property hw:cpu_policy=dedicated yardstick-pinned-flavor; + openstack flavor set --property aggregate_instance_extra_specs:pinned=true yardstick-pinned-flavor; + args: + executable: /bin/bash diff --git a/ansible/roles/cpu_pin_local_teardowm/tasks/main.yaml b/ansible/roles/cpu_pin_local_teardowm/tasks/main.yaml new file mode 100644 index 000000000..29475421d --- /dev/null +++ b/ansible/roles/cpu_pin_local_teardowm/tasks/main.yaml @@ -0,0 +1,50 @@ +--- +############################################################################## +# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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: get nova-compute host + shell: + source /etc/yardstick/openstack.creds; + openstack availability zone list --long | grep nova-compute | sort | awk '{print $7}'; + args: + executable: /bin/bash + register: compute_nodes + +- name: delete flavor yardstick-pinned-flavor + os_nova_flavor: + cloud: opnfv + state: absent + name: yardstick-pinned-flavor + +- name: get flavor list + shell: + source /etc/yardstick/openstack.creds; + openstack flavor list | grep "True" | cut -f 2 -d ' '; + args: + executable: /bin/bash + register: flavors + +- name: unset flavor default property + shell: + source /etc/yardstick/openstack.creds; + openstack flavor unset --property aggregate_instance_extra_specs:pinned {{item}}; + args: + executable: /bin/bash + with_items: + - '{{ flavors.stdout_lines }}' + +- name: delete pinned-cpu and regular host aggregate + shell: + source /etc/yardstick/openstack.creds; + nova aggregate-remove-host pinned-cpu {{ compute_nodes.stdout_lines[0] }}; + nova aggregate-remove-host regular {{ compute_nodes.stdout_lines[1] }}; + openstack aggregate delete pinned-cpu; + openstack aggregate delete regular; + args: + executable: /bin/bash diff --git a/ansible/roles/restart_nova_compute/tasks/main.yaml b/ansible/roles/restart_nova_compute/tasks/main.yaml new file mode 100644 index 000000000..77c2d4dca --- /dev/null +++ b/ansible/roles/restart_nova_compute/tasks/main.yaml @@ -0,0 +1,14 @@ +--- +############################################################################## +# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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: restart nova compute service + service: + name: nova-compute + state: restarted diff --git a/ansible/roles/restart_nova_scheduler/tasks/main.yaml b/ansible/roles/restart_nova_scheduler/tasks/main.yaml new file mode 100644 index 000000000..543e946c3 --- /dev/null +++ b/ansible/roles/restart_nova_scheduler/tasks/main.yaml @@ -0,0 +1,14 @@ +--- +############################################################################## +# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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: restart nova scheduler service + service: + name: nova-scheduler + state: restarted diff --git a/ansible/roles/scheduler_default_filters_reset/tasks/main.yaml b/ansible/roles/scheduler_default_filters_reset/tasks/main.yaml new file mode 100644 index 000000000..21e0efcfd --- /dev/null +++ b/ansible/roles/scheduler_default_filters_reset/tasks/main.yaml @@ -0,0 +1,15 @@ +--- +############################################################################## +# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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: reset scheduler default filters + lineinfile: + dest: /etc/nova/nova.conf + state: absent + regexp: 'scheduler_default_filters' diff --git a/ansible/roles/scheduler_default_filters_setup/tasks/main.yaml b/ansible/roles/scheduler_default_filters_setup/tasks/main.yaml new file mode 100644 index 000000000..5429ca91b --- /dev/null +++ b/ansible/roles/scheduler_default_filters_setup/tasks/main.yaml @@ -0,0 +1,15 @@ +--- +############################################################################## +# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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: add scheduler_default_filters for cpu pinning + lineinfile: + dest: /etc/nova/nova.conf + insertafter: 'DEFAULT' + line: 'scheduler_default_filters={{cpu_pin_filters}}' diff --git a/ansible/roles/scheduler_default_filters_setup/vars/main.yaml b/ansible/roles/scheduler_default_filters_setup/vars/main.yaml new file mode 100644 index 000000000..47b944470 --- /dev/null +++ b/ansible/roles/scheduler_default_filters_setup/vars/main.yaml @@ -0,0 +1 @@ +cpu_pin_filters: NUMATopologyFilter,AggregateInstanceExtraSpecsFilter diff --git a/ansible/roles/vcpu_pin_set_reset/tasks/main.yaml b/ansible/roles/vcpu_pin_set_reset/tasks/main.yaml new file mode 100644 index 000000000..f862c3c8f --- /dev/null +++ b/ansible/roles/vcpu_pin_set_reset/tasks/main.yaml @@ -0,0 +1,21 @@ +--- +############################################################################## +# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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: remove vcpu pin set + lineinfile: + dest: /etc/nova/nova.conf + state: absent + regexp: 'vcpu_pin_set' + +- name: remove memory reserved for host + lineinfile: + dest: /etc/nova/nova.conf + state: absent + regexp: 'reserved_host_memory_mb' diff --git a/ansible/roles/vcpu_pin_set_setup/tasks/main.yaml b/ansible/roles/vcpu_pin_set_setup/tasks/main.yaml new file mode 100644 index 000000000..2a456ab9a --- /dev/null +++ b/ansible/roles/vcpu_pin_set_setup/tasks/main.yaml @@ -0,0 +1,21 @@ +--- +############################################################################## +# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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: set memory reserved for host + lineinfile: + dest: /etc/nova/nova.conf + insertafter: 'DEFAULT' + line: 'reserved_host_memory_mb={{host_memory}}' + +- name: set vcpu pin set + lineinfile: + dest: /etc/nova/nova.conf + insertafter: 'DEFAULT' + line: 'vcpu_pin_set={{cpu_set}} diff --git a/ansible/roles/vcpu_pin_set_setup/vars/main.yaml b/ansible/roles/vcpu_pin_set_setup/vars/main.yaml new file mode 100644 index 000000000..e5d407b44 --- /dev/null +++ b/ansible/roles/vcpu_pin_set_setup/vars/main.yaml @@ -0,0 +1,2 @@ +cpu_set: 0,2,4,6,8,10,12,14,16 +host_memory: 512 diff --git a/api/resources/testsuites_action.py b/api/resources/testsuites_action.py index f833dc22f..a385290d9 100644 --- a/api/resources/testsuites_action.py +++ b/api/resources/testsuites_action.py @@ -13,9 +13,11 @@ from __future__ import absolute_import import uuid import os import logging +import yaml -from api import conf from api.utils import common as common_utils +from yardstick.common import constants as consts +from yardstick.common.task_template import TaskTemplate logger = logging.getLogger(__name__) @@ -30,8 +32,7 @@ def runTestSuite(args): if 'suite' not in opts: opts['suite'] = 'true' - testsuite = os.path.join(conf.TEST_SUITE_PATH, - conf.TEST_SUITE_PRE + testsuite + '.yaml') + testsuite = os.path.join(consts.TESTSUITE_DIR, '{}.yaml'.format(testsuite)) task_id = str(uuid.uuid4()) @@ -40,6 +41,22 @@ def runTestSuite(args): logger.debug('The command_list is: %s', command_list) logger.debug('Start to execute command list') - common_utils.exec_command_task(command_list, task_id) + task_dic = { + 'task_id': task_id, + 'details': _get_cases_from_suite_file(testsuite) + } + common_utils.exec_command_task(command_list, task_dic) return common_utils.result_handler('success', task_id) + + +def _get_cases_from_suite_file(testsuite): + def get_name(full_name): + return os.path.splitext(full_name)[0] + + with open(testsuite) as f: + contents = TaskTemplate.render(f.read()) + + suite_dic = yaml.safe_load(contents) + testcases = (get_name(c['file_name']) for c in suite_dic['test_cases']) + return ','.join(testcases) diff --git a/docs/apidocs/index.rst b/docs/apidocs/index.rst index 8bd407341..b7f49f536 100644 --- a/docs/apidocs/index.rst +++ b/docs/apidocs/index.rst @@ -1,3 +1,5 @@ +.. _yardstick-apidocs: + .. This work is licensed under a Creative Commons Attribution 4.0 International .. License. .. http://creativecommons.org/licenses/by/4.0 diff --git a/docs/release/index.rst b/docs/release/release-notes/index.rst index c9cadc539..11a508ca6 100644 --- a/docs/release/index.rst +++ b/docs/release/release-notes/index.rst @@ -1,3 +1,5 @@ +.. _yardstick-releasenotes: + .. This work is licensed under a Creative Commons Attribution 4.0 International .. License. .. http://creativecommons.org/licenses/by/4.0 diff --git a/docs/release/release-notes.rst b/docs/release/release-notes/release-notes.rst index 8df0776df..8df0776df 100644 --- a/docs/release/release-notes.rst +++ b/docs/release/release-notes/release-notes.rst diff --git a/docs/results/index.rst b/docs/release/results/index.rst index 2b67f1b22..0560152e0 100644 --- a/docs/results/index.rst +++ b/docs/release/results/index.rst @@ -1,3 +1,5 @@ +.. _yardstick-results: + .. This work is licensed under a Creative Commons Attribution 4.0 International .. License. .. http://creativecommons.org/licenses/by/4.0 diff --git a/docs/results/os-nosdn-kvm-ha.rst b/docs/release/results/os-nosdn-kvm-ha.rst index a8a56f80e..a8a56f80e 100644 --- a/docs/results/os-nosdn-kvm-ha.rst +++ b/docs/release/results/os-nosdn-kvm-ha.rst diff --git a/docs/results/os-nosdn-nofeature-ha.rst b/docs/release/results/os-nosdn-nofeature-ha.rst index 9e52731d5..9e52731d5 100644 --- a/docs/results/os-nosdn-nofeature-ha.rst +++ b/docs/release/results/os-nosdn-nofeature-ha.rst diff --git a/docs/results/os-nosdn-nofeature-noha.rst b/docs/release/results/os-nosdn-nofeature-noha.rst index 8b7c184bb..8b7c184bb 100644 --- a/docs/results/os-nosdn-nofeature-noha.rst +++ b/docs/release/results/os-nosdn-nofeature-noha.rst diff --git a/docs/results/os-odl_l2-bgpvpn-ha.rst b/docs/release/results/os-odl_l2-bgpvpn-ha.rst index 2bd6dc35d..2bd6dc35d 100644 --- a/docs/results/os-odl_l2-bgpvpn-ha.rst +++ b/docs/release/results/os-odl_l2-bgpvpn-ha.rst diff --git a/docs/results/os-odl_l2-nofeature-ha.rst b/docs/release/results/os-odl_l2-nofeature-ha.rst index ac0c5bb59..ac0c5bb59 100644 --- a/docs/results/os-odl_l2-nofeature-ha.rst +++ b/docs/release/results/os-odl_l2-nofeature-ha.rst diff --git a/docs/results/os-odl_l2-sfc-ha.rst b/docs/release/results/os-odl_l2-sfc-ha.rst index e27562cae..e27562cae 100644 --- a/docs/results/os-odl_l2-sfc-ha.rst +++ b/docs/release/results/os-odl_l2-sfc-ha.rst diff --git a/docs/results/os-onos-nofeature-ha.rst b/docs/release/results/os-onos-nofeature-ha.rst index d8b3ace5f..d8b3ace5f 100644 --- a/docs/results/os-onos-nofeature-ha.rst +++ b/docs/release/results/os-onos-nofeature-ha.rst diff --git a/docs/results/os-onos-sfc-ha.rst b/docs/release/results/os-onos-sfc-ha.rst index e52ae3d55..e52ae3d55 100644 --- a/docs/results/os-onos-sfc-ha.rst +++ b/docs/release/results/os-onos-sfc-ha.rst diff --git a/docs/results/overview.rst b/docs/release/results/overview.rst index b4a050545..b4a050545 100644 --- a/docs/results/overview.rst +++ b/docs/release/results/overview.rst diff --git a/docs/results/results.rst b/docs/release/results/results.rst index 04c6b9f87..04c6b9f87 100644 --- a/docs/results/results.rst +++ b/docs/release/results/results.rst diff --git a/docs/results/yardstick-opnfv-ha.rst b/docs/release/results/yardstick-opnfv-ha.rst index ef1617342..ef1617342 100644 --- a/docs/results/yardstick-opnfv-ha.rst +++ b/docs/release/results/yardstick-opnfv-ha.rst diff --git a/docs/results/yardstick-opnfv-kvm.rst b/docs/release/results/yardstick-opnfv-kvm.rst index ee4c6390b..ee4c6390b 100644 --- a/docs/results/yardstick-opnfv-kvm.rst +++ b/docs/release/results/yardstick-opnfv-kvm.rst diff --git a/docs/results/yardstick-opnfv-parser.rst b/docs/release/results/yardstick-opnfv-parser.rst index 520d867ef..520d867ef 100644 --- a/docs/results/yardstick-opnfv-parser.rst +++ b/docs/release/results/yardstick-opnfv-parser.rst diff --git a/docs/results/yardstick-opnfv-vtc.rst b/docs/release/results/yardstick-opnfv-vtc.rst index 059b5491f..059b5491f 100644 --- a/docs/results/yardstick-opnfv-vtc.rst +++ b/docs/release/results/yardstick-opnfv-vtc.rst diff --git a/docs/userguide/01-introduction.rst b/docs/testing/user/userguide/01-introduction.rst index 0e0eea002..0e0eea002 100755 --- a/docs/userguide/01-introduction.rst +++ b/docs/testing/user/userguide/01-introduction.rst diff --git a/docs/userguide/02-methodology.rst b/docs/testing/user/userguide/02-methodology.rst index 34d271095..34d271095 100644 --- a/docs/userguide/02-methodology.rst +++ b/docs/testing/user/userguide/02-methodology.rst diff --git a/docs/userguide/03-architecture.rst b/docs/testing/user/userguide/03-architecture.rst index 03bf00f58..03bf00f58 100755 --- a/docs/userguide/03-architecture.rst +++ b/docs/testing/user/userguide/03-architecture.rst diff --git a/docs/userguide/04-vtc-overview.rst b/docs/testing/user/userguide/04-vtc-overview.rst index 82b20cad5..82b20cad5 100644 --- a/docs/userguide/04-vtc-overview.rst +++ b/docs/testing/user/userguide/04-vtc-overview.rst diff --git a/docs/userguide/05-apexlake_installation.rst b/docs/testing/user/userguide/05-apexlake_installation.rst index d4493e0f8..d4493e0f8 100644 --- a/docs/userguide/05-apexlake_installation.rst +++ b/docs/testing/user/userguide/05-apexlake_installation.rst diff --git a/docs/userguide/06-apexlake_api.rst b/docs/testing/user/userguide/06-apexlake_api.rst index 35a1dbe3e..35a1dbe3e 100644 --- a/docs/userguide/06-apexlake_api.rst +++ b/docs/testing/user/userguide/06-apexlake_api.rst diff --git a/docs/userguide/07-nsb-overview.rst b/docs/testing/user/userguide/07-nsb-overview.rst index 19719f1a7..19719f1a7 100644 --- a/docs/userguide/07-nsb-overview.rst +++ b/docs/testing/user/userguide/07-nsb-overview.rst diff --git a/docs/userguide/08-nsb_installation.rst b/docs/testing/user/userguide/08-nsb_installation.rst index a390bb7d7..a390bb7d7 100644 --- a/docs/userguide/08-nsb_installation.rst +++ b/docs/testing/user/userguide/08-nsb_installation.rst diff --git a/docs/userguide/09-installation.rst b/docs/testing/user/userguide/09-installation.rst index 9c2082a27..9c2082a27 100644 --- a/docs/userguide/09-installation.rst +++ b/docs/testing/user/userguide/09-installation.rst diff --git a/docs/userguide/10-yardstick_plugin.rst b/docs/testing/user/userguide/10-yardstick_plugin.rst index f16dedd02..f16dedd02 100644 --- a/docs/userguide/10-yardstick_plugin.rst +++ b/docs/testing/user/userguide/10-yardstick_plugin.rst diff --git a/docs/userguide/11-result-store-InfluxDB.rst b/docs/testing/user/userguide/11-result-store-InfluxDB.rst index a0bb48a80..a0bb48a80 100644 --- a/docs/userguide/11-result-store-InfluxDB.rst +++ b/docs/testing/user/userguide/11-result-store-InfluxDB.rst diff --git a/docs/userguide/12-grafana.rst b/docs/testing/user/userguide/12-grafana.rst index 416857b71..416857b71 100644 --- a/docs/userguide/12-grafana.rst +++ b/docs/testing/user/userguide/12-grafana.rst diff --git a/docs/userguide/13-list-of-tcs.rst b/docs/testing/user/userguide/13-list-of-tcs.rst index 1b5806cd9..1b5806cd9 100644 --- a/docs/userguide/13-list-of-tcs.rst +++ b/docs/testing/user/userguide/13-list-of-tcs.rst diff --git a/docs/userguide/Yardstick_task_templates.rst b/docs/testing/user/userguide/Yardstick_task_templates.rst index e8130dd2a..e8130dd2a 100755 --- a/docs/userguide/Yardstick_task_templates.rst +++ b/docs/testing/user/userguide/Yardstick_task_templates.rst diff --git a/docs/userguide/comp-intro.rst b/docs/testing/user/userguide/comp-intro.rst index ee68226ad..ee68226ad 100644 --- a/docs/userguide/comp-intro.rst +++ b/docs/testing/user/userguide/comp-intro.rst diff --git a/docs/userguide/glossary.rst b/docs/testing/user/userguide/glossary.rst index f8ff41887..f8ff41887 100644 --- a/docs/userguide/glossary.rst +++ b/docs/testing/user/userguide/glossary.rst diff --git a/docs/userguide/images/Deployment.png b/docs/testing/user/userguide/images/Deployment.png Binary files differindex aca5670cd..aca5670cd 100755 --- a/docs/userguide/images/Deployment.png +++ b/docs/testing/user/userguide/images/Deployment.png diff --git a/docs/userguide/images/Grafana_config.png b/docs/testing/user/userguide/images/Grafana_config.png Binary files differindex cb63098dc..cb63098dc 100644 --- a/docs/userguide/images/Grafana_config.png +++ b/docs/testing/user/userguide/images/Grafana_config.png diff --git a/docs/userguide/images/InfluxDB_store.png b/docs/testing/user/userguide/images/InfluxDB_store.png Binary files differindex 1770fd255..1770fd255 100644 --- a/docs/userguide/images/InfluxDB_store.png +++ b/docs/testing/user/userguide/images/InfluxDB_store.png diff --git a/docs/userguide/images/Logical_view.png b/docs/testing/user/userguide/images/Logical_view.png Binary files differindex cdb805448..cdb805448 100644 --- a/docs/userguide/images/Logical_view.png +++ b/docs/testing/user/userguide/images/Logical_view.png diff --git a/docs/userguide/images/TC002.png b/docs/testing/user/userguide/images/TC002.png Binary files differindex 89154efcc..89154efcc 100644 --- a/docs/userguide/images/TC002.png +++ b/docs/testing/user/userguide/images/TC002.png diff --git a/docs/userguide/images/Use_case.png b/docs/testing/user/userguide/images/Use_case.png Binary files differindex acd52f526..acd52f526 100644 --- a/docs/userguide/images/Use_case.png +++ b/docs/testing/user/userguide/images/Use_case.png diff --git a/docs/userguide/images/add.png b/docs/testing/user/userguide/images/add.png Binary files differindex a88a1b146..a88a1b146 100644 --- a/docs/userguide/images/add.png +++ b/docs/testing/user/userguide/images/add.png diff --git a/docs/userguide/images/login.png b/docs/testing/user/userguide/images/login.png Binary files differindex 045e010e4..045e010e4 100644 --- a/docs/userguide/images/login.png +++ b/docs/testing/user/userguide/images/login.png diff --git a/docs/userguide/images/results_visualization.png b/docs/testing/user/userguide/images/results_visualization.png Binary files differindex cd092808b..cd092808b 100644 --- a/docs/userguide/images/results_visualization.png +++ b/docs/testing/user/userguide/images/results_visualization.png diff --git a/docs/userguide/images/test_execution_flow.png b/docs/testing/user/userguide/images/test_execution_flow.png Binary files differindex c20a931a4..c20a931a4 100644 --- a/docs/userguide/images/test_execution_flow.png +++ b/docs/testing/user/userguide/images/test_execution_flow.png diff --git a/docs/userguide/index.rst b/docs/testing/user/userguide/index.rst index 826a9d9bf..75dcbcd82 100644 --- a/docs/userguide/index.rst +++ b/docs/testing/user/userguide/index.rst @@ -1,10 +1,12 @@ +.. _yardstick-userguide: + .. This work is licensed under a Creative Commons Attribution 4.0 International .. License. .. http://creativecommons.org/licenses/by/4.0 .. (c) OPNFV, Ericsson AB and others. ================== -Yardstick Overview +Performance Testing User Guide (Yardstick) ================== .. toctree:: diff --git a/docs/userguide/opnfv_yardstick_tc001.rst b/docs/testing/user/userguide/opnfv_yardstick_tc001.rst index b53c508a6..b53c508a6 100644 --- a/docs/userguide/opnfv_yardstick_tc001.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc001.rst diff --git a/docs/userguide/opnfv_yardstick_tc002.rst b/docs/testing/user/userguide/opnfv_yardstick_tc002.rst index c98780fd5..c98780fd5 100644 --- a/docs/userguide/opnfv_yardstick_tc002.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc002.rst diff --git a/docs/userguide/opnfv_yardstick_tc004.rst b/docs/testing/user/userguide/opnfv_yardstick_tc004.rst index 3554b3826..3554b3826 100644 --- a/docs/userguide/opnfv_yardstick_tc004.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc004.rst diff --git a/docs/userguide/opnfv_yardstick_tc005.rst b/docs/testing/user/userguide/opnfv_yardstick_tc005.rst index 1c2d71d81..1c2d71d81 100644 --- a/docs/userguide/opnfv_yardstick_tc005.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc005.rst diff --git a/docs/userguide/opnfv_yardstick_tc006.rst b/docs/testing/user/userguide/opnfv_yardstick_tc006.rst index 2ccb417c1..2ccb417c1 100644 --- a/docs/userguide/opnfv_yardstick_tc006.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc006.rst diff --git a/docs/userguide/opnfv_yardstick_tc007.rst b/docs/testing/user/userguide/opnfv_yardstick_tc007.rst index 87663f816..87663f816 100644 --- a/docs/userguide/opnfv_yardstick_tc007.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc007.rst diff --git a/docs/userguide/opnfv_yardstick_tc008.rst b/docs/testing/user/userguide/opnfv_yardstick_tc008.rst index a4ecaf6ae..a4ecaf6ae 100644 --- a/docs/userguide/opnfv_yardstick_tc008.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc008.rst diff --git a/docs/userguide/opnfv_yardstick_tc009.rst b/docs/testing/user/userguide/opnfv_yardstick_tc009.rst index d6f445361..d6f445361 100644 --- a/docs/userguide/opnfv_yardstick_tc009.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc009.rst diff --git a/docs/userguide/opnfv_yardstick_tc010.rst b/docs/testing/user/userguide/opnfv_yardstick_tc010.rst index 202307de6..202307de6 100644 --- a/docs/userguide/opnfv_yardstick_tc010.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc010.rst diff --git a/docs/userguide/opnfv_yardstick_tc011.rst b/docs/testing/user/userguide/opnfv_yardstick_tc011.rst index 48bdef497..48bdef497 100644 --- a/docs/userguide/opnfv_yardstick_tc011.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc011.rst diff --git a/docs/userguide/opnfv_yardstick_tc012.rst b/docs/testing/user/userguide/opnfv_yardstick_tc012.rst index b56e829f5..b56e829f5 100644 --- a/docs/userguide/opnfv_yardstick_tc012.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc012.rst diff --git a/docs/userguide/opnfv_yardstick_tc014.rst b/docs/testing/user/userguide/opnfv_yardstick_tc014.rst index 1b0d7831a..1b0d7831a 100644 --- a/docs/userguide/opnfv_yardstick_tc014.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc014.rst diff --git a/docs/userguide/opnfv_yardstick_tc019.rst b/docs/testing/user/userguide/opnfv_yardstick_tc019.rst index 1af502253..1af502253 100644 --- a/docs/userguide/opnfv_yardstick_tc019.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc019.rst diff --git a/docs/userguide/opnfv_yardstick_tc020.rst b/docs/testing/user/userguide/opnfv_yardstick_tc020.rst index f2f1d408b..f2f1d408b 100644 --- a/docs/userguide/opnfv_yardstick_tc020.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc020.rst diff --git a/docs/userguide/opnfv_yardstick_tc021.rst b/docs/testing/user/userguide/opnfv_yardstick_tc021.rst index c7adc870a..c7adc870a 100644 --- a/docs/userguide/opnfv_yardstick_tc021.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc021.rst diff --git a/docs/userguide/opnfv_yardstick_tc024.rst b/docs/testing/user/userguide/opnfv_yardstick_tc024.rst index 8d15e8d2f..8d15e8d2f 100644 --- a/docs/userguide/opnfv_yardstick_tc024.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc024.rst diff --git a/docs/userguide/opnfv_yardstick_tc025.rst b/docs/testing/user/userguide/opnfv_yardstick_tc025.rst index 0e2e9a5f8..0e2e9a5f8 100644 --- a/docs/userguide/opnfv_yardstick_tc025.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc025.rst diff --git a/docs/userguide/opnfv_yardstick_tc027.rst b/docs/testing/user/userguide/opnfv_yardstick_tc027.rst index 125fd59fa..125fd59fa 100644 --- a/docs/userguide/opnfv_yardstick_tc027.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc027.rst diff --git a/docs/userguide/opnfv_yardstick_tc028.rst b/docs/testing/user/userguide/opnfv_yardstick_tc028.rst index 24206f33f..24206f33f 100644 --- a/docs/userguide/opnfv_yardstick_tc028.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc028.rst diff --git a/docs/userguide/opnfv_yardstick_tc037.rst b/docs/testing/user/userguide/opnfv_yardstick_tc037.rst index 5a6e1eaae..5a6e1eaae 100644 --- a/docs/userguide/opnfv_yardstick_tc037.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc037.rst diff --git a/docs/userguide/opnfv_yardstick_tc038.rst b/docs/testing/user/userguide/opnfv_yardstick_tc038.rst index 692c76819..692c76819 100644 --- a/docs/userguide/opnfv_yardstick_tc038.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc038.rst diff --git a/docs/userguide/opnfv_yardstick_tc040.rst b/docs/testing/user/userguide/opnfv_yardstick_tc040.rst index d62fbf787..d62fbf787 100644 --- a/docs/userguide/opnfv_yardstick_tc040.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc040.rst diff --git a/docs/userguide/opnfv_yardstick_tc042.rst b/docs/testing/user/userguide/opnfv_yardstick_tc042.rst index 8660d9297..8660d9297 100644 --- a/docs/userguide/opnfv_yardstick_tc042.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc042.rst diff --git a/docs/userguide/opnfv_yardstick_tc043.rst b/docs/testing/user/userguide/opnfv_yardstick_tc043.rst index a873696dc..a873696dc 100644 --- a/docs/userguide/opnfv_yardstick_tc043.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc043.rst diff --git a/docs/userguide/opnfv_yardstick_tc044.rst b/docs/testing/user/userguide/opnfv_yardstick_tc044.rst index 2be8517a1..2be8517a1 100644 --- a/docs/userguide/opnfv_yardstick_tc044.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc044.rst diff --git a/docs/userguide/opnfv_yardstick_tc045.rst b/docs/testing/user/userguide/opnfv_yardstick_tc045.rst index 0b0993c34..0b0993c34 100644 --- a/docs/userguide/opnfv_yardstick_tc045.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc045.rst diff --git a/docs/userguide/opnfv_yardstick_tc046.rst b/docs/testing/user/userguide/opnfv_yardstick_tc046.rst index cce6c6884..cce6c6884 100644 --- a/docs/userguide/opnfv_yardstick_tc046.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc046.rst diff --git a/docs/userguide/opnfv_yardstick_tc047.rst b/docs/testing/user/userguide/opnfv_yardstick_tc047.rst index 95158cfd6..95158cfd6 100644 --- a/docs/userguide/opnfv_yardstick_tc047.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc047.rst diff --git a/docs/userguide/opnfv_yardstick_tc048.rst b/docs/testing/user/userguide/opnfv_yardstick_tc048.rst index 21c00d1fe..21c00d1fe 100644 --- a/docs/userguide/opnfv_yardstick_tc048.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc048.rst diff --git a/docs/userguide/opnfv_yardstick_tc049.rst b/docs/testing/user/userguide/opnfv_yardstick_tc049.rst index f58bb9989..f58bb9989 100644 --- a/docs/userguide/opnfv_yardstick_tc049.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc049.rst diff --git a/docs/userguide/opnfv_yardstick_tc050.rst b/docs/testing/user/userguide/opnfv_yardstick_tc050.rst index 8890c9d53..8890c9d53 100644 --- a/docs/userguide/opnfv_yardstick_tc050.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc050.rst diff --git a/docs/userguide/opnfv_yardstick_tc051.rst b/docs/testing/user/userguide/opnfv_yardstick_tc051.rst index 3402ccd92..3402ccd92 100644 --- a/docs/userguide/opnfv_yardstick_tc051.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc051.rst diff --git a/docs/userguide/opnfv_yardstick_tc052.rst b/docs/testing/user/userguide/opnfv_yardstick_tc052.rst index 9514b6819..9514b6819 100644 --- a/docs/userguide/opnfv_yardstick_tc052.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc052.rst diff --git a/docs/userguide/opnfv_yardstick_tc053.rst b/docs/testing/user/userguide/opnfv_yardstick_tc053.rst index 3c6bbc628..3c6bbc628 100644 --- a/docs/userguide/opnfv_yardstick_tc053.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc053.rst diff --git a/docs/userguide/opnfv_yardstick_tc054.rst b/docs/testing/user/userguide/opnfv_yardstick_tc054.rst index 7f92be2bc..7f92be2bc 100644 --- a/docs/userguide/opnfv_yardstick_tc054.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc054.rst diff --git a/docs/userguide/opnfv_yardstick_tc055.rst b/docs/testing/user/userguide/opnfv_yardstick_tc055.rst index c861ca90c..c861ca90c 100644 --- a/docs/userguide/opnfv_yardstick_tc055.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc055.rst diff --git a/docs/userguide/opnfv_yardstick_tc061.rst b/docs/testing/user/userguide/opnfv_yardstick_tc061.rst index 1d424414e..1d424414e 100644 --- a/docs/userguide/opnfv_yardstick_tc061.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc061.rst diff --git a/docs/userguide/opnfv_yardstick_tc063.rst b/docs/testing/user/userguide/opnfv_yardstick_tc063.rst index a77653aa5..a77653aa5 100644 --- a/docs/userguide/opnfv_yardstick_tc063.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc063.rst diff --git a/docs/userguide/opnfv_yardstick_tc069.rst b/docs/testing/user/userguide/opnfv_yardstick_tc069.rst index af0e64fbf..af0e64fbf 100644 --- a/docs/userguide/opnfv_yardstick_tc069.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc069.rst diff --git a/docs/userguide/opnfv_yardstick_tc070.rst b/docs/testing/user/userguide/opnfv_yardstick_tc070.rst index 64fcc0c91..64fcc0c91 100644 --- a/docs/userguide/opnfv_yardstick_tc070.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc070.rst diff --git a/docs/userguide/opnfv_yardstick_tc071.rst b/docs/testing/user/userguide/opnfv_yardstick_tc071.rst index 673480b55..673480b55 100644 --- a/docs/userguide/opnfv_yardstick_tc071.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc071.rst diff --git a/docs/userguide/opnfv_yardstick_tc072.rst b/docs/testing/user/userguide/opnfv_yardstick_tc072.rst index 2e7ee057c..2e7ee057c 100644 --- a/docs/userguide/opnfv_yardstick_tc072.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc072.rst diff --git a/docs/userguide/opnfv_yardstick_tc073.rst b/docs/testing/user/userguide/opnfv_yardstick_tc073.rst index ad4526405..ad4526405 100644 --- a/docs/userguide/opnfv_yardstick_tc073.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc073.rst diff --git a/docs/userguide/opnfv_yardstick_tc074.rst b/docs/testing/user/userguide/opnfv_yardstick_tc074.rst index 92cd51439..92cd51439 100644 --- a/docs/userguide/opnfv_yardstick_tc074.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc074.rst diff --git a/docs/userguide/opnfv_yardstick_tc075.rst b/docs/testing/user/userguide/opnfv_yardstick_tc075.rst index a6ff34447..a6ff34447 100644 --- a/docs/userguide/opnfv_yardstick_tc075.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc075.rst diff --git a/docs/userguide/opnfv_yardstick_tc076.rst b/docs/testing/user/userguide/opnfv_yardstick_tc076.rst index ac7bde794..ac7bde794 100644 --- a/docs/userguide/opnfv_yardstick_tc076.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc076.rst diff --git a/docs/userguide/references.rst b/docs/testing/user/userguide/references.rst index 05729ba75..05729ba75 100644 --- a/docs/userguide/references.rst +++ b/docs/testing/user/userguide/references.rst diff --git a/docs/userguide/testcase_description_v2_template.rst b/docs/testing/user/userguide/testcase_description_v2_template.rst index 91c2a7e33..91c2a7e33 100644 --- a/docs/userguide/testcase_description_v2_template.rst +++ b/docs/testing/user/userguide/testcase_description_v2_template.rst diff --git a/fuel-plugin/deployment_scripts/puppet/manifests/yardstick-install.pp b/fuel-plugin/deployment_scripts/puppet/manifests/yardstick-install.pp index e69371141..3741bacf2 100644 --- a/fuel-plugin/deployment_scripts/puppet/manifests/yardstick-install.pp +++ b/fuel-plugin/deployment_scripts/puppet/manifests/yardstick-install.pp @@ -1,5 +1,4 @@ -$fuel_settings = parseyaml(file('/etc/astute.yaml')) -$master_ip = $::fuel_settings['master_ip'] +$master_ip = hiera('master_ip') $access_hash = hiera_hash('access', {}) $admin_tenant = $access_hash['tenant'] diff --git a/nsb_setup.sh b/nsb_setup.sh index 02258a577..332c0345c 100755 --- a/nsb_setup.sh +++ b/nsb_setup.sh @@ -28,7 +28,8 @@ if [ "$(whoami)" != "root" ]; then fi INSTALL_BIN_PATH="/opt/nsb_bin" -TREX_DOWNLOAD="https://trex-tgn.cisco.com/trex/release/v2.05.tar.gz" +TREX_VERSION="v2.20" +TREX_DOWNLOAD="https://trex-tgn.cisco.com/trex/release/$TREX_VERSION.tar.gz" DPDK_DOWNLOAD="http://dpdk.org/browse/dpdk/snapshot/dpdk-16.07.zip" VIRTUAL_VENV="$INSTALL_BIN_PATH/yardstick_venv" @@ -82,7 +83,7 @@ install_trex() { TREX_DIR=$INSTALL_BIN_PATH/trex/scripts if [ -d "$TREX_DIR" ]; then - echo "Trex v2.05already installed. Make sure it contains PYTHONPATH which is required to run TRex" + echo "Trex v2.20 already installed. Make sure it contains PYTHONPATH which is required to run TRex" else echo "Build TRex and installing Trex TG in $INSTALL_BIN_PATH/trex" rm -rf ${TREX_DOWNLOAD##*/} @@ -93,8 +94,8 @@ install_trex() pushd . rm -rf trex mkdir -p trex - mv v2.05 trex/scripts - rm -rf v2.05.tar.gz + mv $TREX_VERSION trex/scripts + rm -rf $TREX_VERSION.tar.gz cd trex/scripts/ko/src/ make make install @@ -182,7 +183,7 @@ install_dpdk() push_nsb_binary() { - if [ ! -d "$INSTALL_BIN_PATH/trex" ]; then + if [ ! -d "$INSTALL_BIN_PATH/trex/scripts" ]; then cp -fr "$REPO_DIR/trex" "$INSTALL_BIN_PATH" fi rm -rf "$REPO_DIR/trex" diff --git a/tests/ci/load_images.sh b/tests/ci/load_images.sh index e5a7ae034..b438e09e4 100755 --- a/tests/ci/load_images.sh +++ b/tests/ci/load_images.sh @@ -16,25 +16,25 @@ YARD_IMG_ARCH=amd64 export YARD_IMG_ARCH HW_FW_TYPE="" -if [ "${YARD_IMG_ARCH}" = "arm64" ]; then +if [ "${YARD_IMG_ARCH}" == "arm64" ]; then HW_FW_TYPE=uefi fi export HW_FW_TYPE if ! grep -q "Defaults env_keep += \"YARD_IMG_ARCH\"" "/etc/sudoers"; then - sudo echo "Defaults env_keep += \"YARD_IMG_ARCH YARDSTICK_REPO_DIR\"" >> /etc/sudoers + echo "Defaults env_keep += \"YARD_IMG_ARCH YARDSTICK_REPO_DIR\"" | sudo tee -a /etc/sudoers fi ARCH_SCRIPT="test -f /etc/fuel_openstack_arch && grep -q arm64 /etc/fuel_openstack_arch" if [ "$INSTALLER_TYPE" == "fuel" ]; then - sshpass -p r00tme ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l root $INSTALLER_IP "${ARCH_SCRIPT}" && YARD_IMG_ARCH=arm64 + sshpass -p r00tme ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l root "${INSTALLER_IP}" "${ARCH_SCRIPT}" && YARD_IMG_ARCH=arm64 fi UCA_HOST="cloud-images.ubuntu.com" -if [ "${YARD_IMG_ARCH}"= "arm64" ]; then +if [ "${YARD_IMG_ARCH}" == "arm64" ]; then export CLOUD_IMG_URL="http://${UCA_HOST}/${release}/current/${release}-server-cloudimg-${YARD_IMG_ARCH}.tar.gz" if ! grep -q "Defaults env_keep += \"CLOUD_IMG_URL\"" "/etc/sudoers"; then - sudo echo "Defaults env_keep += \"CLOUD_IMG_URL\"" >> /etc/sudoers + echo "Defaults env_keep += \"CLOUD_IMG_URL\"" | sudo tee -a /etc/sudoers fi fi @@ -44,22 +44,24 @@ build_yardstick_image() echo "========== Build yardstick cloud image ==========" if [[ "$DEPLOY_SCENARIO" == *"-lxd-"* ]]; then - local cmd="sudo $(which yardstick-img-lxd-modify) $(pwd)/tools/ubuntu-server-cloudimg-modify.sh" + local cmd + cmd="sudo $(which yardstick-img-lxd-modify) $(pwd)/tools/ubuntu-server-cloudimg-modify.sh" # Build the image. Retry once if the build fails $cmd || $cmd - if [ ! -f $RAW_IMAGE ]; then + if [ ! -f "${RAW_IMAGE}" ]; then echo "Failed building RAW image" exit 1 fi else - local cmd="sudo $(which yardstick-img-modify) $(pwd)/tools/ubuntu-server-cloudimg-modify.sh" + local cmd + cmd="sudo $(which yardstick-img-modify) $(pwd)/tools/ubuntu-server-cloudimg-modify.sh" # Build the image. Retry once if the build fails $cmd || $cmd - if [ ! -f $QCOW_IMAGE ]; then + if [ ! -f "${QCOW_IMAGE}" ]; then echo "Failed building QCOW image" exit 1 fi @@ -71,24 +73,24 @@ load_yardstick_image() echo echo "========== Loading yardstick cloud image ==========" EXTRA_PARAMS="" - if [[ "${YARD_IMG_ARCH}" = "arm64" && "${YARD_IMG_AKI}" = "true" ]]; then + if [[ "${YARD_IMG_ARCH}" == "arm64" && "${YARD_IMG_AKI}" == "true" ]]; then CLOUD_IMAGE="/tmp/${release}-server-cloudimg-${YARD_IMG_ARCH}.tar.gz" CLOUD_KERNEL="/tmp/${release}-server-cloudimg-${YARD_IMG_ARCH}-vmlinuz-generic" cd /tmp if [ ! -f "${CLOUD_IMAGE}" ]; then - wget $CLOUD_IMG_URL + wget "${CLOUD_IMG_URL}" fi if [ ! -f "${CLOUD_KERNEL}" ]; then - tar zxf $CLOUD_IMAGE $(basename $CLOUD_KERNEL) + tar xf "${CLOUD_IMAGE}" "${CLOUD_KERNEL##**/}" fi create_kernel=$(openstack image create \ --public \ --disk-format qcow2 \ --container-format bare \ - --file $CLOUD_KERNEL \ + --file ${CLOUD_KERNEL} \ yardstick-${release}-kernel) - GLANCE_KERNEL_ID=$(echo "$create_kernel" | grep " id " | awk '{print $(NF-1)}') + GLANCE_KERNEL_ID=$(echo "$create_kernel" | awk '/ id / {print $(NF-1)}') if [ -z "$GLANCE_KERNEL_ID" ]; then echo 'Failed uploading kernel to cloud'. exit 1 @@ -98,8 +100,8 @@ load_yardstick_image() EXTRA_PARAMS="--property kernel_id=$GLANCE_KERNEL_ID --property os_command_line=\"$command_line\"" - rm -f $CLOUD_KERNEL $CLOUD_IMAGE - cd $YARDSTICK_REPO_DIR + rm -f -- "${CLOUD_KERNEL}" "${CLOUD_IMAGE}" + cd "${YARDSTICK_REPO_DIR}" fi # VPP requires guest memory to be backed by large pages @@ -116,16 +118,16 @@ load_yardstick_image() --public \ --disk-format root-tar \ --container-format bare \ - $EXTRA_PARAMS \ - --file $RAW_IMAGE \ + ${EXTRA_PARAMS} \ + --file ${RAW_IMAGE} \ yardstick-image) else output=$(eval openstack image create \ --public \ --disk-format qcow2 \ --container-format bare \ - $EXTRA_PARAMS \ - --file $QCOW_IMAGE \ + ${EXTRA_PARAMS} \ + --file ${QCOW_IMAGE} \ yardstick-image) fi @@ -138,10 +140,10 @@ load_yardstick_image() exit 1 fi - if [ "$DEPLOY_SCENARIO" == *"-lxd-"* ]; then - sudo rm -f $RAW_IMAGE + if [[ "$DEPLOY_SCENARIO" == *"-lxd-"* ]]; then + sudo rm -f -- "${RAW_IMAGE}" else - sudo rm -f $QCOW_IMAGE + sudo rm -f -- "${QCOW_IMAGE}" fi echo "Glance image id: $GLANCE_IMAGE_ID" @@ -163,8 +165,8 @@ load_cirros_image() output=$(openstack image create \ --disk-format qcow2 \ --container-format bare \ - $EXTRA_PARAMS \ - --file $image_file \ + ${EXTRA_PARAMS} \ + --file ${image_file} \ cirros-0.3.3) echo "$output" @@ -233,12 +235,12 @@ main() build_yardstick_image load_yardstick_image - if [ "${YARD_IMG_ARCH}" = "arm64" ]; then + if [ "${YARD_IMG_ARCH}" == "arm64" ]; then sed -i 's/image: cirros-0.3.3/image: TestVM/g' tests/opnfv/test_cases/opnfv_yardstick_tc002.yaml \ samples/ping.yaml #We have overlapping IP with the real network for filename in tests/opnfv/test_cases/*; do - sed -i "s/cidr: '10.0.1.0\/24'/cidr: '10.3.1.0\/24'/g" $filename + sed -i "s/cidr: '10.0.1.0\/24'/cidr: '10.3.1.0\/24'/g" "${filename}" done else load_cirros_image diff --git a/tests/opnfv/test_suites/opnfv_k8-nosdn-nofeature-noha_daily.yaml b/tests/opnfv/test_suites/opnfv_k8-nosdn-nofeature-noha_daily.yaml new file mode 100644 index 000000000..6ac1a7523 --- /dev/null +++ b/tests/opnfv/test_suites/opnfv_k8-nosdn-nofeature-noha_daily.yaml @@ -0,0 +1,62 @@ +############################################################################## +# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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 +############################################################################## +--- +# k8 nosdn nofeature noha daily task suite + +schema: "yardstick:suite:0.1" + +name: "k8-nosdn-nofeature-noha" +test_cases_dir: "tests/opnfv/test_cases/" +test_cases: +- + file_name: opnfv_yardstick_tc002.yaml +- + file_name: opnfv_yardstick_tc005.yaml +- + file_name: opnfv_yardstick_tc010.yaml +- + file_name: opnfv_yardstick_tc011.yaml +- + file_name: opnfv_yardstick_tc012.yaml +- + file_name: opnfv_yardstick_tc014.yaml +- + file_name: opnfv_yardstick_tc037.yaml +- + file_name: opnfv_yardstick_tc055.yaml + constraint: + installer: compass + pod: huawei-pod1 + task_args: + huawei-pod1: '{"pod_info": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml", + "host": "node5.yardstick-TC055"}' +- + file_name: opnfv_yardstick_tc063.yaml + constraint: + installer: compass + pod: huawei-pod1 + task_args: + huawei-pod1: '{"pod_info": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml", + "host": "node5.yardstick-TC063"}' +- + file_name: opnfv_yardstick_tc069.yaml +- + file_name: opnfv_yardstick_tc070.yaml +- + file_name: opnfv_yardstick_tc071.yaml +- + file_name: opnfv_yardstick_tc072.yaml +- + file_name: opnfv_yardstick_tc075.yaml + constraint: + installer: compass + pod: huawei-pod1 + task_args: + huawei-pod1: '{"pod_info": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml", + "host": "node1.LF"}' diff --git a/tests/opnfv/test_suites/opnfv_os-nosdn-openo-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-nosdn-openo-ha_daily.yaml new file mode 100644 index 000000000..49cae7b68 --- /dev/null +++ b/tests/opnfv/test_suites/opnfv_os-nosdn-openo-ha_daily.yaml @@ -0,0 +1,116 @@ +############################################################################## +# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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 +############################################################################## +--- +# os nosdn openo ha daily task suite + +schema: "yardstick:suite:0.1" + +name: "os-nosdn-openo-ha" +test_cases_dir: "tests/opnfv/test_cases/" +test_cases: +- + file_name: opnfv_yardstick_tc002.yaml +- + file_name: opnfv_yardstick_tc005.yaml +- + file_name: opnfv_yardstick_tc010.yaml +- + file_name: opnfv_yardstick_tc011.yaml +- + file_name: opnfv_yardstick_tc012.yaml +- + file_name: opnfv_yardstick_tc014.yaml +- + file_name: opnfv_yardstick_tc037.yaml +- + file_name: opnfv_yardstick_tc043.yaml + constraint: + installer: compass + pod: huawei-pod1 + task_args: + huawei-pod1: '{"pod_info": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml", + "host": "node4.LF","target": "node5.LF"}' +- + file_name: opnfv_yardstick_tc045.yaml + constraint: + installer: fuel +- + file_name: opnfv_yardstick_tc046.yaml + constraint: + installer: fuel +- + file_name: opnfv_yardstick_tc047.yaml + constraint: + installer: fuel +- + file_name: opnfv_yardstick_tc048.yaml + constraint: + installer: fuel +- + file_name: opnfv_yardstick_tc049.yaml + constraint: + installer: fuel +- + file_name: opnfv_yardstick_tc050.yaml + constraint: + installer: fuel +- + file_name: opnfv_yardstick_tc051.yaml + constraint: + installer: fuel +- + file_name: opnfv_yardstick_tc052.yaml + constraint: + installer: fuel +- + file_name: opnfv_yardstick_tc053.yaml + constraint: + installer: fuel +- + file_name: opnfv_yardstick_tc055.yaml + constraint: + installer: compass + pod: huawei-pod1 + task_args: + huawei-pod1: '{"pod_info": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml", + "host": "node5.yardstick-TC055"}' +- + file_name: opnfv_yardstick_tc063.yaml + constraint: + installer: compass + pod: huawei-pod1 + task_args: + huawei-pod1: '{"pod_info": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml", + "host": "node5.yardstick-TC063"}' +- + file_name: opnfv_yardstick_tc069.yaml +- + file_name: opnfv_yardstick_tc070.yaml +- + file_name: opnfv_yardstick_tc071.yaml +- + file_name: opnfv_yardstick_tc072.yaml +- + file_name: opnfv_yardstick_tc075.yaml + constraint: + installer: compass + pod: huawei-pod1 + task_args: + huawei-pod1: '{"pod_info": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml", + "host": "node1.LF"}' +- + file_name: opnfv_yardstick_tc027.yaml + constraint: + installer: compass,fuel + pod: huawei-pod1,lf-pod2,ericsson-pod3,ericsson-pod4 + task_args: + huawei-pod1: '{"pod_info": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml"}' + lf-pod2: '{"pod_info": "etc/yardstick/nodes/fuel_baremetal/pod.yaml", "openrc":"/root/openrc", "external_network":"admin_floating_net"}' + ericsson-pod3: '{"pod_info": "etc/yardstick/nodes/fuel_baremetal/pod.yaml", "openrc":"/root/openrc", "external_network":"admin_floating_net"}' + ericsson-pod4: '{"pod_info": "etc/yardstick/nodes/fuel_baremetal/pod.yaml", "openrc":"/root/openrc", "external_network":"admin_floating_net"}' diff --git a/tests/unit/benchmark/contexts/test_node.py b/tests/unit/benchmark/contexts/test_node.py index 53a8ffa93..4b35ca421 100644 --- a/tests/unit/benchmark/contexts/test_node.py +++ b/tests/unit/benchmark/contexts/test_node.py @@ -127,27 +127,23 @@ class NodeContextTestCase(unittest.TestCase): prefix = 'yardstick.benchmark.contexts.node' - @mock.patch('{}.NodeContext._execute_script'.format(prefix)) - def test_deploy(self, execute_script_mock): + @mock.patch('{}.NodeContext._dispatch_script'.format(prefix)) + def test_deploy(self, dispatch_script_mock): obj = node.NodeContext() obj.env = { - 'setup': [ - {'node5': {}} - ] + 'type': 'script' } obj.deploy() - self.assertTrue(execute_script_mock.called) + self.assertTrue(dispatch_script_mock.called) - @mock.patch('{}.NodeContext._execute_script'.format(prefix)) - def test_undeploy(self, execute_script_mock): + @mock.patch('{}.NodeContext._dispatch_script'.format(prefix)) + def test_undeploy(self, dispatch_script_mock): obj = node.NodeContext() obj.env = { - 'teardown': [ - {'node5': {}} - ] + 'type': 'script' } obj.undeploy() - self.assertTrue(execute_script_mock.called) + self.assertTrue(dispatch_script_mock.called) @mock.patch('{}.ssh.SSH._put_file_shell'.format(prefix)) @mock.patch('{}.ssh.SSH.execute'.format(prefix)) diff --git a/tests/unit/benchmark/scenarios/compute/memload_sample_output.txt b/tests/unit/benchmark/scenarios/compute/memload_sample_output.txt index c23917ff7..1793e2f10 100644 --- a/tests/unit/benchmark/scenarios/compute/memload_sample_output.txt +++ b/tests/unit/benchmark/scenarios/compute/memload_sample_output.txt @@ -1,5 +1,3 @@ - total used free shared buffers cached + total used free shared buff/cache available Mem: 263753976 76737332 187016644 2844 853528 67252400 --/+ buffers/cache: 8631404 255122572 Swap: 268029948 0 268029948 - diff --git a/tests/unit/benchmark/scenarios/compute/test_memload.py b/tests/unit/benchmark/scenarios/compute/test_memload.py index 76625ef11..ede3309c2 100644 --- a/tests/unit/benchmark/scenarios/compute/test_memload.py +++ b/tests/unit/benchmark/scenarios/compute/test_memload.py @@ -74,18 +74,33 @@ class MEMLoadTestCase(unittest.TestCase): output = self._read_file("memload_sample_output.txt") mock_ssh.SSH().execute.return_value = (0, output, '') result = m._get_mem_usage() - expected_result = {"max": {"used": 76737332, "cached": 67252400, - "free": 187016644, "shared": 2844, - "total": 263753976, "buffers": 853528}, - "average": {"used": 76737332, "cached": 67252400, - "free": 187016644, "shared": 2844, - "total": 263753976, "buffers": 853528}, - "free": {"memory0": {"used": "76737332", - "cached": "67252400", - "free": "187016644", - "shared": "2844", - "total": "263753976", - "buffers": "853528"}}} + expected_result = { + "max": { + 'shared': 2844, + 'buff/cache': 853528, + 'total': 263753976, + 'free': 187016644, + 'used': 76737332 + }, + "average": { + 'shared': 2844, + 'buff/cache': 853528, + 'total': 263753976, + 'free': 187016644, + 'used': 76737332 + }, + "free": { + "memory0": { + "used": "76737332", + "buff/cache": "853528", + "free": "187016644", + "shared": "2844", + "total": "263753976", + "available": "67252400" + } + } + } + self.assertEqual(result, expected_result) def _read_file(self, filename): @@ -94,3 +109,11 @@ class MEMLoadTestCase(unittest.TestCase): with open(output) as f: sample_output = f.read() return sample_output + + +def main(): + unittest.main() + + +if __name__ == '__main__': + main() diff --git a/tests/unit/dispatcher/test_influxdb.py b/tests/unit/dispatcher/test_influxdb.py index b84389e7e..0c7b58135 100644 --- a/tests/unit/dispatcher/test_influxdb.py +++ b/tests/unit/dispatcher/test_influxdb.py @@ -90,19 +90,21 @@ class InfluxdbDispatcherTestCase(unittest.TestCase): } } + self.yardstick_conf = {'yardstick': {}} + def test_record_result_data_no_target(self): - influxdb = InfluxdbDispatcher(None) + influxdb = InfluxdbDispatcher(None, self.yardstick_conf) influxdb.target = '' self.assertEqual(influxdb.record_result_data(self.data1), -1) def test_record_result_data_no_case_name(self): - influxdb = InfluxdbDispatcher(None) + influxdb = InfluxdbDispatcher(None, self.yardstick_conf) self.assertEqual(influxdb.record_result_data(self.data2), -1) @mock.patch('yardstick.dispatcher.influxdb.requests') def test_record_result_data(self, mock_requests): type(mock_requests.post.return_value).status_code = 204 - influxdb = InfluxdbDispatcher(None) + influxdb = InfluxdbDispatcher(None, self.yardstick_conf) self.assertEqual(influxdb.record_result_data(self.data1), 0) self.assertEqual(influxdb.record_result_data(self.data2), 0) self.assertEqual(influxdb.flush_result_data(), 0) @@ -112,7 +114,7 @@ class InfluxdbDispatcherTestCase(unittest.TestCase): 'mpstat.cpu0.%idle=99.00,mpstat.cpu0.%sys=0.00' # need to sort for assert to work line = ",".join(sorted(line.split(','))) - influxdb = InfluxdbDispatcher(None) + influxdb = InfluxdbDispatcher(None, self.yardstick_conf) flattened_data = influxdb._dict_key_flatten( self.data3['benchmark']['data']) result = ",".join( @@ -120,7 +122,7 @@ class InfluxdbDispatcherTestCase(unittest.TestCase): self.assertEqual(result, line) def test__get_nano_timestamp(self): - influxdb = InfluxdbDispatcher(None) + influxdb = InfluxdbDispatcher(None, self.yardstick_conf) results = {'benchmark': {'timestamp': '1451461248.925574'}} self.assertEqual(influxdb._get_nano_timestamp(results), '1451461248925574144') @@ -128,7 +130,7 @@ class InfluxdbDispatcherTestCase(unittest.TestCase): @mock.patch('yardstick.dispatcher.influxdb.time') def test__get_nano_timestamp_except(self, mock_time): results = {} - influxdb = InfluxdbDispatcher(None) + influxdb = InfluxdbDispatcher(None, self.yardstick_conf) mock_time.time.return_value = 1451461248.925574 self.assertEqual(influxdb._get_nano_timestamp(results), '1451461248925574144') diff --git a/tools/ubuntu-server-cloudimg-dpdk-modify.sh b/tools/ubuntu-server-cloudimg-dpdk-modify.sh index 9a3857ee3..847c5053c 100755 --- a/tools/ubuntu-server-cloudimg-dpdk-modify.sh +++ b/tools/ubuntu-server-cloudimg-dpdk-modify.sh @@ -59,7 +59,7 @@ chpasswd: { expire: False } ssh_pwauth: True EOF -linuxheadersversion=`echo ls boot/vmlinuz* | cut -d- -f2-` +linuxheadersversion=$(echo ls boot/vmlinuz* | cut -d- -f2-) apt-get update apt-get install -y \ @@ -80,22 +80,25 @@ apt-get install -y \ rt-tests \ stress \ sysstat \ - linux-headers-$linuxheadersversion \ + linux-headers-"${linuxheadersversion}" \ libpcap-dev \ lua5.2 git clone http://dpdk.org/git/dpdk git clone http://dpdk.org/git/apps/pktgen-dpdk -git clone https://github.com/kdlucas/byte-unixbench.git /opt/tempT -make --directory /opt/tempT/UnixBench/ +CLONE_DEST=/opt/tempT +# remove before cloning +rm -rf -- "${CLONE_DEST}" +git clone https://github.com/kdlucas/byte-unixbench.git "${CLONE_DEST}" +make --directory "${CLONE_DEST}/UnixBench/" -git clone https://github.com/beefyamoeba5/ramspeed.git /opt/tempT/RAMspeed -cd /opt/tempT/RAMspeed/ramspeed-2.6.0 +git clone https://github.com/beefyamoeba5/ramspeed.git "${CLONE_DEST}/RAMspeed" +cd "${CLONE_DEST}/RAMspeed/ramspeed-2.6.0" mkdir temp bash build.sh -git clone https://github.com/beefyamoeba5/cachestat.git /opt/tempT/Cachestat +git clone https://github.com/beefyamoeba5/cachestat.git "${CLONE_DEST}"/Cachestat # restore symlink -ln -sf /run/resolvconf/resolv.conf /etc/resolv.conf +ln -sfrT /run/resolvconf/resolv.conf /etc/resolv.conf diff --git a/tools/ubuntu-server-cloudimg-modify.sh b/tools/ubuntu-server-cloudimg-modify.sh index ce320a205..fb2ae3fe8 100755 --- a/tools/ubuntu-server-cloudimg-modify.sh +++ b/tools/ubuntu-server-cloudimg-modify.sh @@ -24,7 +24,7 @@ if [ $# -eq 1 ]; then fi # iperf3 only available for trusty in backports -if [ grep -q trusty /etc/apt/sources.list ]; then +if grep -q trusty /etc/apt/sources.list ; then if [ "${YARD_IMG_ARCH}" = "arm64" ]; then echo "deb [arch=${YARD_IMG_ARCH}] http://ports.ubuntu.com/ trusty-backports main restricted universe multiverse" >> /etc/apt/sources.list else @@ -48,7 +48,7 @@ EOF apt-get update if [[ "${YARD_IMG_ARCH}" = "arm64" && "$release" = "vivid" ]]; then apt-get install -y \ - linux-headers-$(echo $CLOUD_KERNEL_VERSION | cut -d'-' -f3,4,5) \ + linux-headers-"$(echo ${CLOUD_KERNEL_VERSION} | cut -d'-' -f3,4,5)" \ unzip #resize root partition (/dev/vdb1) It is supposed to be default but the image is booted differently for arm64 cat <<EOF >/etc/cloud/cloud.cfg.d/15_growpart.cfg @@ -76,36 +76,41 @@ apt-get install -y \ stress \ sysstat +CLONE_DEST=/opt/tempT + +# remove before cloning +rm -rf -- "${CLONE_DEST}" + if [[ "${YARD_IMG_ARCH}" = "arm64" && "$release" = "vivid" ]]; then wget https://github.com/kdlucas/byte-unixbench/archive/master.zip unzip master.zip && rm master.zip - mkdir /opt/tempT - mv byte-unixbench-master/UnixBench /opt/tempT + mkdir "${CLONE_DEST}" + mv byte-unixbench-master/UnixBench "${CLONE_DEST}" sed -i -e 's/OPTON += -march=native -mtune=native/OPTON += -march=armv8-a -mtune=generic/g' \ - -e 's/OPTON += -march=native/OPTON += -march=armv8-a/g' /opt/tempT/UnixBench/Makefile + -e 's/OPTON += -march=native/OPTON += -march=armv8-a/g' "${CLONE_DEST}/UnixBench/Makefile" else - git clone https://github.com/kdlucas/byte-unixbench.git /opt/tempT + git clone https://github.com/kdlucas/byte-unixbench.git "${CLONE_DEST}" fi -make --directory /opt/tempT/UnixBench/ +make --directory "${CLONE_DEST}/UnixBench/" if [ "${YARD_IMG_ARCH}" = "arm64" ]; then wget https://github.com/beefyamoeba5/ramspeed/archive/master.zip unzip master.zip && rm master.zip - mkdir /opt/tempT/RAMspeed - mv ramspeed-master/* /opt/tempT/RAMspeed/ + mkdir "${CLONE_DEST}/RAMspeed" + mv ramspeed-master/* "${CLONE_DEST}/RAMspeed/" else - git clone https://github.com/beefyamoeba5/ramspeed.git /opt/tempT/RAMspeed + git clone https://github.com/beefyamoeba5/ramspeed.git "${CLONE_DEST}/RAMspeed" fi -cd /opt/tempT/RAMspeed/ramspeed-2.6.0 +cd "${CLONE_DEST}/RAMspeed/ramspeed-2.6.0" mkdir temp bash build.sh if [[ "${YARD_IMG_ARCH}" = "arm64" && "$release" = "vivid" ]]; then wget https://github.com/beefyamoeba5/cachestat/archive/master.zip unzip master.zip && rm master.zip - mv cachestat-master/cachestat /opt/tempT + mv cachestat-master/cachestat "${CLONE_DEST}" else - git clone https://github.com/beefyamoeba5/cachestat.git /opt/tempT/Cachestat + git clone https://github.com/beefyamoeba5/cachestat.git "${CLONE_DEST}/Cachestat" fi # restore symlink diff --git a/tools/yardstick-img-modify b/tools/yardstick-img-modify index da8e1c92f..b4f632bb2 100755 --- a/tools/yardstick-img-modify +++ b/tools/yardstick-img-modify @@ -109,13 +109,9 @@ setup() { fi mkdir -p $mountdir - #kpartx fails with image paths longer than 63 characters - #try shortest relative path to image as temporary workaround - cd ${workspace} - loopdevice=$(kpartx -l $raw_imgfile_basename | head -1 | cut -f1 -d ' ') + loopdevice=$(kpartx -l $raw_imgfile | head -1 | cut -f1 -d ' ') - kpartx -av $raw_imgfile_basename - cd - + kpartx -av $raw_imgfile if [[ "${YARD_IMG_ARCH}" = "arm64" && "$release" = "vivid" ]]; then e2fsck -p -f /dev/mapper/$loopdevice diff --git a/yardstick/benchmark/contexts/base.py b/yardstick/benchmark/contexts/base.py index 9f2b21537..0be2eee77 100644 --- a/yardstick/benchmark/contexts/base.py +++ b/yardstick/benchmark/contexts/base.py @@ -46,6 +46,10 @@ class Context(object): @abc.abstractmethod def undeploy(self): """Undeploy context.""" + self._delete_context() + + def _delete_context(self): + Context.list.remove(self) @abc.abstractmethod def _get_server(self, attr_name): diff --git a/yardstick/benchmark/contexts/dummy.py b/yardstick/benchmark/contexts/dummy.py index 0edc250f8..c658d3257 100644 --- a/yardstick/benchmark/contexts/dummy.py +++ b/yardstick/benchmark/contexts/dummy.py @@ -33,7 +33,7 @@ class DummyContext(Context): def undeploy(self): """don't need to undeploy""" - pass + super(DummyContext, self).undeploy() def _get_server(self, attr_name): return None diff --git a/yardstick/benchmark/contexts/heat.py b/yardstick/benchmark/contexts/heat.py index 479548b34..571a769eb 100644 --- a/yardstick/benchmark/contexts/heat.py +++ b/yardstick/benchmark/contexts/heat.py @@ -58,6 +58,16 @@ class HeatContext(Context): get_short_key_uuid(self.key_uuid)]) super(HeatContext, self).__init__() + def assign_external_network(self, networks): + sorted_networks = sorted(networks.items()) + external_network = os.environ.get("EXTERNAL_NETWORK", "net04_ext") + have_external_network = [(name, net) + for name, net in sorted_networks if + net.get("external_network")] + # no external net defined, assign it to first network usig os.environ + if sorted_networks and not have_external_network: + sorted_networks[0][1]["external_network"] = external_network + def init(self, attrs): # pragma: no cover """initializes itself from the supplied arguments""" self.name = attrs["name"] @@ -84,9 +94,10 @@ class HeatContext(Context): for name, sgattrs in attrs.get( "server_groups", {}).items()] - for name, netattrs in attrs["networks"].items(): - network = Network(name, self, netattrs) - self.networks.append(network) + self.assign_external_network(attrs["networks"]) + + self.networks = [Network(name, self, netattrs) for name, netattrs in + sorted(attrs["networks"].items())] for name, serverattrs in attrs["servers"].items(): server = Server(name, self, serverattrs) @@ -257,6 +268,8 @@ class HeatContext(Context): except OSError: LOG.exception("Key filename %s", self.key_filename) + super(HeatContext, self).undeploy() + def _get_server(self, attr_name): """lookup server info by name from context attr_name: either a name for a server created by yardstick or a dict diff --git a/yardstick/benchmark/contexts/node.py b/yardstick/benchmark/contexts/node.py index 6fa9aa99a..8bf915609 100644 --- a/yardstick/benchmark/contexts/node.py +++ b/yardstick/benchmark/contexts/node.py @@ -78,17 +78,40 @@ class NodeContext(Context): LOG.debug("Env: %r", self.env) def deploy(self): - setups = self.env.get('setup', []) - for setup in setups: - for host, info in setup.items(): - self._execute_script(host, info) + config_type = self.env.get('type', '') + if config_type == 'ansible': + self._dispatch_ansible('setup') + elif config_type == 'script': + self._dispatch_script('setup') def undeploy(self): - teardowns = self.env.get('teardown', []) - for teardown in teardowns: - for host, info in teardown.items(): + config_type = self.env.get('type', '') + if config_type == 'ansible': + self._dispatch_ansible('teardown') + elif config_type == 'script': + self._dispatch_script('teardown') + super(NodeContext, self).undeploy() + + def _dispatch_script(self, key): + steps = self.env.get(key, []) + for step in steps: + for host, info in step.items(): self._execute_script(host, info) + def _dispatch_ansible(self, key): + try: + step = self.env[key] + except KeyError: + pass + else: + self._do_ansible_job(step) + + def _do_ansible_job(self, path): + cmd = 'ansible-playbook -i inventory.ini %s' % path + base = '/home/opnfv/repos/yardstick/ansible' + p = subprocess.Popen(cmd, shell=True, cwd=base) + p.communicate() + def _get_server(self, attr_name): """lookup server info by name from context attr_name: a name for a server listed in nodes config file diff --git a/yardstick/benchmark/contexts/standalone.py b/yardstick/benchmark/contexts/standalone.py index eff700974..674e57f54 100644 --- a/yardstick/benchmark/contexts/standalone.py +++ b/yardstick/benchmark/contexts/standalone.py @@ -79,7 +79,7 @@ class StandaloneContext(Context): """don't need to undeploy""" # Todo: NFVi undeploy (sriov, vswitch, ovs etc) based on the config. - pass + super(StandaloneContext, self).undeploy() def _get_server(self, attr_name): """lookup server info by name from context diff --git a/yardstick/benchmark/core/task.py b/yardstick/benchmark/core/task.py index aecf5bf4a..2794d84f4 100644 --- a/yardstick/benchmark/core/task.py +++ b/yardstick/benchmark/core/task.py @@ -26,9 +26,11 @@ from yardstick.benchmark.contexts.base import Context from yardstick.benchmark.runners import base as base_runner from yardstick.common.task_template import TaskTemplate from yardstick.common.utils import source_env +from yardstick.common import utils from yardstick.common import constants output_file_default = "/tmp/yardstick.out" +config_file = '/etc/yardstick/yardstick.conf' test_cases_dir_default = "tests/opnfv/test_cases/" LOG = logging.getLogger(__name__) @@ -39,15 +41,21 @@ class Task(object): # pragma: no cover Set of commands to manage benchmark tasks. """ + def __init__(self): + self.config = {} + self.contexts = [] + def start(self, args, **kwargs): """Start a benchmark scenario.""" - atexit.register(atexit_handler) + atexit.register(self.atexit_handler) self.task_id = kwargs.get('task_id', str(uuid.uuid4())) check_environment() + self.config['yardstick'] = utils.parse_ini_file(config_file) + total_start_time = time.time() parser = TaskParser(args.inputfile[0]) @@ -70,8 +78,11 @@ class Task(object): # pragma: no cover for i in range(0, len(task_files)): one_task_start_time = time.time() parser.path = task_files[i] - scenarios, run_in_parallel, meet_precondition = parser.parse_task( - self.task_id, task_args[i], task_args_fnames[i]) + scenarios, run_in_parallel, meet_precondition, contexts = \ + parser.parse_task(self.task_id, task_args[i], + task_args_fnames[i]) + + self.contexts.extend(contexts) if not meet_precondition: LOG.info("meet_precondition is %s, please check envrionment", @@ -83,11 +94,11 @@ class Task(object): # pragma: no cover if args.keep_deploy: # keep deployment, forget about stack # (hide it for exit handler) - Context.list = [] + self.contexts = [] else: - for context in Context.list[::-1]: + for context in self.contexts[::-1]: context.undeploy() - Context.list = [] + self.contexts = [] one_task_end_time = time.time() LOG.info("task %s finished in %d secs", task_files[i], one_task_end_time - one_task_start_time) @@ -100,7 +111,7 @@ class Task(object): # pragma: no cover def _run(self, scenarios, run_in_parallel, output_file): """Deploys context and calls runners""" - for context in Context.list: + for context in self.contexts: context.deploy() background_runners = [] @@ -108,14 +119,14 @@ class Task(object): # pragma: no cover # Start all background scenarios for scenario in filter(_is_background_scenario, scenarios): scenario["runner"] = dict(type="Duration", duration=1000000000) - runner = run_one_scenario(scenario, output_file) + runner = self.run_one_scenario(scenario, output_file) background_runners.append(runner) runners = [] if run_in_parallel: for scenario in scenarios: if not _is_background_scenario(scenario): - runner = run_one_scenario(scenario, output_file) + runner = self.run_one_scenario(scenario, output_file) runners.append(runner) # Wait for runners to finish @@ -126,7 +137,7 @@ class Task(object): # pragma: no cover # run serially for scenario in scenarios: if not _is_background_scenario(scenario): - runner = run_one_scenario(scenario, output_file) + runner = self.run_one_scenario(scenario, output_file) runner_join(runner) print("Runner ended, output in", output_file) @@ -144,8 +155,91 @@ class Task(object): # pragma: no cover base_runner.Runner.release(runner) print("Background task ended") + def atexit_handler(self): + """handler for process termination""" + base_runner.Runner.terminate_all() + + if self.contexts: + print("Undeploying all contexts") + for context in self.contexts[::-1]: + context.undeploy() + + def run_one_scenario(self, scenario_cfg, output_file): + """run one scenario using context""" + runner_cfg = scenario_cfg["runner"] + runner_cfg['output_filename'] = output_file + + # TODO support get multi hosts/vms info + context_cfg = {} + if "host" in scenario_cfg: + context_cfg['host'] = Context.get_server(scenario_cfg["host"]) + + if "target" in scenario_cfg: + if is_ip_addr(scenario_cfg["target"]): + context_cfg['target'] = {} + context_cfg['target']["ipaddr"] = scenario_cfg["target"] + else: + context_cfg['target'] = Context.get_server( + scenario_cfg["target"]) + if self._is_same_heat_context(scenario_cfg["host"], + scenario_cfg["target"]): + context_cfg["target"]["ipaddr"] = \ + context_cfg["target"]["private_ip"] + else: + context_cfg["target"]["ipaddr"] = \ + context_cfg["target"]["ip"] + + if "targets" in scenario_cfg: + ip_list = [] + for target in scenario_cfg["targets"]: + if is_ip_addr(target): + ip_list.append(target) + context_cfg['target'] = {} + else: + context_cfg['target'] = Context.get_server(target) + if self._is_same_heat_context(scenario_cfg["host"], + target): + ip_list.append(context_cfg["target"]["private_ip"]) + else: + ip_list.append(context_cfg["target"]["ip"]) + context_cfg['target']['ipaddr'] = ','.join(ip_list) + + if "nodes" in scenario_cfg: + context_cfg["nodes"] = parse_nodes_with_context(scenario_cfg) + runner = base_runner.Runner.get(runner_cfg, self.config) + + print("Starting runner of type '%s'" % runner_cfg["type"]) + runner.run(scenario_cfg, context_cfg) + + return runner + + def _is_same_heat_context(self, host_attr, target_attr): + """check if two servers are in the same heat context + host_attr: either a name for a server created by yardstick or a dict + with attribute name mapping when using external heat templates + target_attr: either a name for a server created by yardstick or a dict + with attribute name mapping when using external heat templates + """ + return True + host = None + target = None + for context in self.contexts: + if context.__context_type__ != "Heat": + continue + + host = context._get_server(host_attr) + if host is None: + continue + + target = context._get_server(target_attr) + if target is None: + return False -# TODO: Move stuff below into TaskCommands class !? + # Both host and target is not None, then they are in the + # same heat context. + return True + + return False class TaskParser(object): # pragma: no cover @@ -265,6 +359,7 @@ class TaskParser(object): # pragma: no cover else: context_cfgs = [{"type": "Dummy"}] + contexts = [] name_suffix = '-{}'.format(task_id[:8]) for cfg_attrs in context_cfgs: try: @@ -272,20 +367,11 @@ class TaskParser(object): # pragma: no cover name_suffix) except KeyError: pass + # default to Heat context because we are testing OpenStack context_type = cfg_attrs.get("type", "Heat") - if "Heat" == context_type and "networks" in cfg_attrs: - # bugfix: if there are more than one network, - # only add "external_network" on first one. - # the name of netwrok should follow this rule: - # test, test2, test3 ... - # sort network with the length of network's name - sorted_networks = sorted(cfg_attrs["networks"]) - # config external_network based on env var - cfg_attrs["networks"][sorted_networks[0]]["external_network"] \ - = os.environ.get("EXTERNAL_NETWORK", "net04_ext") - context = Context.get(context_type) context.init(cfg_attrs) + contexts.append(context) run_in_parallel = cfg.get("run_in_parallel", False) @@ -304,7 +390,7 @@ class TaskParser(object): # pragma: no cover pass # TODO we need something better here, a class that represent the file - return cfg["scenarios"], run_in_parallel, meet_precondition + return cfg["scenarios"], run_in_parallel, meet_precondition, contexts def _check_schema(self, cfg_schema, schema_type): """Check if config file is using the correct schema type""" @@ -346,16 +432,6 @@ class TaskParser(object): # pragma: no cover return True -def atexit_handler(): - """handler for process termination""" - base_runner.Runner.terminate_all() - - if len(Context.list) > 0: - print("Undeploying all contexts") - for context in Context.list[::-1]: - context.undeploy() - - def is_ip_addr(addr): """check if string addr is an IP address""" try: @@ -371,34 +447,6 @@ def is_ip_addr(addr): return True -def _is_same_heat_context(host_attr, target_attr): - """check if two servers are in the same heat context - host_attr: either a name for a server created by yardstick or a dict - with attribute name mapping when using external heat templates - target_attr: either a name for a server created by yardstick or a dict - with attribute name mapping when using external heat templates - """ - host = None - target = None - for context in Context.list: - if context.__context_type__ != "Heat": - continue - - host = context._get_server(host_attr) - if host is None: - continue - - target = context._get_server(target_attr) - if target is None: - return False - - # Both host and target is not None, then they are in the - # same heat context. - return True - - return False - - def _is_background_scenario(scenario): if "run_in_background" in scenario: return scenario["run_in_background"] @@ -406,54 +454,6 @@ def _is_background_scenario(scenario): return False -def run_one_scenario(scenario_cfg, output_file): - """run one scenario using context""" - runner_cfg = scenario_cfg["runner"] - runner_cfg['output_filename'] = output_file - - # TODO support get multi hosts/vms info - context_cfg = {} - if "host" in scenario_cfg: - context_cfg['host'] = Context.get_server(scenario_cfg["host"]) - - if "target" in scenario_cfg: - if is_ip_addr(scenario_cfg["target"]): - context_cfg['target'] = {} - context_cfg['target']["ipaddr"] = scenario_cfg["target"] - else: - context_cfg['target'] = Context.get_server(scenario_cfg["target"]) - if _is_same_heat_context(scenario_cfg["host"], - scenario_cfg["target"]): - context_cfg["target"]["ipaddr"] = \ - context_cfg["target"]["private_ip"] - else: - context_cfg["target"]["ipaddr"] = \ - context_cfg["target"]["ip"] - - if "targets" in scenario_cfg: - ip_list = [] - for target in scenario_cfg["targets"]: - if is_ip_addr(target): - ip_list.append(target) - context_cfg['target'] = {} - else: - context_cfg['target'] = Context.get_server(target) - if _is_same_heat_context(scenario_cfg["host"], target): - ip_list.append(context_cfg["target"]["private_ip"]) - else: - ip_list.append(context_cfg["target"]["ip"]) - context_cfg['target']['ipaddr'] = ','.join(ip_list) - - if "nodes" in scenario_cfg: - context_cfg["nodes"] = parse_nodes_with_context(scenario_cfg) - runner = base_runner.Runner.get(runner_cfg) - - print("Starting runner of type '%s'" % runner_cfg["type"]) - runner.run(scenario_cfg, context_cfg) - - return runner - - def parse_nodes_with_context(scenario_cfg): """paras the 'nodes' fields in scenario """ nodes = scenario_cfg["nodes"] diff --git a/yardstick/benchmark/runners/base.py b/yardstick/benchmark/runners/base.py index 5b9081523..7c76e42df 100755 --- a/yardstick/benchmark/runners/base.py +++ b/yardstick/benchmark/runners/base.py @@ -35,15 +35,18 @@ log = logging.getLogger(__name__) CONF = cfg.CONF -def _output_serializer_main(filename, queue): +def _output_serializer_main(filename, queue, config): """entrypoint for the singleton subprocess writing to outfile Use of this process enables multiple instances of a scenario without messing up the output file. """ - config = {} - config["type"] = CONF.dispatcher.capitalize() - config["file_path"] = filename - dispatcher = DispatcherBase.get(config) + out_type = config['yardstick'].get('DEFAULT', {}).get('dispatcher', 'file') + conf = { + 'type': out_type.capitalize(), + 'file_path': filename + } + + dispatcher = DispatcherBase.get(conf, config) while True: # blocks until data becomes available @@ -123,21 +126,21 @@ class Runner(object): return types @staticmethod - def get(config): + def get(runner_cfg, config): """Returns instance of a scenario runner for execution type. """ # if there is no runner, start the output serializer subprocess if not Runner.runners: log.debug("Starting dump process file '%s'", - config["output_filename"]) + runner_cfg["output_filename"]) Runner.queue = multiprocessing.Queue() Runner.dump_process = multiprocessing.Process( target=_output_serializer_main, name="Dumper", - args=(config["output_filename"], Runner.queue)) + args=(runner_cfg["output_filename"], Runner.queue, config)) Runner.dump_process.start() - return Runner.get_cls(config["type"])(config, Runner.queue) + return Runner.get_cls(runner_cfg["type"])(runner_cfg, Runner.queue) @staticmethod def release_dump_process(): diff --git a/yardstick/benchmark/scenarios/compute/memload.py b/yardstick/benchmark/scenarios/compute/memload.py index 35528d4ef..2ef5a6302 100644 --- a/yardstick/benchmark/scenarios/compute/memload.py +++ b/yardstick/benchmark/scenarios/compute/memload.py @@ -74,10 +74,10 @@ class MEMLoad(base.Scenario): fields = [] free = {} ite = 0 - average = {'total': 0, 'used': 0, 'free': 0, 'cached': 0, 'shared': 0, - 'buffers': 0} - maximum = {'total': 0, 'used': 0, 'free': 0, 'cached': 0, 'shared': 0, - 'buffers': 0} + average = {'total': 0, 'used': 0, 'free': 0, 'buff/cache': 0, + 'shared': 0} + maximum = {'total': 0, 'used': 0, 'free': 0, 'buff/cache': 0, + 'shared': 0} for row in result.split('\n'): line = row.split() @@ -111,7 +111,7 @@ class MEMLoad(base.Scenario): interval = options.get("interval", 1) count = options.get("count", 1) - cmd = "free -s %s -c %s" % (interval, count) + cmd = "free -c '%s' -s '%s'" % (count, interval) result = self._execute_command(cmd) filtrated_result = self._filtrate_result(result) diff --git a/yardstick/benchmark/scenarios/networking/netutilization.py b/yardstick/benchmark/scenarios/networking/netutilization.py index 1ba6f1ec3..37da7f895 100644 --- a/yardstick/benchmark/scenarios/networking/netutilization.py +++ b/yardstick/benchmark/scenarios/networking/netutilization.py @@ -100,30 +100,22 @@ class NetUtilization(base.Scenario): average = {} time_marker = re.compile("^([0-9]+):([0-9]+):([0-9]+)$") - ampm_marker = re.compile("(AM|PM)$") # Parse network utilization stats - for row in raw_result.split('\n'): + for row in raw_result.splitlines(): line = row.split() if line and re.match(time_marker, line[0]): - if re.match(ampm_marker, line[1]): - del line[:2] - if line[0] == 'IFACE': - # header fields - fields = line[1:] - if len(fields) != NetUtilization.\ - NET_UTILIZATION_FIELD_SIZE: - raise RuntimeError("network_utilization: unexpected\ - field size", fields) - else: - # value fields + try: + index = line.index('IFACE') + except ValueError: + del line[:index] net_interface = line[0] values = line[1:] if values and len(values) == len(fields): - temp_dict = dict(list(zip(fields, values))) + temp_dict = dict(zip(fields, values)) if net_interface not in maximum: maximum[net_interface] = temp_dict else: @@ -144,6 +136,13 @@ class NetUtilization(base.Scenario): else: raise RuntimeError("network_utilization: parse error", fields, line) + else: + del line[:index] + fields = line[1:] + if len(fields) != NetUtilization.\ + NET_UTILIZATION_FIELD_SIZE: + raise RuntimeError("network_utilization: unexpected\ + field size", fields) elif line and line[0] == 'Average:': del line[:1] @@ -161,7 +160,7 @@ class NetUtilization(base.Scenario): values = line[1:] if values and len(values) == len(fields): average[net_interface] = dict( - list(zip(fields, values))) + zip(fields, values)) else: raise RuntimeError("network_utilization average: \ parse error", fields, line) diff --git a/yardstick/common/constants.py b/yardstick/common/constants.py index e068c0b98..54ddf33dc 100644 --- a/yardstick/common/constants.py +++ b/yardstick/common/constants.py @@ -33,6 +33,8 @@ YARDSTICK_ROOT_PATH = dirname(dirname(dirname(abspath(__file__)))) + sep TESTCASE_DIR = join(YARDSTICK_ROOT_PATH, 'tests/opnfv/test_cases/') +TESTSUITE_DIR = join(YARDSTICK_ROOT_PATH, 'tests/opnfv/test_suites/') + YARDSTICK_REPOS_DIR = '/home/opnfv/repos/yardstick' YARDSTICK_LOG_DIR = '/tmp/yardstick/' diff --git a/yardstick/common/openstack_utils.py b/yardstick/common/openstack_utils.py index aa369b896..2df8fa565 100644 --- a/yardstick/common/openstack_utils.py +++ b/yardstick/common/openstack_utils.py @@ -62,20 +62,6 @@ def get_credentials(): "project_domain_name": os.getenv('OS_PROJECT_DOMAIN_NAME') }) - cacert = os.environ.get("OS_CACERT") - - if cacert is not None: - # each openstack client uses differnt kwargs for this - creds.update({"cacert": cacert, - "ca_cert": cacert, - "https_ca_cert": cacert, - "https_cacert": cacert, - "ca_file": cacert}) - creds.update({"insecure": "True", "https_insecure": "True"}) - if not os.path.isfile(cacert): - log.info("WARNING: The 'OS_CACERT' environment variable is set \ - to %s but the file does not exist.", cacert) - return creds @@ -88,7 +74,12 @@ def get_session_auth(): def get_session(): auth = get_session_auth() - return session.Session(auth=auth) + try: + cacert = os.environ['OS_CACERT'] + except KeyError: + return session.Session(auth=auth) + else: + return session.Session(auth=auth, verify=cacert) def get_endpoint(service_type, endpoint_type='publicURL'): diff --git a/yardstick/common/utils.py b/yardstick/common/utils.py index 3c5895f1e..d2be8000e 100644 --- a/yardstick/common/utils.py +++ b/yardstick/common/utils.py @@ -26,6 +26,7 @@ import sys from functools import reduce import yaml +from six.moves import configparser from oslo_utils import importutils from oslo_serialization import jsonutils @@ -133,7 +134,9 @@ def source_env(env_file): def read_json_from_file(path): with open(path, 'r') as f: - return jsonutils.load(f) + j = f.read() + # don't use jsonutils.load() it conflicts with already decoded input + return jsonutils.loads(j) def write_json_to_file(path, data, mode='w'): @@ -144,3 +147,19 @@ def write_json_to_file(path, data, mode='w'): def write_file(path, data, mode='w'): with open(path, mode) as f: f.write(data) + + +def parse_ini_file(path): + parser = configparser.ConfigParser() + parser.read(path) + + try: + default = {k: v for k, v in parser.items('DEFAULT')} + except configparser.NoSectionError: + default = {} + + config = dict(DEFAULT=default, + **{s: {k: v for k, v in parser.items( + s)} for s in parser.sections()}) + + return config diff --git a/yardstick/dispatcher/base.py b/yardstick/dispatcher/base.py index 09ce8d1e8..a1c858297 100644 --- a/yardstick/dispatcher/base.py +++ b/yardstick/dispatcher/base.py @@ -38,10 +38,10 @@ class Base(object): raise RuntimeError("No such dispatcher_type %s" % dispatcher_type) @staticmethod - def get(config): + def get(conf, config): """Returns instance of a dispatcher for dispatcher type. """ - return Base.get_cls(config["type"])(config) + return Base.get_cls(conf["type"])(conf, config) @abc.abstractmethod def record_result_data(self, data): diff --git a/yardstick/dispatcher/file.py b/yardstick/dispatcher/file.py index 6fc81d419..8acd5dfbb 100644 --- a/yardstick/dispatcher/file.py +++ b/yardstick/dispatcher/file.py @@ -29,7 +29,7 @@ class FileDispatcher(DispatchBase): __dispatcher_type__ = "File" - def __init__(self, conf): + def __init__(self, conf, config): super(FileDispatcher, self).__init__(conf) self.result = [] diff --git a/yardstick/dispatcher/http.py b/yardstick/dispatcher/http.py index 790086155..e3bcbc89b 100644 --- a/yardstick/dispatcher/http.py +++ b/yardstick/dispatcher/http.py @@ -51,7 +51,7 @@ class HttpDispatcher(DispatchBase): __dispatcher_type__ = "Http" - def __init__(self, conf): + def __init__(self, conf, config): super(HttpDispatcher, self).__init__(conf) self.headers = {'Content-type': 'application/json'} self.timeout = CONF.dispatcher_http.timeout diff --git a/yardstick/dispatcher/influxdb.py b/yardstick/dispatcher/influxdb.py index d388d28a1..53af79c71 100644 --- a/yardstick/dispatcher/influxdb.py +++ b/yardstick/dispatcher/influxdb.py @@ -13,9 +13,9 @@ import logging import os import time +import collections import requests import six -from oslo_config import cfg from oslo_serialization import jsonutils from third_party.influxdb.influxdb_line_protocol import make_lines @@ -23,30 +23,6 @@ from yardstick.dispatcher.base import Base as DispatchBase LOG = logging.getLogger(__name__) -CONF = cfg.CONF -influx_dispatcher_opts = [ - cfg.StrOpt('target', - default='http://127.0.0.1:8086', - help='The target where the http request will be sent. ' - 'If this is not set, no data will be posted. For ' - 'example: target = http://hostname:1234/path'), - cfg.StrOpt('db_name', - default='yardstick', - help='The database name to store test results.'), - cfg.StrOpt('username', - default='root', - help='The user name to access database.'), - cfg.StrOpt('password', - default='root', - help='The user password to access database.'), - cfg.IntOpt('timeout', - default=5, - help='The max time in seconds to wait for a request to ' - 'timeout.'), -] - -CONF.register_opts(influx_dispatcher_opts, group="dispatcher_influxdb") - class InfluxdbDispatcher(DispatchBase): """Dispatcher class for posting data into an influxdb target. @@ -54,13 +30,14 @@ class InfluxdbDispatcher(DispatchBase): __dispatcher_type__ = "Influxdb" - def __init__(self, conf): + def __init__(self, conf, config): super(InfluxdbDispatcher, self).__init__(conf) - self.timeout = CONF.dispatcher_influxdb.timeout - self.target = CONF.dispatcher_influxdb.target - self.db_name = CONF.dispatcher_influxdb.db_name - self.username = CONF.dispatcher_influxdb.username - self.password = CONF.dispatcher_influxdb.password + db_conf = config['yardstick'].get('dispatcher_influxdb', {}) + self.timeout = int(db_conf.get('timeout', 5)) + self.target = db_conf.get('target', 'http://127.0.0.1:8086') + self.db_name = db_conf.get('db_name', 'yardstick') + self.username = db_conf.get('username', 'root') + self.password = db_conf.get('password', 'root') self.influxdb_url = "%s/write?db=%s" % (self.target, self.db_name) self.raw_result = [] self.case_name = "" @@ -79,15 +56,17 @@ class InfluxdbDispatcher(DispatchBase): def _dict_key_flatten(self, data): next_data = {} - if not [v for v in data.values() - if type(v) == dict or type(v) == list]: + # use list, because iterable is too generic + if not [v for v in data.values() if + isinstance(v, (collections.Mapping, list))]: return data for k, v in six.iteritems(data): - if type(v) == dict: + if isinstance(v, collections.Mapping): for n_k, n_v in six.iteritems(v): next_data["%s.%s" % (k, n_k)] = n_v - elif type(v) == list: + # use list because iterable is too generic + elif isinstance(v, list): for index, item in enumerate(v): next_data["%s%d" % (k, index)] = item else: @@ -119,11 +98,12 @@ class InfluxdbDispatcher(DispatchBase): def _data_to_line_protocol(self, data): msg = {} - point = {} - point["measurement"] = self.tc - point["fields"] = self._dict_key_flatten(data["benchmark"]["data"]) - point["time"] = self._get_nano_timestamp(data) - point["tags"] = self._get_extended_tags(data) + point = { + "measurement": self.tc, + "fields": self._dict_key_flatten(data["benchmark"]["data"]), + "time": self._get_nano_timestamp(data), + "tags": self._get_extended_tags(data), + } msg["points"] = [point] msg["tags"] = self.static_tags diff --git a/yardstick/network_services/traffic_profile/fixed.py b/yardstick/network_services/traffic_profile/fixed.py index a456c2bd7..ebc1e61f2 100644 --- a/yardstick/network_services/traffic_profile/fixed.py +++ b/yardstick/network_services/traffic_profile/fixed.py @@ -43,7 +43,8 @@ class FixedProfile(TrafficProfile): self._create_stream(src_ip, dst_ip), ports=[ports]) - traffic_generator.client.start(ports=traffic_generator.my_ports) + traffic_generator.client.start(ports=traffic_generator.my_ports, + force=True) self.first_run = False def _create_stream(self, src_ip, dst_ip): diff --git a/yardstick/network_services/vnf_generic/vnf/tg_trex.py b/yardstick/network_services/vnf_generic/vnf/tg_trex.py index 2731476e0..1e751bfce 100644 --- a/yardstick/network_services/vnf_generic/vnf/tg_trex.py +++ b/yardstick/network_services/vnf_generic/vnf/tg_trex.py @@ -31,6 +31,7 @@ from stl.trex_stl_lib.trex_stl_exceptions import STLError LOG = logging.getLogger(__name__) DURATION = 30 +WAIT_QUEUE = 1 TREX_SYNC_PORT = 4500 TREX_ASYNC_PORT = 4501 @@ -259,6 +260,7 @@ class TrexTrafficGen(GenericTrafficGen): "tx_throughput_mbps": float(xe_value.get("tx_bps", 0.0)), "in_packets": xe_value.get("ipackets", 0), "out_packets": xe_value.get("opackets", 0)} + time.sleep(WAIT_QUEUE) queue.put(samples) self.client.disconnect() diff --git a/yardstick/orchestrator/heat.py b/yardstick/orchestrator/heat.py index 500776e0e..49126f661 100644 --- a/yardstick/orchestrator/heat.py +++ b/yardstick/orchestrator/heat.py @@ -21,7 +21,6 @@ import time import heatclient import pkg_resources -from oslo_serialization import jsonutils from oslo_utils import encodeutils import yardstick.common.openstack_utils as op_utils @@ -453,11 +452,9 @@ class HeatTemplate(HeatObject): stack = HeatStack(self.name) heat = self._get_heat_client() - json_template = jsonutils.dump_as_bytes( - self._template) start_time = time.time() stack.uuid = self.uuid = heat.stacks.create( - stack_name=self.name, template=json_template, + stack_name=self.name, template=self._template, parameters=self.heat_parameters)['stack']['id'] status = self.status() |